/* =========================================================
   Quick Checkout for WooCommerce — front-end styles
   Tweak the variables below to match your Elessi child theme.
   ========================================================= */
:root {
	--qcw-accent: #c9a15a;      /* change to your brand/gold accent color */
	--qcw-accent-dark: #a9813f;
	--qcw-text: #222;
	--qcw-border: #e5e5e5;
	--qcw-radius: 6px;
}

/* ---------- Button on product cards (loop) ---------- */
.qcw-quick-checkout-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	cursor: pointer;
	background: #fff;
	color: var(--qcw-text);
	border: 1px solid var(--qcw-border);
	border-radius: 50%;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 13px;
	line-height: 1;
	transition: all .25s ease;
	box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.qcw-quick-checkout-btn:hover {
	background: var(--qcw-accent);
	border-color: var(--qcw-accent);
	color: #fff;
}
.qcw-quick-checkout-btn .qcw-icon { flex: 0 0 auto; }
.qcw-quick-checkout-btn .qcw-btn-label { display: none; }

/* icon+text / text-only variants widen the pill */
.qcw-quick-checkout-btn.qcw-display-icon_text,
.qcw-quick-checkout-btn.qcw-display-text_only {
	width: auto;
	border-radius: 20px;
	padding: 0 14px;
	height: 38px;
}
.qcw-quick-checkout-btn.qcw-display-icon_text .qcw-btn-label,
.qcw-quick-checkout-btn.qcw-display-text_only .qcw-btn-label {
	display: inline-block;
	white-space: nowrap;
	font-weight: 500;
}

/* Overlay position: sits with the theme's existing hover icon stack
   (bag / wishlist / quickview / compare). Adjust top/right if your
   theme's icon column is positioned differently.
   Note: the actual positioning context (position:relative on the
   thumbnail link) and the show/hide-on-hover behaviour are both also
   enforced by JS (see initOverlayButtons() in quick-checkout.js) so this
   works even if the theme's own CSS doesn't cooperate. The rules below
   are the visual styling; .qcw-force-visible is the JS-driven hover state. */
.qcw-quick-checkout-btn.qcw-pos-overlay {
	position: absolute;
	right: 14px;
	top: 14px;
	z-index: 5;
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
}
.qcw-quick-checkout-btn.qcw-pos-overlay.qcw-force-visible {
	opacity: 1 !important;
	transform: translateY(0) !important;
	pointer-events: auto !important;
}
/* CSS-only fallback for themes where li.product IS the positioned ancestor
   and JS somehow hasn't run yet (e.g. very first paint). */
li.product:hover .qcw-quick-checkout-btn.qcw-pos-overlay,
li.product:focus-within .qcw-quick-checkout-btn.qcw-pos-overlay {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

/* If your theme already stacks icons centered at the bottom of the image
   instead of top-right, swap to this alternative by adding class
   qcw-pos-overlay-bottom via a small filter/hook edit, or just edit here: */
/* .qcw-quick-checkout-btn.qcw-pos-overlay { top: auto; bottom: 14px; right: 50%; transform: translateX(50%); } */

.qcw-quick-checkout-btn.qcw-pos-below_title {
	position: static;
	margin: 8px 0 0;
	opacity: 1;
	transform: none;
	pointer-events: auto;
	border-radius: 20px;
	width: auto;
	padding: 0 14px;
	height: 38px;
}
.qcw-quick-checkout-btn.qcw-pos-below_title .qcw-btn-label { display: inline-block; }

/* Mobile: hover doesn't exist on touch, so always show the button */
@media (max-width: 767px) {
	.qcw-quick-checkout-btn.qcw-pos-overlay {
		opacity: 1;
		transform: none;
		pointer-events: auto;
		width: 34px;
		height: 34px;
		top: 8px;
		right: 8px;
	}
	.qcw-quick-checkout-btn.qcw-display-icon_text.qcw-pos-overlay,
	.qcw-quick-checkout-btn.qcw-display-text_only.qcw-pos-overlay {
		width: auto;
		height: 32px;
		padding: 0 10px;
		font-size: 12px;
	}
}

/* ---------- Button on single product page ---------- */
.qcw-quick-checkout-btn.qcw-single-btn {
	width: auto;
	border-radius: 30px;
	padding: 0 22px;
	height: 46px;
	margin: 10px 0 0 10px;
	background: var(--qcw-accent);
	border-color: var(--qcw-accent);
	color: #fff;
}
.qcw-quick-checkout-btn.qcw-single-btn:hover { background: var(--qcw-accent-dark); }
.qcw-quick-checkout-btn.qcw-single-btn .qcw-btn-label { display: inline-block; }

/* ---------- Modal overlay ---------- */
.qcw-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.55);
	z-index: 100000;
	padding: 24px;
	overflow-y: auto;
}
.qcw-modal-overlay.qcw-open { display: flex; align-items: flex-start; justify-content: center; }

.qcw-modal {
	background: #fff;
	width: 100%;
	max-width: 980px;
	margin: 24px auto;
	border-radius: 10px;
	position: relative;
	display: flex;
	overflow: hidden;
	max-height: calc(100vh - 48px);
}

.qcw-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	z-index: 2;
}
.qcw-modal-close:hover { color: #000; }

.qcw-modal-loading {
	width: 100%;
	padding: 80px 0;
	text-align: center;
}
.qcw-spinner {
	width: 34px; height: 34px;
	border: 3px solid var(--qcw-border);
	border-top-color: var(--qcw-accent);
	border-radius: 50%;
	margin: 0 auto 12px;
	animation: qcw-spin 0.8s linear infinite;
}
@keyframes qcw-spin { to { transform: rotate(360deg); } }

.qcw-modal-body {
	display: flex;
	width: 100%;
	overflow-y: auto;
}

/* LEFT column — gallery */
.qcw-modal-left {
	flex: 0 0 42%;
	padding: 30px;
	border-right: 1px solid var(--qcw-border);
	overflow-y: auto;
}
.qcw-gallery-main {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f7f7f7;
	border-radius: var(--qcw-radius);
	overflow: hidden;
	display: flex; align-items: center; justify-content: center;
}
.qcw-gallery-main-img { width: 100%; height: 100%; object-fit: cover; }
.qcw-gallery-thumbs {
	display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.qcw-gallery-thumbs img {
	width: 56px; height: 56px; object-fit: cover;
	border-radius: 4px; cursor: pointer;
	border: 2px solid transparent;
}
.qcw-gallery-thumbs img.qcw-active-thumb { border-color: var(--qcw-accent); }

.qcw-product-title { font-size: 20px; margin: 18px 0 6px; }
.qcw-product-price { font-size: 18px; font-weight: 600; color: var(--qcw-accent-dark); margin-bottom: 10px; }
.qcw-product-variations select { width: 100%; margin-bottom: 8px; padding: 8px; border-radius: var(--qcw-radius); border: 1px solid var(--qcw-border); }
.qcw-modal-note { font-size: 13px; color: #777; margin-top: 14px; }

/* RIGHT column — form */
.qcw-modal-right { flex: 1; padding: 30px; overflow-y: auto; }
.qcw-field-row { margin-bottom: 14px; }
.qcw-field-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.qcw-field-row .req { color: #d54747; }
.qcw-field-row input[type="text"],
.qcw-field-row input[type="tel"],
.qcw-field-row input[type="email"],
.qcw-field-row select,
.qcw-field-row textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--qcw-border);
	border-radius: var(--qcw-radius);
	font-size: 14px;
}
.qcw-field-half-group, .qcw-field-three-group { display: flex; gap: 12px; }
.qcw-field-half { flex: 1; }
.qcw-field-third { flex: 1; }
.qcw-readonly-field { background: #f7f7f7; color: #555; cursor: not-allowed; }

.qcw-qty-row { display: flex; align-items: center; gap: 14px; }
.qcw-qty-row label { margin-bottom: 0; }
.qcw-qty-stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--qcw-border);
	border-radius: 30px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.qcw-qty-stepper button {
	width: 32px;
	height: 32px;
	border: none;
	background: #fff;
	color: var(--qcw-text);
	cursor: pointer;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .18s ease, color .18s ease;
	-webkit-tap-highlight-color: transparent;
}
.qcw-qty-stepper button:hover {
	background: var(--qcw-accent);
	color: #fff;
}
.qcw-qty-stepper button:active { transform: scale(0.94); }
.qcw-qty-stepper input {
	width: 34px;
	text-align: center;
	border: none;
	border-left: 1px solid var(--qcw-border);
	border-right: 1px solid var(--qcw-border);
	height: 32px;
	padding: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--qcw-text);
	-moz-appearance: textfield;
}
/* Hide native number spinner arrows so only our +/- controls show */
.qcw-qty-stepper input::-webkit-outer-spin-button,
.qcw-qty-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.qcw-qty-stepper input:focus { outline: none; background: #faf7f0; }

.qcw-payment-list label { font-weight: 400; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; }
.qcw-single-payment-note {
	background: #faf7f0;
	border: 1px solid #ecdfc4;
	border-radius: var(--qcw-radius);
	padding: 10px 14px;
	font-size: 13.5px;
	color: #555;
	margin: 0;
}

.qcw-totals { border-top: 1px solid var(--qcw-border); margin-top: 6px; padding-top: 12px; }
.qcw-totals-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; color: #555; }
.qcw-totals-grand { font-size: 17px; font-weight: 700; color: var(--qcw-text); }

.qcw-form-message { font-size: 13px; margin: 10px 0; min-height: 18px; }
.qcw-form-message.qcw-error { color: #d54747; }
.qcw-form-message.qcw-success { color: #2e8b57; }

.qcw-place-order-btn {
	width: 100%;
	background: var(--qcw-accent);
	color: #fff;
	border: none;
	padding: 14px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 30px;
	cursor: pointer;
	transition: background .2s ease;
}
.qcw-place-order-btn:hover { background: var(--qcw-accent-dark); }
.qcw-place-order-btn:disabled { opacity: .6; cursor: not-allowed; }
.qcw-secure-note { font-size: 12px; color: #888; text-align: center; margin-top: 10px; }

/* ---------- Responsive: mobile stacks into one column ---------- */
@media (max-width: 767px) {
	.qcw-modal-overlay { padding: 0; }
	.qcw-modal { margin: 0; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
	.qcw-modal-body { flex-direction: column; }
	.qcw-modal-left { flex: none; border-right: none; border-bottom: 1px solid var(--qcw-border); padding: 20px; }
	.qcw-modal-right { padding: 20px; }
	.qcw-field-three-group { flex-direction: column; gap: 0; }
}

body.qcw-modal-open { overflow: hidden; }
