/*
 * Theme CSS
 * Adds only what the compiled design stylesheet cannot cover: WooCommerce and
 * WordPress generated markup, plus functional state rules.
 */

/* -------------------------------------------------------------------------
 * Functional base
 * ---------------------------------------------------------------------- */

[hidden] {
	display: none !important;
}

body.cart-open {
	overflow: hidden;
}

/* Pointer cursor on every interactive control. */
a,
button,
summary,
label[for],
select,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="checkbox"],
input[type="radio"],
input[type="file"],
[role="button"],
[data-cart-open],
[data-cart-close],
[data-menu-toggle],
[data-cart-qty-update],
[data-cart-remove],
.theme-attribute-pill,
.theme-product-thumb,
.theme-qty-minus,
.theme-qty-plus {
	cursor: pointer;
}

button:disabled,
button.disabled,
a[aria-disabled="true"],
.disabled {
	cursor: not-allowed;
}

/* Fixed header / progress bar sit below the WP admin bar. */
body.admin-bar .site-header,
body.admin-bar .theme-scroll-progress {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header,
	body.admin-bar .theme-scroll-progress {
		top: 46px;
	}
}

/* Below 600px the admin bar is position:absolute and scrolls away. */
@media screen and (max-width: 600px) {
	body.admin-bar .site-header,
	body.admin-bar .theme-scroll-progress {
		top: 0;
	}
}

html:has(body.admin-bar) {
	scroll-padding-top: calc(5rem + 32px);
}

@media screen and (max-width: 782px) {
	html:has(body.admin-bar) {
		scroll-padding-top: calc(5rem + 46px);
	}
}

/* Reveal fallbacks: never leave content invisible. */
body.is-customizer [data-reveal],
body.is-customizer .reveal-item,
body.no-js [data-reveal] {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

.theme-scroll-progress {
	transform-origin: left center;
	transform: scaleX(0);
}

.theme-main {
	min-width: 0;
}

/* The home hero starts at the top of the viewport, under the fixed header. */
.home .theme-main {
	padding-top: 0;
	padding-bottom: 0;
}

/* Hero copy entrance: the source fades and lifts the copy over 0.6s. */
.theme-hero-enter {
	animation: theme-hero-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes theme-hero-in {
	from {
		opacity: 0;
		transform: translate3d(0, 20px, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.theme-hero-enter {
		animation: none;
	}
}

/* -------------------------------------------------------------------------
 * Cart drawer open / close. The drawer markup mirrors the design (container,
 * scrim, panel); only the visibility mechanics are theme-specific.
 * ---------------------------------------------------------------------- */

#theme-cart-drawer {
	visibility: hidden;
	transition: visibility 0s linear 0.3s;
}

#theme-cart-drawer > aside {
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

#theme-cart-drawer > .absolute.inset-0 {
	opacity: 0;
	transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

body.cart-open #theme-cart-drawer {
	visibility: visible;
	transition-delay: 0s;
}

body.cart-open #theme-cart-drawer > aside {
	transform: translateX(0);
}

body.cart-open #theme-cart-drawer > .absolute.inset-0 {
	opacity: 1;
}

#theme-cart-drawer.is-updating > aside > * {
	opacity: 0.6;
	pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Header state
 * ---------------------------------------------------------------------- */

/* Header: the design keeps the header semi-transparent cream at all times,
 * so no solid-state background is introduced. */

.site-logo-img {
	height: var(--logo-height, 36px) !important;
	width: auto !important;
	display: block;
}

/* The design steps the header logo down slightly on small screens. */
@media (max-width: 639px) {
	.site-header .site-logo-img {
		height: calc(var(--logo-height, 36px) - 4px) !important;
	}
}

.theme-logo-invert {
	filter: brightness(0) invert(1);
}

/* -------------------------------------------------------------------------
 * Product card / gallery specifics
 * ---------------------------------------------------------------------- */

.theme-card-image-link {
	display: block;
	overflow: hidden;
}

.theme-card-image-link img {
	display: block;
	width: 100%;
}

.theme-product-card-wrap {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
}

.theme-product-card-wrap > article {
	height: 100%;
}

.theme-product-main-image {
	min-width: 0;
}

.theme-product-main-image img,
.theme-card-image-link img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	object-position: center;
}

.theme-product-thumb {
	transition: border-color 0.3s, box-shadow 0.3s;
}

.theme-product-thumb.is-active {
	border-color: hsl(var(--primary));
	box-shadow: 0 0 0 1px hsl(var(--primary));
}

.theme-product-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.theme-attr-select-hidden {
	display: none !important;
}

.theme-attribute-pill.is-active {
	background-color: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* Native number input chrome would sit beside the source's custom stepper. */
.theme-quantity-wrapper .theme-qty-input {
	appearance: textfield;
	-moz-appearance: textfield;
	border: 0;
	background: transparent;
	padding: 0;
}

.theme-quantity-wrapper .theme-qty-input::-webkit-outer-spin-button,
.theme-quantity-wrapper .theme-qty-input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

/* Quantity + button row (simple and variable products share it). */
.single-product .theme-add-to-cart-area {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
}

.single-product .theme-add-to-cart-area .single_add_to_cart_button {
	flex: 0 1 auto;
	min-width: 160px;
}

.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-product-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

.single-product .variations tbody,
.single-product .variations tbody tr,
.single-product .variations tbody td {
	display: block;
	width: 100%;
}

.single-product .variations tbody td.label {
	padding-bottom: 0.25rem;
}

.single-product .variations tbody td.value {
	padding-top: 0;
}

/* Disabled add-to-cart (out of stock, or variation not chosen yet). */
.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;
}

/* The card CTA is an anchor (WooCommerce requirement) where the design uses a
 * button; anchors default to text-align: start, so restore the button's centring. */
.theme-product-card-wrap .add_to_cart_button,
.single-product .single_add_to_cart_button {
	text-align: center;
}

/* WooCommerce's own "View cart" link after an AJAX add is not part of the design. */
.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;
}

.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;
}

.theme-cart-count:empty {
	display: none;
}

/* Notices: hidden only where the drawer already gives feedback. */
.single-product .woocommerce-message,
.single-product .woocommerce-info,
#theme-cart-drawer .woocommerce-message {
	display: none;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	list-style: none;
	padding: 1rem 1.25rem;
	border-radius: 1rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.woocommerce-message,
.woocommerce-info {
	border: 1px solid hsl(var(--border));
	background-color: hsl(var(--secondary));
	color: hsl(var(--foreground));
}

.woocommerce-error {
	border: 1px solid hsl(var(--accent) / 0.5);
	background-color: hsl(var(--accent) / 0.12);
	color: hsl(var(--foreground));
}

.woocommerce-error li {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * WordPress generated markup
 * ---------------------------------------------------------------------- */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

.entry-content > * + * {
	margin-top: 1rem;
}

.entry-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
	text-underline-offset: 4px;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.25rem;
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content li + li {
	margin-top: 0.4rem;
}

/* -------------------------------------------------------------------------
 * Cart / My Account / Checkout pages
 * ---------------------------------------------------------------------- */

body.woocommerce-cart .site-main,
body.woocommerce-account .site-main,
body.woocommerce-checkout .site-main {
	padding-bottom: 4rem;
}

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 {
	border: 1px solid hsl(var(--input)) !important;
	border-radius: 0.75rem !important;
	background-color: hsl(var(--background)) !important;
	color: hsl(var(--foreground)) !important;
	font-family: 'Outfit', system-ui, sans-serif !important;
	font-size: 1rem !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 {
	outline: none !important;
	box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar {
	min-width: 0;
	width: 100%;
	max-width: none;
}

body.woocommerce-checkout .wc-block-components-sidebar-layout {
	display: block;
}

@media (min-width: 768px) {
	/* One grid owner only: WooCommerce Blocks' own sidebar-layout wrapper.
	 * The outer checkout wrapper also carries .wc-block-checkout in some
	 * Blocks versions, so it is excluded explicitly. */
	body.woocommerce-checkout .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 2rem;
		align-items: start;
	}

	body.woocommerce-checkout .wc-block-checkout:not(.wc-block-components-sidebar-layout) {
		display: block;
	}

	body.woocommerce-checkout .wc-block-components-sidebar-layout > .wc-block-components-notice-banner {
		grid-column: 1 / -1;
	}
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
	background-color: hsl(var(--secondary));
	border-radius: 1.5rem;
	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: 'Outfit', system-ui, sans-serif !important;
	font-size: 1.125rem !important;
	font-weight: 500 !important;
	height: 3.5rem !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	opacity: 0.9;
}

body.woocommerce-checkout .page-title {
	font-family: 'canvas-inline', system-ui, sans-serif;
	font-weight: 200;
	letter-spacing: -0.01em;
}

body.woocommerce-checkout .site-main {
	padding-top: 4rem;
	padding-bottom: 4rem;
}

/* -------------------------------------------------------------------------
 * Thank you page
 * ---------------------------------------------------------------------- */

body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
	max-width: 900px;
}

body.theme-thankyou-page .woocommerce-notice {
	padding: 1rem 1.25rem;
	border-radius: 1rem;
	background-color: hsl(var(--secondary));
	border: 1px solid hsl(var(--border));
}

body.theme-thankyou-page .woocommerce-order-overview {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin: 1.5rem 0 2rem;
	padding: 1.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: 1.5rem;
	background-color: hsl(var(--card));
}

body.theme-thankyou-page .woocommerce-order-overview li {
	flex: 1 1 160px;
	min-width: 0;
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	margin-top: 0.35rem;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: hsl(var(--foreground));
	overflow-wrap: break-word;
}

body.theme-thankyou-page .woocommerce-order-details,
body.theme-thankyou-page .woocommerce-customer-details {
	margin-top: 2.5rem;
}

body.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.95rem;
}

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;
	overflow-wrap: break-word;
}

body.theme-thankyou-page .woocommerce-order-details thead th {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: hsl(var(--muted-foreground));
}

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-order h2,
body.theme-thankyou-page .woocommerce-order-details__title {
	font-family: 'canvas-inline', system-ui, sans-serif;
	font-weight: 200;
	letter-spacing: -0.01em;
	padding: 0 0 1rem 0;
}

body.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	line-height: 1.6;
}

/* -------------------------------------------------------------------------
 * Contact form status
 * ---------------------------------------------------------------------- */

.theme-contact-status[data-state='error'] {
	color: hsl(var(--accent));
}

/* Reduced motion: keep content visible. */
@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}

	#theme-cart-drawer,
	#theme-cart-drawer > aside {
		transition: none;
	}
}
