/**
 * Theme styles.
 *
 * Contains only:
 *  - styling for markup that has no source equivalent (WooCommerce and
 *    WordPress generated markup, checkout block, notices, pagination),
 *  - functional rules (hidden attributes, drawer open/close, reveal states).
 *
 * All design styling comes from assets/css/app.css, which ships the compiled
 * source stylesheet with the source's own utility classes and base layer.
 */

/* -------------------------------------------------------------------------
 * Functional: hidden attribute must win over any display utility.
 * ---------------------------------------------------------------------- */
[hidden] {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Logo sizing: one definition, honoured in header and footer on every page.
 * ---------------------------------------------------------------------- */
/* Header logo: the wrapper keeps the design's fixed box, the image fills it
   with object-contain so the rendered glyph height stays identical. */
.site-header .site-logo-img {
	height: 100% !important;
	width: 100% !important;
	max-height: calc(var(--logo-height, 88px) - 1.5rem);
	object-fit: contain;
	display: block;
}

@media (min-width: 768px) {
	.site-header .site-logo-img {
		max-height: calc(var(--logo-height-desktop, 104px) - 1.5rem);
	}
}

.site-logo-text {
	display: block;
}

/* -------------------------------------------------------------------------
 * Header clearance: none on the home page (hero sits under the fixed header).
 * ---------------------------------------------------------------------- */
.theme-no-hero .site-main {
	padding-top: 96px;
}

@media (min-width: 768px) {
	.theme-no-hero .site-main {
		padding-top: 112px;
	}
}

/* -------------------------------------------------------------------------
 * WordPress admin bar: keep the fixed site header below it.
 * ---------------------------------------------------------------------- */
body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* -------------------------------------------------------------------------
 * Pointer cursor on every interactive control.
 * ---------------------------------------------------------------------- */
a[href],
button:not(:disabled):not([disabled]),
[role="button"]:not([aria-disabled="true"]),
summary,
label[for],
select,
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="file"],
.theme-product-thumb,
.theme-cat-circle,
[data-cart-open],
[data-cart-close],
[data-cart-remove],
[data-mobile-menu-toggle],
[data-mobile-menu-link],
[data-mobile-accordion-toggle],
[data-cat-filter],
[data-shop-more],
[data-gallery-open],
[data-gallery-close],
[data-gallery-prev],
[data-gallery-next],
[data-gallery-zoom-in],
[data-gallery-zoom-out],
[data-testimonial-prev],
[data-testimonial-next],
[data-testimonial-dot],
[data-accordion-toggle],
[data-contact-open],
[data-contact-close],
[data-qty-decrease],
[data-qty-increase],
.theme-qty-minus,
.theme-qty-plus {
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Header navigation lists rendered by wp_nav_menu().
 * ---------------------------------------------------------------------- */
.theme-nav-list {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (min-width: 1280px) {
	.theme-nav-list {
		gap: 2.5rem;
	}
}

.theme-nav-list li {
	position: relative;
}

.theme-nav-list a {
	text-decoration: none;
}

.header-right-nav .theme-nav-list a,
.theme-nav-list a {
	color: inherit;
}

/* -------------------------------------------------------------------------
 * Reveal animation (source staggered entrance: opacity + translateY).
 * The initial hidden state only exists when JS is available, so content is
 * never trapped invisible without an observer.
 * ---------------------------------------------------------------------- */
.theme-js .theme-reveal {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity 0.7s cubic-bezier(0.25, 0.4, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.4, 0.25, 1);
}

.theme-js .theme-reveal.is-visible {
	opacity: 1;
	transform: none;
}

body.is-customizer .theme-reveal,
body.is-customizer .theme-reveal.is-visible {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.theme-js .theme-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* -------------------------------------------------------------------------
 * Shimmer placeholder shared by reveal / parallax images.
 * ---------------------------------------------------------------------- */
.shimmer-loading[data-revealed="true"] {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease;
}

/* -------------------------------------------------------------------------
 * Scroll progress bar (source: gradient, 2px, spring driven).
 * ---------------------------------------------------------------------- */
.scroll-progress {
	transform: scaleX(0);
}

/* -------------------------------------------------------------------------
 * Quantity control used by the single product page.
 * ---------------------------------------------------------------------- */
.theme-quantity-wrapper {
	display: inline-flex;
	align-items: center;
	border: 1px solid hsl(var(--border));
}

.theme-quantity-wrapper .theme-qty-input {
	width: 44px;
	min-width: 44px;
	max-width: 44px;
	appearance: textfield;
	-moz-appearance: textfield;
}

.theme-quantity-wrapper .theme-qty-input::-webkit-outer-spin-button,
.theme-quantity-wrapper .theme-qty-input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

/* -------------------------------------------------------------------------
 * Single product layout guards.
 * ---------------------------------------------------------------------- */
.single-product .theme-product-layout,
.single-product .theme-product-gallery,
.single-product .theme-product-info {
	min-width: 0;
	max-width: 100%;
}

.single-product .theme-product-thumbnails {
	flex-wrap: wrap;
	max-width: 100%;
}

/* Quantity + button stack exactly as the design shows them. */
.single-product .theme-add-to-cart-area > .single_add_to_cart_button,
.single-product .theme-add-to-cart-area > .theme-btn-primary {
	display: block;
	width: 100%;
	min-width: 0;
	text-align: center;
}

.single-product .theme-add-to-cart-area .woocommerce-variation-add-to-cart {
	width: 100%;
}

.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

/* Variation selects stay in the DOM for WooCommerce but render as pills. */
.theme-attr-select-hidden,
.theme-hidden-selects {
	display: none !important;
}

.theme-attr-pill.is-active {
	background-color: hsl(var(--foreground));
	color: hsl(var(--background));
	border-color: hsl(var(--foreground));
}

.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
	display: block;
	width: 100%;
}

.single-product .variations tbody td.label {
	display: none;
}

.single-product .single_variation_wrap {
	margin-top: 0;
}

.single-product .woocommerce-variation-price {
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 0.5rem;
}

.single-product .theme-btn-primary {
	background-color: hsl(var(--foreground));
	color: hsl(var(--background));
	border: 0;
	border-radius: 9999px;
	padding: 1rem 1.5rem;
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.25s ease;
}

.single-product .theme-btn-primary:hover {
	background-color: hsl(var(--foreground) / 0.9);
}

/* Disabled add-to-cart state (variable products, out of stock). */
.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.4 !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.4 !important;
}

/* Hide the "View cart" link WooCommerce injects after AJAX add to cart. */
.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;
}

/* Suppress WooCommerce's own loading spinner; the theme owns the state. */
.single-product .single_add_to_cart_button.loading::after,
.ajax_add_to_cart.loading::after {
	display: none !important;
}

.ajax_add_to_cart.theme-btn-loading {
	opacity: 0.6 !important;
	pointer-events: none !important;
	cursor: wait !important;
}

/* -------------------------------------------------------------------------
 * Side cart drawer + overlay.
 * ---------------------------------------------------------------------- */
#theme-cart-overlay {
	position: fixed;
	inset: 0;
	background-color: hsl(var(--foreground) / 0.2);
	z-index: 50;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.cart-open #theme-cart-overlay {
	opacity: 1;
	visibility: visible;
}

#theme-cart-drawer {
	transform: translateX(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

body.cart-open #theme-cart-drawer {
	transform: translateX(0);
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

.theme-cart-count:empty {
	display: none;
}

body.cart-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Inquiry dialog.
 * ---------------------------------------------------------------------- */
[data-dialog-overlay].is-open,
[data-dialog-content].is-open,
[data-gallery-overlay].is-open,
[data-gallery-dialog].is-open {
	animation: theme-overlay-in 0.2s ease forwards;
}

[data-dialog-content].is-open,
[data-gallery-dialog].is-open {
	animation: theme-content-in 0.2s ease forwards;
}

@keyframes theme-overlay-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes theme-content-in {
	from { opacity: 0; transform: translate(-50%, -48%) scale(0.95); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

body.dialog-open {
	overflow: hidden;
}

/* -------------------------------------------------------------------------
 * Gallery zoom stage.
 * ---------------------------------------------------------------------- */
[data-panzoom] img {
	max-width: 100%;
	cursor: grab;
	user-select: none;
}

[data-panzoom] img:active {
	cursor: grabbing;
}

/* -------------------------------------------------------------------------
 * Testimonial carousel dots injected by main.js.
 * ---------------------------------------------------------------------- */
[data-testimonials-dots] .theme-dot {
	height: 2.5rem;
	width: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

[data-testimonials-dots] .theme-dot span {
	display: block;
	height: 0.5rem;
	border-radius: 9999px;
	transition: all 0.25s ease;
	width: 0.5rem;
	background-color: hsl(var(--primary) / 0.25);
}

[data-testimonials-dots] .theme-dot.is-active span {
	width: 1.5rem;
	background-color: hsl(var(--accent));
}

/* -------------------------------------------------------------------------
 * WooCommerce notices (styled where the theme has no alternative feedback).
 * ---------------------------------------------------------------------- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
	border-radius: 0.75rem;
	border: 1px solid hsl(var(--border));
	background-color: hsl(var(--card));
	color: hsl(var(--foreground));
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.6;
}

.woocommerce-error {
	border-color: hsl(var(--destructive) / 0.4);
	color: hsl(var(--destructive));
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	margin-left: 0.75rem;
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
	display: none;
}

#theme-cart-drawer .woocommerce-message {
	display: none;
}

/* -------------------------------------------------------------------------
 * WooCommerce pagination / ordering / result count markup.
 * ---------------------------------------------------------------------- */
.woocommerce-pagination {
	margin-top: 3rem;
}

.woocommerce-pagination ul {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	border-radius: 9999px;
	border: 1px solid hsl(var(--border));
	font-family: var(--font-body);
	font-size: 0.75rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	text-decoration: none;
	color: hsl(var(--foreground));
}

.woocommerce-pagination ul li span.current {
	background-color: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

.woocommerce-result-count,
.woocommerce-ordering select {
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
}

.woocommerce-ordering select {
	padding: 0.5rem 0.75rem;
	border: 1px solid hsl(var(--border));
	border-radius: 0.5rem;
	background-color: hsl(var(--background));
}

/* -------------------------------------------------------------------------
 * Star ratings and sale flash, when WooCommerce outputs them.
 * ---------------------------------------------------------------------- */
.woocommerce .star-rating {
	color: hsl(var(--marigold));
	font-size: 0.875rem;
}

.woocommerce span.onsale {
	background-color: hsl(var(--accent));
	color: hsl(var(--accent-foreground));
	border-radius: 0.375rem;
	padding: 0.25rem 0.75rem;
	font-family: var(--font-body);
	font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
 * WordPress core generated markup.
 * ---------------------------------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.entry-content > * + * {
	margin-top: 1.25rem;
}

.entry-content a {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.entry-content h2,
.entry-content h3 {
	font-family: var(--font-display);
}

.page-title {
	min-width: 0;
}

/* -------------------------------------------------------------------------
 * Cart, My Account and thank you pages: width + alignment parity.
 * ---------------------------------------------------------------------- */
.woocommerce-cart .site-main .container-wide,
.woocommerce-account .site-main .container-wide,
.theme-thankyou-page .site-main .container-wide {
	max-width: 80rem;
	margin-left: auto;
	margin-right: auto;
}

.theme-thankyou-page {
	overflow-x: hidden;
}

.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
}

.theme-thankyou-page .woocommerce-order-details tfoot th {
	text-align: left;
}

.theme-thankyou-page .woocommerce-order-details tfoot td {
	text-align: right;
}

.theme-thankyou-page .woocommerce-order h2,
.theme-thankyou-page .woocommerce-order-details__title {
	font-family: var(--font-display);
	font-size: 1.5rem;
	line-height: 1.2;
	padding: 0 0 1rem;
}

.theme-thankyou-page .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
}

.theme-thankyou-page .woocommerce-order-overview li {
	border-top: 1px solid hsl(var(--border));
	padding-top: 0.75rem;
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
}

.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 2rem;
}

.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.7;
}

/* -------------------------------------------------------------------------
 * Checkout block: layout and design-system styling.
 * ---------------------------------------------------------------------- */
body.woocommerce-checkout .site-main {
	padding-bottom: 4rem;
}

body.woocommerce-checkout .entry-content {
	max-width: 100%;
}

body.woocommerce-checkout .wc-block-checkout {
	display: block;
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
	min-width: 0;
	width: 100%;
	max-width: none;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--checkout-gap, 2rem);
		align-items: start;
	}
}

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-select select,
body.woocommerce-checkout .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-textarea textarea {
	width: 100% !important;
	max-width: none !important;
	font-family: var(--font-body) !important;
	font-size: 1rem !important;
	color: hsl(var(--foreground)) !important;
	background-color: hsl(var(--background)) !important;
	border: 1px solid hsl(var(--border)) !important;
	border-radius: 0.375rem !important;
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-select select:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus,
body.woocommerce-checkout .wc-block-components-textarea textarea:focus {
	border-color: hsl(var(--primary)) !important;
	box-shadow: 0 0 0 1px hsl(var(--primary)) !important;
	outline: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input input::placeholder,
body.woocommerce-checkout .wc-block-components-textarea textarea::placeholder {
	color: hsl(var(--muted-foreground)) !important;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
	background-color: hsl(var(--secondary));
	border-radius: 0.75rem;
	padding: 2rem;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
	background-color: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border-radius: 9999px !important;
	font-family: var(--font-body) !important;
	font-size: 0.75rem !important;
	letter-spacing: 0.22em !important;
	text-transform: uppercase !important;
	font-weight: 600 !important;
	min-height: 3rem !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	background-color: hsl(var(--background)) !important;
	color: hsl(var(--primary)) !important;
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	border-radius: 0.75rem !important;
	font-family: var(--font-body) !important;
	border: 1px solid hsl(var(--border)) !important;
}

body.woocommerce-checkout .wc-block-cart-items {
	font-family: var(--font-body) !important;
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-title {
	font-family: var(--font-display) !important;
	font-size: 1.25rem !important;
	font-weight: 700 !important;
}

body.woocommerce-checkout .wc-block-components-checkbox__mark {
	border-radius: 0.25rem;
}

/* Classic checkout field fallbacks (used by the block's classic variants). */
.woocommerce-checkout .form-row .input-text,
.woocommerce-checkout .form-row select {
	font-family: var(--font-body);
	color: hsl(var(--foreground));
	background-color: hsl(var(--background));
	border: 1px solid hsl(var(--border));
	border-radius: 0.375rem;
}

/* -------------------------------------------------------------------------
 * Product card image wrapper: establishes the containing block for badges.
 * ---------------------------------------------------------------------- */
.theme-product-card-media {
	position: relative;
	overflow: hidden;
}

.theme-product-card-media img {
	display: block;
}

/* -------------------------------------------------------------------------
 * WooCommerce cart table (classic cart page fallback).
 * ---------------------------------------------------------------------- */
.woocommerce-cart .woocommerce table.shop_table,
.woocommerce-account .woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--font-body);
}

.woocommerce-cart .woocommerce table.shop_table th,
.woocommerce-cart .woocommerce table.shop_table td,
.woocommerce-account .woocommerce table.shop_table th,
.woocommerce-account .woocommerce table.shop_table td {
	padding: 0.75rem;
	border-bottom: 1px solid hsl(var(--border));
	text-align: left;
}

.woocommerce-cart .woocommerce .button,
.woocommerce-account .woocommerce .button {
	font-family: var(--font-body);
}
