/*
 * Theme styles that sit on top of tailwind.css (utility layer generated from the
 * templates). Colours come from the HSL tokens emitted in :root by functions.php.
 */

:root {
	--announcement-h: 36px;
	--header-total: 100px;
	--product-header-height: 100px;
	--wp-admin-offset: 0px;
	--color-primary: hsl(var(--primary));
	--color-button-text: hsl(var(--primary-foreground));
	--color-surface: hsl(var(--secondary));
	--color-border: hsl(var(--border));
	--font-body: 'Sofia Sans', 'Jost', sans-serif;
	--btn-radius: 0;
	--btn-height: 3.5rem;
	--btn-padding: 0.5rem 1rem;
	--btn-font-size: 0.75rem;
	--btn-font-weight: 500;
	--btn-letter-spacing: normal;
	--btn-text-transform: uppercase;
	--card-radius: 0;
	--section-padding: 2rem;
	--checkout-gap: 2rem;
	--muted: 220 12% 92%;
	--destructive: 0 70% 45%;
	--destructive-foreground: 45 20% 97%;
}

body.theme-no-announce { --announcement-h: 0px; }
body.admin-bar { --wp-admin-offset: 32px; }
@media (max-width: 782px) {
	body.admin-bar { --wp-admin-offset: 46px; }
}

[hidden] { display: none !important; }

/* Headings: Tailwind preflight resets size/weight; weights are set per element from the design. */
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }

/* Layout offsets under the fixed header stack */
#theme-announcement { top: var(--wp-admin-offset, 0px); }
.site-header { top: calc(var(--announcement-h) + var(--wp-admin-offset, 0px)); }
.hero-wrap { padding-top: var(--announcement-h); }
.mobile-menu { top: calc(var(--announcement-h) + var(--wp-admin-offset, 0px) + 4rem); }
.site-main--page { padding-top: calc(var(--header-total) + 3rem); }
.site-main--product { padding-top: var(--product-header-height); }
#theme-scroll-progress { transform-origin: 0% 50%; transform: scaleX(0); }

/* Logo height (Customizer) */
.site-logo-img { width: auto !important; display: block; }
.site-logo-img--header { height: calc(var(--logo-height, 28px) * 6 / 7) !important; }
.site-logo-img--footer { height: calc(var(--logo-height, 28px) * 10 / 7) !important; }
@media (min-width: 1024px) {
	.site-logo-img--header { height: var(--logo-height, 28px) !important; }
}
.site-logo-text { display: block; line-height: 1.1; }

/* Mega menu panel wrapper */
[data-mega-panel] { display: contents; }
[data-mega-panel][hidden] { display: none !important; }

/* Scroll reveal (per-element delay via --reveal-delay) */
.reveal-item { opacity: 0; transform: translateY(40px); }
.reveal-section.is-visible .reveal-item {
	opacity: 1;
	transform: none;
	transition: opacity 0.9s var(--transition-smooth) var(--reveal-delay, 0s), transform 0.9s var(--transition-smooth) var(--reveal-delay, 0s);
}
body.is-customizer .reveal-item,
.no-reveal .reveal-item { opacity: 1; transform: none; }

/* Hero slider */
.hero-slide-img {
	opacity: 0;
	transition: opacity 1.2s var(--transition-smooth);
}
.hero-slide-img.is-active,
.hero-slide-img.is-leaving { animation: hero-zoom 7s linear forwards; }
.hero-slide-img.is-active { opacity: 1; }
.hero-slide-img.is-leaving { opacity: 0; animation-play-state: paused; }
@keyframes hero-zoom {
	from { transform: scale(1.03); }
	to { transform: scale(1); }
}
.hero-text { transition: opacity 0.7s var(--transition-smooth), transform 0.7s var(--transition-smooth); }
.hero-text.is-pre { opacity: 0; transform: translateY(24px); }
.hero-text.is-exit { opacity: 0; transform: translateY(-12px); }

/* FAQ accordion (height + opacity, 0.3s) */
.faq-panel {
	height: 0;
	opacity: 0;
	transition: height 0.3s var(--transition-smooth), opacity 0.3s var(--transition-smooth);
}
.faq-panel.is-open { height: auto; opacity: 1; }

/* Dialogs */
[data-dialog] { position: relative; }
[data-dialog].is-closing [data-dialog-overlay],
[data-dialog].is-closing [data-dialog-content] {
	animation: none !important;
	opacity: 0;
	transition: opacity 0.16s ease;
	pointer-events: none;
}
.dialog-success { animation: dialog-pop 0.4s var(--transition-smooth); }
.dialog-success-icon { animation: dialog-icon 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both; }
.dialog-success-lite { animation: slideUp 0.4s ease-out both; }
.dialog-form { animation: fadeIn 0.3s ease-out both; }
@keyframes dialog-pop {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}
@keyframes dialog-icon {
	from { transform: scale(0); }
	to { transform: scale(1); }
}
.theme-select-arrow {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2216%22 height=%2216%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%231E2A44%22 stroke-width=%222%22%3E%3Cpath d=%22m6 9 6 6 6-6%22/%3E%3C/svg%3E");
}

/* Cart drawer */
#theme-cart-overlay,
#theme-cart-drawer { display: none; }
body.cart-open #theme-cart-overlay { display: block; animation: cart-overlay-in 0.2s ease both; }
body.cart-open #theme-cart-drawer { display: flex; }
body.cart-open #theme-cart-drawer.cart-animate { animation: cart-drawer-in 0.28s ease both; }
body.cart-open { overflow: hidden; }
#theme-cart-drawer.is-updating { pointer-events: none; }
#theme-cart-drawer .cart-thumb {
	display: block;
	width: 6rem;
	height: 8rem;
	flex-shrink: 0;
	overflow: hidden;
	background: hsl(var(--secondary));
	border-radius: 0.375rem;
}
#theme-cart-drawer .cart-thumb img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: center center;
	display: block;
}
@keyframes cart-overlay-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes cart-drawer-in {
	from { transform: translateX(1.25rem); }
	to { transform: none; }
}
.theme-cart-count:empty { display: none; }

/* Product page */
.theme-attr-select-hidden { display: none !important; }
.single-product .variations,
.single-product .variations tbody,
.single-product .variations tr,
.single-product .variations td { display: block; width: 100%; padding: 0; border: 0; }
.single-product .variations td.label { padding-bottom: 0; }
.single-product .reset_variations,
.single-product .single_variation .woocommerce-variation-price,
.single-product .single_variation .woocommerce-variation-description,
.single-product .single_variation .woocommerce-variation-availability { display: none !important; }
.single-product .theme-product-layout { min-width: 0; }
.single-product .theme-product-gallery,
.single-product .theme-product-info { min-width: 0; max-width: 100%; }
.single-product .theme-product-thumbnails { max-width: 100%; }
.single-product .theme-add-to-cart-area { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.single-product .single_add_to_cart_button { flex: 1 1 auto; }
.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in { overflow-wrap: break-word; word-break: break-word; }
.theme-swatch.is-selected { border-color: hsl(var(--primary)); }
.theme-size-pill.is-selected { background-color: hsl(var(--foreground)); color: hsl(var(--background)); }
.theme-size-pill.is-selected:hover { background-color: hsl(var(--foreground)); }
.theme-thumb.is-active { border-color: hsl(var(--primary)); }
.theme-quantity-wrapper .theme-qty-input {
	border: 0;
	background: transparent;
	padding: 0;
	-moz-appearance: textfield;
	appearance: textfield;
}
.theme-quantity-wrapper .theme-qty-input::-webkit-outer-spin-button,
.theme-quantity-wrapper .theme-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gallery-nav-hidden { display: none !important; }
.single-product .woocommerce-message,
.single-product .woocommerce-info { display: none; }
#theme-cart-drawer .woocommerce-message { display: none; }

/* WooCommerce add-to-cart button overrides (WooCommerce styles are dequeued; these keep the design tokens authoritative) */
.single_add_to_cart_button.button,
.add_to_cart_button.button,
a.single_add_to_cart_button,
a.add_to_cart_button {
	background-color: var(--color-primary) !important;
	color: var(--color-button-text) !important;
	border: none !important;
	border-radius: var(--btn-radius) !important;
	min-height: var(--btn-height) !important;
	padding: var(--btn-padding) !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-family: var(--font-body) !important;
	font-size: var(--btn-font-size) !important;
	font-weight: var(--btn-font-weight) !important;
	letter-spacing: var(--btn-letter-spacing) !important;
	text-transform: var(--btn-text-transform) !important;
	cursor: pointer !important;
	transition: opacity 0.2s ease !important;
}
.single_add_to_cart_button.button:hover,
.add_to_cart_button.button:hover {
	opacity: 0.85 !important;
	background-color: var(--color-primary) !important;
	color: var(--color-button-text) !important;
}
.single_add_to_cart_button.button:disabled,
.single_add_to_cart_button.button.disabled,
.add_to_cart_button.button:disabled,
.add_to_cart_button.button.disabled {
	cursor: not-allowed !important;
	opacity: 0.5 !important;
	pointer-events: none !important;
}
.single_add_to_cart_button.button:disabled:hover,
.single_add_to_cart_button.button.disabled:hover,
.add_to_cart_button.button:disabled:hover,
.add_to_cart_button.button.disabled:hover {
	opacity: 0.5 !important;
	background-color: var(--color-primary) !important;
}
.ajax_add_to_cart.theme-btn-loading {
	opacity: 0.6 !important;
	pointer-events: none !important;
	cursor: wait !important;
}
.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after { display: none !important; }
.woocommerce-page a.added_to_cart.wc-forward,
.single-product a.added_to_cart.wc-forward,
body a.added_to_cart.wc-forward { display: none !important; }

/* Product cards */
.theme-product-card-wrap { height: 100%; }
.theme-product-card { display: block; height: 100%; }

/* Generic pages: title shares the site container with the content */
.page-title {
	font-family: var(--font-display);
	font-size: 2.25rem;
	line-height: 1.1;
	margin-bottom: 2rem;
}
@media (min-width: 768px) {
	.page-title { font-size: 3rem; }
}
.entry-content { max-width: none; font-family: var(--font-body); }
.entry-content p { margin-bottom: 1rem; }

/* WooCommerce notices (kept visible on cart, checkout, account and shop) */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0.875rem 1rem;
	border: 1px solid hsl(var(--border));
	background: hsl(var(--secondary));
	font-family: var(--font-body);
	font-size: 0.875rem;
}
.woocommerce-error { border-color: hsl(var(--destructive)); color: hsl(var(--destructive)); }

/* Checkout block */
body.woocommerce-checkout .entry-content,
body.woocommerce-cart .entry-content,
body.woocommerce-account .entry-content { width: 100%; }
body.woocommerce-checkout .site-main { padding-bottom: 4rem; }
body.woocommerce-checkout .wc-block-checkout { display: block; }
body.woocommerce-checkout .wc-block-components-sidebar-layout { display: block; }
@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
	body.woocommerce-checkout .wc-block-components-sidebar-layout.is-large {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--checkout-gap, 2rem);
		align-items: start;
	}
	body.woocommerce-checkout .wc-block-components-notice-banner { grid-column: 1 / -1; }
}
body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
	min-width: 0;
	width: 100%;
	max-width: none;
	padding: 0;
}
body.woocommerce-checkout .wc-block-checkout__sidebar {
	background-color: var(--color-surface, #f8f8f8);
	border-radius: var(--card-radius);
	padding: var(--section-padding, 2rem);
}
body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
	font-family: var(--font-display);
	font-weight: 400;
	letter-spacing: 0.005em;
}
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-select select,
body.woocommerce-checkout .wc-block-components-textarea textarea,
body.woocommerce-checkout .wc-block-components-combobox input {
	width: 100% !important;
	max-width: none !important;
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--foreground));
	border: 1px solid hsl(var(--border));
	border-radius: 0;
	background-color: hsl(var(--background));
}
body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus,
body.woocommerce-checkout .wc-block-components-textarea textarea:focus {
	outline: none;
	border-color: hsl(var(--primary));
	box-shadow: none;
}
body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-select label { color: hsl(var(--muted-foreground)); font-family: var(--font-body); }
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-components-button:not(.is-link) {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border: 1px solid hsl(var(--primary));
	border-radius: 0;
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.24em;
	text-transform: uppercase;
}
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	background-color: hsl(var(--background));
	color: hsl(var(--primary));
}
body.woocommerce-checkout .wc-block-components-notice-banner {
	border-radius: 0;
	font-family: var(--font-body);
	font-size: 0.875rem;
}
body.woocommerce-checkout .wc-block-cart-items { font-family: var(--font-body); }
body.woocommerce-checkout .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-components-totals-wrapper { font-family: var(--font-body); }

/* Cart / account width parity with the checkout */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-account .woocommerce { width: 100%; max-width: none; }
body.woocommerce-cart .wc-block-components-button:not(.is-link),
body.woocommerce-cart .wc-block-cart__submit-button {
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-radius: 0;
	font-family: var(--font-body);
	text-transform: uppercase;
	letter-spacing: 0.24em;
	font-size: 0.75rem;
}

/* Order received */
body.theme-thankyou-page { overflow-x: hidden; }
body.theme-thankyou-page .woocommerce-order { font-family: var(--font-body); }
body.theme-thankyou-page .woocommerce-order-overview {
	list-style: none;
	padding: 0;
	margin: 0 0 2rem;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}
body.theme-thankyou-page .woocommerce-order-overview li {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: hsl(var(--muted-foreground));
}
body.theme-thankyou-page .woocommerce-order-overview li strong { display: block; color: hsl(var(--foreground)); font-size: 0.875rem; letter-spacing: 0; text-transform: none; }
body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title {
	font-family: var(--font-display);
	font-size: 1.5rem;
	padding: 0 0 1rem 0;
}
body.theme-thankyou-page .woocommerce-order-details table,
body.theme-thankyou-page .woocommerce-customer-details table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
}
body.theme-thankyou-page .woocommerce-order-details th,
body.theme-thankyou-page .woocommerce-order-details td {
	padding: 0.75rem 0;
	border-bottom: 1px solid hsl(var(--border));
	text-align: left;
	font-size: 0.875rem;
}
body.theme-thankyou-page .woocommerce-order-details tfoot th { text-align: left; }
body.theme-thankyou-page .woocommerce-order-details tfoot td { text-align: right; }
body.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 2rem;
}
body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	font-size: 0.875rem;
	line-height: 1.6;
}

/* Customizer preview: never hide content */
body.is-customizer .hero-text { opacity: 1; transform: none; }
