/**
 * Xtreme Pre-Order Enquiry - front-end styles.
 *
 * Tokens follow the X-Treme Solution Elementor kit (same globals the theme's
 * assets/xs.css reads), with literal fallbacks if a global is missing:
 *   primary   green   #0BB622   --e-global-color-primary
 *   surface   black   #000000   --e-global-color-secondary
 *   text      white   #FFFFFF   --e-global-color-text
 *   line      grey    #363636   --e-global-color-accent
 *   panel     #212121           --e-global-color-f174bc3
 *   body      Poppins           --e-global-typography-text-font-family
 *   display   Black Ops One     --e-global-typography-secondary-font-family
 *
 * --xpe-accent / --xpe-accent-hover are overridden from Settings > Colours.
 */

:root {
	--xpe-accent: var(--e-global-color-primary, #0BB622);
	--xpe-accent-hover: #2BD843;
	--xpe-ink: var(--e-global-color-text, #ffffff);
	--xpe-muted: rgba(255, 255, 255, 0.62);
	--xpe-faint: rgba(255, 255, 255, 0.1);
	--xpe-line: var(--e-global-color-accent, #363636);
	--xpe-surface: var(--e-global-color-secondary, #000000);
	--xpe-panel: var(--e-global-color-f174bc3, #212121);
	--xpe-error: #ff5c5c;
	--xpe-radius: 14px;
	--xpe-font-body: var(--e-global-typography-text-font-family, "Poppins"), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--xpe-font-display: var(--e-global-typography-secondary-font-family, "Black Ops One"), var(--e-global-typography-text-font-family, "Poppins"), sans-serif;
}

/* ---------------------------------------------------------------- Button */

.xpe-enquire-button {
	cursor: pointer;
}

/*
 * The loop button inherits the original Add to cart classes, so the theme /
 * Elementor styles it. These rules only make a <button> sit like the <a> it
 * replaces and keep it full width in the card's add-to-cart row.
 */
.xpe-enquire-button--loop {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-family: inherit;
}

.elementor-widget-woocommerce-product-add-to-cart form.cart > .xpe-enquire-button {
	flex: 1 1 auto !important;
}

/* The quantity stepper is meaningless for an enquiry. */
form.cart:has(.xpe-enquire-button) .quantity,
.xpe-enquiry-single form.cart .quantity {
	display: none !important;
}

/* Single product: a solid green button unless the Elementor widget styles it. */
.xpe-single-wrap {
	display: block !important;
	margin: 0 0 1.5em;
}

.xpe-enquire-button--single {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 240px;
	min-height: 48px;
	padding: 0 28px;
	font-family: var(--xpe-font-body);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #ffffff;
	background: var(--xpe-accent);
	border: 0;
	border-radius: 6px;
	transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.xpe-enquire-button--single:hover,
.xpe-enquire-button--single:focus-visible {
	color: #ffffff;
	filter: brightness(1.1);
	box-shadow: 0 0 16px rgba(11, 182, 34, 0.4);
}

.xpe-enquire-button--single:active {
	transform: translateY(1px);
}

.xpe-single-note {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
	opacity: 0.75;
}

/* Hide any leftover cart UI on pre-order product pages. */
.xpe-enquiry-single .single_add_to_cart_button:not(.xpe-enquire-button),
.xpe-enquiry-single .sticky-add-to-cart,
.xpe-enquiry-single .sticky-add-to-cart-wrapper {
	display: none !important;
}

/* ----------------------------------------------------------------- Modal */

.xpe-modal[hidden] {
	display: none;
}

.xpe-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	font-family: var(--xpe-font-body);
	font-size: 15px;
	line-height: 1.6;
	color: var(--xpe-ink);
	-webkit-font-smoothing: antialiased;
}

.xpe-modal *,
.xpe-modal *::before,
.xpe-modal *::after {
	box-sizing: border-box;
}

.xpe-modal__overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.78);
	backdrop-filter: blur(3px);
	animation: xpe-fade 0.22s ease both;
}

.xpe-modal__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 620px;
	margin: auto;
	background: var(--xpe-surface);
	border: 1px solid var(--xpe-line);
	border-top: 3px solid var(--xpe-accent);
	border-radius: var(--xpe-radius);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(11, 182, 34, 0.08);
	animation: xpe-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
	overflow: hidden;
}

@keyframes xpe-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes xpe-rise {
	from { opacity: 0; transform: translateY(18px) scale(0.985); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.xpe-modal__overlay,
	.xpe-modal__dialog,
	.xpe-success {
		animation: none;
	}
}

.xpe-modal .xpe-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-height: 0;
	margin: 0;
	padding: 0;
	line-height: 1;
	font-size: 26px;
	color: var(--xpe-muted);
	background: transparent;
	border: 1px solid transparent;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.xpe-modal .xpe-modal__close:hover,
.xpe-modal .xpe-modal__close:focus-visible {
	color: var(--xpe-accent);
	background: transparent;
	border-color: var(--xpe-line);
	outline: none;
}

/* --------------------------------------------------------------- Header */

.xpe-modal__header {
	padding: 28px 32px 0;
}

.xpe-modal .xpe-modal__eyebrow {
	margin: 0 0 6px;
	font-family: var(--xpe-font-display);
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--xpe-accent);
}

/* Same treatment as the theme's shop-filter panel title: Poppins caps + green underscore. */
.xpe-modal .xpe-modal__title {
	margin: 0 0 14px;
	padding: 0;
	font-family: var(--xpe-font-body);
	font-size: 26px;
	font-weight: var(--e-global-typography-primary-font-weight, 600);
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--xpe-ink);
}

.xpe-modal .xpe-modal__title::after {
	content: "";
	display: block;
	width: 40px;
	height: 3px;
	margin-top: 10px;
	border-radius: 2px;
	background: var(--xpe-accent);
}

.xpe-modal__intro {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--xpe-muted);
}

/* ----------------------------------------------------------------- Body */

.xpe-modal__body {
	padding: 22px 32px 30px;
}

.xpe-product {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	margin: 0 0 22px;
	background: var(--xpe-panel);
	border: 1px solid var(--xpe-line);
	border-left: 3px solid var(--xpe-accent);
	border-radius: 8px;
}

.xpe-product[hidden] {
	display: none;
}

.xpe-product__media img {
	display: block;
	width: 60px;
	height: 60px;
	object-fit: contain;
	background: #ffffff;
	border-radius: 6px;
}

.xpe-product__media img[hidden] {
	display: none;
}

.xpe-product__meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.xpe-product__label {
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--xpe-muted);
}

.xpe-product__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--xpe-ink);
}

.xpe-product__sku {
	font-size: 12.5px;
	color: var(--xpe-muted);
}

.xpe-product__sku[hidden] {
	display: none;
}

.xpe-product__price {
	font-size: 14px;
	font-weight: 600;
	color: var(--xpe-accent);
}

.xpe-product__price:empty {
	display: none;
}

/* ---------------------------------------------------------------- Alerts */

.xpe-alert {
	margin: 0 0 18px;
	padding: 11px 14px;
	font-size: 14px;
	line-height: 1.5;
	border-radius: 6px;
}

.xpe-alert[hidden] {
	display: none;
}

/* Error banner: unmistakably red so a failed submit is obvious. */
.xpe-alert--error {
	position: relative;
	padding: 12px 14px 12px 44px;
	font-weight: 500;
	color: #ffffff;
	background: rgba(229, 57, 53, 0.22);
	border: 1px solid #e53935;
	border-left: 4px solid #e53935;
}

.xpe-alert--error::before {
	content: "!";
	position: absolute;
	top: 50%;
	left: 13px;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	font-size: 13px;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	color: #ffffff;
	background: #e53935;
	border-radius: 50%;
}

/* ------------------------------------------------------------------ Form */

.xpe-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.xpe-field--full {
	grid-column: 1 / -1;
}

.xpe-field[hidden] {
	display: none;
}

/* hCaptcha widget: keep it from stretching or overflowing on small phones. */
.xpe-hcaptcha {
	min-height: 0;
}

.xpe-hcaptcha h-captcha {
	display: block;
	max-width: 100%;
}

/*
 * hCaptcha's image challenge: centre it on screen while the popup is open.
 * hCaptcha appends it to <body> as a div next to the checkbox, with inline
 * position styles (hence !important) and a small arrow pointing at the box.
 * No transform here: the challenge's click-outside-to-close layer is
 * position:fixed and a transform would shrink it to the challenge box.
 */
body.xpe-modal-open > div:has(> div > iframe[src*="hcaptcha"]) {
	position: fixed !important;
	inset: 0 !important;
	margin: auto !important;
	width: fit-content !important;
	height: fit-content !important;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 16px);
	overflow-y: auto;
}

body.xpe-modal-open > div:has(> div > iframe[src*="hcaptcha"]) > div[style*="pointer-events: none"] {
	display: none !important;
}

@media screen and (max-width: 340px) {
	.xpe-hcaptcha h-captcha {
		transform: scale(0.9);
		transform-origin: left top;
	}
}

/* One dropdown per variation attribute (Colour, Size ...). */
.xpe-variation__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.xpe-variation__attr {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.xpe-variation__attr:only-child,
.xpe-variation__attr:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

.xpe-modal select.xpe-field__control option:disabled {
	color: rgba(255, 255, 255, 0.35);
}

.xpe-field--variation > .xpe-field__error {
	margin-top: 8px;
}

/* Sale price: old price muted and struck through, new price in green. */
.xpe-product__price del {
	margin-right: 6px;
	font-weight: 400;
	color: var(--xpe-muted);
	opacity: 1;
}

.xpe-product__price ins {
	text-decoration: none;
	background: none;
}

/* The enquiry button inside the product page's variations form. */
.variations_form .xpe-single-wrap {
	margin-top: 1em;
}

.xpe-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.xpe-modal .xpe-field__label {
	margin: 0 0 6px;
	padding: 0;
	font-family: var(--xpe-font-body);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--xpe-ink);
}

.xpe-field__required {
	margin-left: 3px;
	color: var(--xpe-accent);
}

/* Flatsome and Elementor both style bare inputs, so this is scoped tightly. */
.xpe-modal .xpe-field__control {
	width: 100%;
	max-width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	font-family: var(--xpe-font-body);
	font-size: 15px;
	line-height: 1.4;
	color: var(--xpe-ink);
	background: var(--xpe-panel);
	border: 1.5px solid #5a5a5a;
	border-radius: 6px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.xpe-modal input[type="number"].xpe-field__control {
	-moz-appearance: textfield;
}

.xpe-modal input[type="number"].xpe-field__control::-webkit-outer-spin-button,
.xpe-modal input[type="number"].xpe-field__control::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.xpe-modal select.xpe-field__control {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 10px;
	padding-right: 36px;
}

.xpe-modal textarea.xpe-field__control {
	height: auto;
	min-height: 110px;
	padding: 11px 14px;
	resize: vertical;
}

.xpe-modal .xpe-field__control::placeholder {
	color: rgba(255, 255, 255, 0.38);
	opacity: 1;
}

.xpe-modal .xpe-field__control:focus {
	color: var(--xpe-ink);
	background: var(--xpe-panel);
	border-color: var(--xpe-accent);
	box-shadow: 0 0 0 3px rgba(11, 182, 34, 0.2);
	outline: none;
}

/* Keep browser autofill from painting the dark fields yellow/white. */
.xpe-modal .xpe-field__control:-webkit-autofill {
	-webkit-text-fill-color: var(--xpe-ink);
	-webkit-box-shadow: 0 0 0 40px var(--xpe-panel) inset;
	caret-color: var(--xpe-ink);
}

.xpe-field.is-invalid .xpe-field__control {
	border-color: var(--xpe-error);
}

.xpe-field.is-invalid .xpe-field__control:focus {
	box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.2);
}

.xpe-field__error {
	margin-top: 6px;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--xpe-error);
}

.xpe-field__error[hidden] {
	display: none;
}

.xpe-modal .xpe-field__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 0;
	font-family: var(--xpe-font-body);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	text-transform: none;
	color: var(--xpe-ink);
	cursor: pointer;
}

.xpe-field__checkbox span {
	font-weight: 400;
}

.xpe-field__checkbox input[type="checkbox"] {
	margin: 3px 0 0;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	accent-color: var(--xpe-accent);
}

.xpe-honeypot {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --------------------------------------------------------------- Actions */

.xpe-form__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--xpe-faint);
}

/* Same as the theme's green "Apply" button: Poppins 600 caps, green glow on hover. */
.xpe-modal .xpe-submit,
.xpe-modal .xpe-success__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 50px;
	margin: 0;
	padding: 0 28px;
	font-family: var(--xpe-font-body);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #ffffff;
	background: var(--xpe-accent);
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.xpe-modal .xpe-submit:hover:not(:disabled),
.xpe-modal .xpe-submit:focus-visible:not(:disabled),
.xpe-modal .xpe-success__close:hover,
.xpe-modal .xpe-success__close:focus-visible {
	color: #ffffff;
	background: var(--xpe-accent);
	filter: brightness(1.12);
	box-shadow: 0 0 16px rgba(11, 182, 34, 0.4);
	outline: none;
}

.xpe-modal .xpe-submit:active:not(:disabled) {
	transform: translateY(1px);
}

.xpe-modal .xpe-submit:disabled,
.xpe-modal .xpe-submit.is-loading {
	opacity: 0.7;
	cursor: progress;
}

.xpe-submit__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: xpe-spin 0.7s linear infinite;
}

.xpe-submit.is-loading .xpe-submit__spinner {
	display: inline-block;
}

@keyframes xpe-spin {
	to { transform: rotate(360deg); }
}

.xpe-form__privacy {
	margin: 0;
	font-size: 12.5px;
	line-height: 1.5;
	text-align: center;
	color: var(--xpe-muted);
}

/* --------------------------------------------------------------- Success */

.xpe-success[hidden] {
	display: none;
}

/* Success panel: green so a sent enquiry is obvious. */
.xpe-success {
	padding: 26px 18px 22px;
	text-align: center;
	background: rgba(11, 182, 34, 0.1);
	border: 1px solid var(--xpe-accent);
	border-radius: 10px;
	animation: xpe-fade 0.25s ease both;
}

.xpe-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 16px;
	color: var(--xpe-accent);
	background: rgba(11, 182, 34, 0.12);
	border: 1px solid rgba(11, 182, 34, 0.4);
	border-radius: 50%;
	box-shadow: 0 0 24px rgba(11, 182, 34, 0.25);
}

.xpe-modal .xpe-success__title {
	margin: 0 0 8px;
	font-family: var(--xpe-font-body);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--xpe-accent);
}

.xpe-success__text {
	margin: 0 auto;
	max-width: 420px;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--xpe-muted);
}

.xpe-success__ref {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--xpe-accent);
}

.xpe-success__ref:empty {
	display: none;
}

.xpe-modal .xpe-success__close {
	margin-top: 22px;
}

/* ---------------------------------------------------------------- Mobile */

@media screen and (max-width: 600px) {
	.xpe-modal {
		padding: 0;
	}

	.xpe-modal__dialog {
		max-width: none;
		min-height: 100%;
		border: 0;
		border-top: 3px solid var(--xpe-accent);
		border-radius: 0;
	}

	.xpe-modal__header {
		padding: 24px 18px 0;
	}

	.xpe-modal .xpe-modal__title {
		font-size: 22px;
		padding-right: 36px;
	}

	.xpe-modal__body {
		padding: 18px 18px 28px;
	}

	.xpe-form__grid,
	.xpe-variation__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 14px;
	}

	/* 16px stops iOS Safari zooming into the field on focus. */
	.xpe-modal .xpe-field__control {
		font-size: 16px;
	}

	.xpe-enquire-button--single {
		width: 100%;
	}
}

/*
 * Lock background scrolling while the modal is open, and pad the scrollbar
 * width back in so the page does not shift sideways.
 *
 * Do NOT pin the body with position:fixed + a negative top. hCaptcha appends
 * its image challenge to <body> and positions it from the page scroll offset,
 * so a shifted body pushes the challenge up off the top of the screen.
 */
html.xpe-modal-open,
body.xpe-modal-open {
	overflow: hidden;
}

body.xpe-modal-open {
	padding-right: var(--xpe-scrollbar, 0);
}

/* Scrolling inside the popup must not hand off to the page at its ends. */
.xpe-modal {
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
