/*
 * Product Enquiry popup — opened from the homepage Collections section's
 * "Explore" cards (see class-sla-product-enquiry.php and homepage-
 * collections.php's data-sla-product-id hook). Scoped entirely under
 * .sla-enquiry-* / .sla-enquiry so nothing here can collide with the Shop
 * page's own .sla-quick-view-* modal or any global button/header/footer
 * style — this file is the popup's complete, self-contained visual system.
 *
 * Colors/fonts are the same --sla-* tokens every other section uses
 * (assets/css/design-tokens.css, loaded site-wide by the theme — see this
 * file's own wp_enqueue_style dependency on that handle).
 */

.sla-enquiry-overlay,
.sla-enquiry-overlay *,
.sla-enquiry-overlay *::before,
.sla-enquiry-overlay *::after {
	box-sizing: border-box;
}

.sla-enquiry-overlay {
	position: fixed;
	inset: 0;
	z-index: 2500;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp( 1rem, 4vw, 2.5rem );
	background: rgba( 5, 35, 45, 0.65 );
	-webkit-backdrop-filter: blur( 3px );
	backdrop-filter: blur( 3px );
	opacity: 0;
	pointer-events: none;
	transition: opacity 300ms ease;
}

.sla-enquiry-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.sla-enquiry {
	position: relative;
	width: min( 90vw, 1150px );
	min-width: min( 65vw, 100% );
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	background: var( --sla-ivory );
	border: 1px solid var( --sla-light-gold );
	border-radius: 16px;
	box-shadow: 0 30px 70px -20px rgba( 5, 35, 45, 0.5 );
	overflow: hidden;
	transform: scale( 0.97 );
	opacity: 0;
	transition: transform 300ms ease, opacity 300ms ease;
}

.sla-enquiry-overlay.is-open .sla-enquiry {
	transform: scale( 1 );
	opacity: 1;
}

.sla-enquiry__close {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	z-index: 3;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba( 255, 255, 255, 0.85 );
	border: 1px solid var( --sla-light-gold );
	border-radius: 50%;
	color: var( --sla-peacock-navy );
	cursor: pointer;
	transition: background-color 200ms ease, transform 200ms ease;
}

.sla-enquiry__close:hover,
.sla-enquiry__close:focus-visible {
	background: var( --sla-champagne-gold );
}

.sla-enquiry__close:focus-visible {
	outline: 2px solid var( --sla-peacock-navy );
	outline-offset: 2px;
}

.sla-enquiry__close svg {
	width: 16px;
	height: 16px;
}

.sla-enquiry__body {
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

/* -----------------------------------------------------------------------
 * Loading / error states — shown in place of the full layout below while
 * the product payload is being fetched (see product-enquiry.js).
 * --------------------------------------------------------------------- */
.sla-enquiry__status {
	padding: 4rem 2rem;
	text-align: center;
	font-family: var( --sla-font-body );
	color: var( --sla-peacock-navy );
}

.sla-enquiry__retry {
	margin-top: 1rem;
	padding: 0.6rem 1.4rem;
	font-family: var( --sla-font-body );
	font-size: 0.9rem;
	color: var( --sla-peacock-navy );
	background: transparent;
	border: 1px solid var( --sla-champagne-gold );
	border-radius: 999px;
	cursor: pointer;
}

.sla-enquiry__retry:hover,
.sla-enquiry__retry:focus-visible {
	background: var( --sla-warm-cream );
}

/* Skeleton — only used when a product's data was not embedded in the page
 * and has to be fetched: the real layout's own boxes (same classes, so the
 * same size) with quiet placeholder blocks in place of the content. */
.sla-enquiry__skeleton {
	display: block;
	background: var( --sla-warm-cream );
	border-radius: 6px;
	animation: sla-enquiry-pulse 1.4s ease-in-out infinite;
}

.sla-enquiry__skeleton-line {
	height: 0.9rem;
	margin: 0 0 0.9rem;
}

.sla-enquiry__skeleton-line.is-title {
	width: 60%;
	height: 1.6rem;
	margin-bottom: 1.2rem;
}

.sla-enquiry__skeleton-line.is-short {
	width: 40%;
}

@keyframes sla-enquiry-pulse {
	50% {
		opacity: 0.55;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sla-enquiry__skeleton {
		animation: none;
	}
}

/* -----------------------------------------------------------------------
 * Layout — desktop two-column (gallery | info+form), mobile single column
 * in the exact stacked order the brief specifies (gallery, name,
 * description, price, form) — see the breakpoint below.
 * --------------------------------------------------------------------- */
.sla-enquiry__layout {
	display: flex;
	flex-direction: column;
}

.sla-enquiry__gallery {
	padding: 1.5rem 1.5rem 0;
}

.sla-enquiry__main {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	border-radius: 10px;
	overflow: hidden;
	background: var( --sla-warm-cream );
	border: 1px solid var( --sla-light-gold );
}

.sla-enquiry__main-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 1;
	transition: opacity 200ms ease;
}

.sla-enquiry__main-img.is-fading {
	opacity: 0;
}

.sla-enquiry__thumbs {
	display: flex;
	gap: 0.6rem;
	margin-top: 0.75rem;
	overflow-x: auto;
	padding-bottom: 0.25rem;
}

.sla-enquiry__thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	padding: 0;
	border-radius: 8px;
	overflow: hidden;
	background: var( --sla-warm-cream );
	border: 2px solid transparent;
	cursor: pointer;
	transition: border-color 200ms ease;
}

.sla-enquiry__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sla-enquiry__thumb.is-active,
.sla-enquiry__thumb:hover,
.sla-enquiry__thumb:focus-visible {
	border-color: var( --sla-champagne-gold );
}

.sla-enquiry__thumb:focus-visible {
	outline: 2px solid var( --sla-peacock-navy );
	outline-offset: 1px;
}

.sla-enquiry__info {
	padding: 1.75rem 1.75rem 2rem;
}

.sla-enquiry__name {
	font-family: var( --sla-font-display );
	font-weight: 700;
	font-size: clamp( 1.5rem, 1.3rem + 1vw, 1.75rem );
	line-height: 1.2;
	color: var( --sla-peacock-navy );
	margin: 0 0 0.6rem;
}

.sla-enquiry__desc {
	font-family: var( --sla-font-body );
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var( --sla-deep-navy );
	opacity: 0.85;
	margin: 0 0 0.85rem;
}

.sla-enquiry__price {
	font-family: var( --sla-font-body );
	font-size: 1.1875rem;
	font-weight: 700;
	color: var( --sla-peacock-navy );
	margin: 0 0 1rem;
}

.sla-enquiry__price del {
	opacity: 0.55;
	font-weight: 500;
	margin-right: 0.4em;
}

.sla-enquiry__price ins {
	text-decoration: none;
	color: var( --sla-wine );
}

.sla-enquiry__divider {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0 0 1.25rem;
}

.sla-enquiry__divider::before,
.sla-enquiry__divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var( --sla-light-gold );
}

.sla-enquiry__divider-mark {
	width: 7px;
	height: 7px;
	border: 1px solid var( --sla-champagne-gold );
	transform: rotate( 45deg );
	flex: 0 0 auto;
}

.sla-enquiry__form-heading {
	font-family: var( --sla-font-display );
	font-weight: 600;
	font-size: 1.1875rem;
	color: var( --sla-peacock-navy );
	margin: 0 0 1rem;
}

.sla-enquiry__form {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.sla-enquiry__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.sla-enquiry__field-label {
	font-family: var( --sla-font-body );
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --sla-peacock-navy );
}

.sla-enquiry__field-label .sla-enquiry__optional {
	text-transform: none;
	font-weight: 500;
	opacity: 0.55;
	letter-spacing: 0;
}

.sla-enquiry__field input,
.sla-enquiry__field textarea {
	width: 100%;
	font-family: var( --sla-font-body );
	font-size: 0.9375rem;
	color: var( --sla-peacock-navy );
	background: var( --sla-white, #fff );
	border: 1px solid var( --sla-light-gold );
	border-radius: 8px;
	padding: 0.7rem 0.85rem;
	transition: border-color 200ms ease, box-shadow 200ms ease;
}

.sla-enquiry__field textarea {
	resize: vertical;
	min-height: 5.5rem;
}

.sla-enquiry__field input:focus-visible,
.sla-enquiry__field textarea:focus-visible {
	outline: none;
	border-color: var( --sla-champagne-gold );
	box-shadow: 0 0 0 3px rgba( 197, 160, 89, 0.2 );
}

.sla-enquiry__field.has-error input,
.sla-enquiry__field.has-error textarea {
	border-color: var( --sla-wine );
}

.sla-enquiry__field-error {
	font-family: var( --sla-font-body );
	font-size: 0.8125rem;
	color: var( --sla-wine );
	display: none;
}

.sla-enquiry__field.has-error .sla-enquiry__field-error {
	display: block;
}

/* Honeypot — visually and functionally hidden from real visitors, but
 * still present/focusable in markup order for basic bots that fill every
 * field blindly (see class-sla-product-enquiry.php's honeypot check). */
.sla-enquiry__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sla-enquiry__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	margin-top: 0.25rem;
	padding: 0.9rem 1.5rem;
	background: var( --sla-champagne-gold );
	color: var( --sla-peacock-navy );
	font-family: var( --sla-font-body );
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: 1px solid var( --sla-light-gold );
	border-radius: 6px;
	box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.35 ), 0 8px 18px -10px rgba( 0, 0, 0, 0.35 );
	cursor: pointer;
	transition: transform 280ms ease, box-shadow 280ms ease, background-color 280ms ease, filter 280ms ease;
}

.sla-enquiry__submit:hover,
.sla-enquiry__submit:focus-visible {
	background: var( --sla-antique-gold );
	transform: translateY( -2px );
	box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.2 ), 0 14px 26px -12px rgba( 0, 0, 0, 0.4 );
}

.sla-enquiry__submit:focus-visible {
	outline: 2px solid var( --sla-peacock-navy );
	outline-offset: 3px;
}

.sla-enquiry__submit:disabled {
	opacity: 0.65;
	cursor: default;
	transform: none;
}

.sla-enquiry__submit-arrow {
	width: 14px;
	height: 14px;
	transition: transform 280ms ease;
}

.sla-enquiry__submit:hover .sla-enquiry__submit-arrow,
.sla-enquiry__submit:focus-visible .sla-enquiry__submit-arrow {
	transform: translateX( 5px );
}

.sla-enquiry__form-error {
	font-family: var( --sla-font-body );
	font-size: 0.875rem;
	color: var( --sla-wine );
	margin: 0;
}

/* -----------------------------------------------------------------------
 * Success state — replaces only .sla-enquiry__form-wrap's contents, so the
 * gallery/name/price above stay visible (see product-enquiry.js).
 * --------------------------------------------------------------------- */
.sla-enquiry__success {
	text-align: center;
	padding: 1.5rem 0.5rem;
}

.sla-enquiry__success-icon {
	width: 46px;
	height: 46px;
	margin: 0 auto 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: var( --sla-champagne-gold );
	color: var( --sla-peacock-navy );
}

.sla-enquiry__success-icon svg {
	width: 22px;
	height: 22px;
}

.sla-enquiry__success-title {
	font-family: var( --sla-font-display );
	font-weight: 700;
	font-size: 1.25rem;
	color: var( --sla-peacock-navy );
	margin: 0 0 0.5rem;
}

.sla-enquiry__success-text {
	font-family: var( --sla-font-body );
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var( --sla-deep-navy );
	opacity: 0.85;
	margin: 0;
}

/* -----------------------------------------------------------------------
 * Desktop / tablet — two-column layout at >=1024px per the brief's
 * responsive breakpoints; 768-1023px keeps a single column (a half-width
 * gallery + form at tablet widths reads as cramped) but with a roomier
 * popup width than mobile gets.
 * --------------------------------------------------------------------- */
@media ( min-width: 768px ) and ( max-width: 1023.98px ) {
	.sla-enquiry {
		width: 88vw;
		max-width: 680px;
	}
}

@media ( min-width: 1024px ) {
	.sla-enquiry {
		width: clamp( 65vw, 90vw, 1150px );
	}

	.sla-enquiry__layout {
		flex-direction: row;
		align-items: stretch;
	}

	.sla-enquiry__gallery {
		flex: 0 0 42%;
		padding: 2rem 0 2rem 2rem;
	}

	.sla-enquiry__info {
		flex: 1 1 auto;
		padding: 2rem 2.5rem 2rem 2rem;
		min-width: 0;
	}

	.sla-enquiry__name {
		font-size: clamp( 1.75rem, 1.3rem + 1.2vw, 2.25rem );
	}
}

/* -----------------------------------------------------------------------
 * Mobile (<768px) — generous width per the brief (92vw, no max-width cap)
 * and a fully single-column stacked order.
 * --------------------------------------------------------------------- */
@media ( max-width: 767.98px ) {
	.sla-enquiry {
		width: 92vw;
		max-width: none;
		max-height: 90vh;
	}

	.sla-enquiry__gallery {
		padding: 1.25rem 1.25rem 0;
	}

	.sla-enquiry__info {
		padding: 1.25rem 1.25rem 1.75rem;
	}

	.sla-enquiry__name {
		font-size: clamp( 1.375rem, 1.2rem + 0.8vw, 1.75rem );
	}

	.sla-enquiry__close {
		top: 0.6rem;
		right: 0.6rem;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.sla-enquiry-overlay,
	.sla-enquiry,
	.sla-enquiry__main-img,
	.sla-enquiry__submit,
	.sla-enquiry__submit-arrow {
		transition: none;
	}
}
