/* Functional layer: WooCommerce and WordPress markup that has no source equivalent. */

/* Keep the fixed header below the WordPress admin bar (front end + Customizer preview). */
body.admin-bar [data-site-header] {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
	body.admin-bar [data-site-header] {
		top: 46px;
	}
}

/* Pointer cursor on interactive controls site-wide. */
a[href]:where(:not([href=""])),
button:not(:disabled):not([disabled]),
summary,
[role="button"]:not([aria-disabled="true"]),
label[for],
input[type="submit"]:not(:disabled),
input[type="button"]:not(:disabled),
input[type="reset"]:not(:disabled),
select,
[data-cart-open],
[data-menu-toggle],
[data-badge-toggle],
[data-promo-dismiss],
[data-faq-show-all],
[data-shop-more],
[data-scroll-to],
[data-back-to-top] {
	cursor: pointer;
}

/* Side cart visibility is driven by body.cart-open. */
body:not(.cart-open) #theme-cart-drawer,
body:not(.cart-open) #theme-cart-overlay {
	display: none;
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

#theme-cart-drawer .theme-cart-variation {
	overflow-wrap: break-word;
	word-break: break-word;
}

.theme-cart-count:empty {
	display: none;
}

/* Logo height stays identical in header and footer. */
.site-logo-img {
	height: var(--logo-height) !important;
	width: auto !important;
	display: block;
}

.site-logo-text {
	line-height: var(--logo-height);
	display: block;
}

/* Add-to-cart disabled state (out of stock and unselected variations). */
.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;
}

/* WooCommerce appends a "View cart" link 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;
}

/* Theme loading state on add-to-cart buttons. */
.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;
}

/* Quantity input: behaves like the source's numeric label. */
.theme-qty-input {
	width: 3rem;
	min-width: 44px;
	padding: 0.625rem 1rem;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: center;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.25;
	appearance: textfield;
	-moz-appearance: textfield;
}

.theme-qty-input:focus {
	outline: none;
}

.theme-qty-input::-webkit-outer-spin-button,
.theme-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* WooCommerce price markup inherits the surrounding type. */
.woocommerce-Price-amount,
.woocommerce-Price-currencySymbol,
.woocommerce-price-suffix,
.price ins,
.price del {
	font: inherit;
	color: inherit;
	text-decoration: none;
}

.price del {
	opacity: 0.55;
	margin-right: 0.5rem;
}

/* Single product layout guards. */
.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 {
	flex-wrap: wrap;
	max-width: 100%;
}

.single-product .theme-add-to-cart-area {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.single-product .theme-add-to-cart-buttons {
	min-width: 0;
}

.single-product .single_add_to_cart_button {
	flex: 1 1 auto;
	min-width: 160px;
}

.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in,
.single-product .theme-product-details {
	overflow-wrap: break-word;
	word-break: break-word;
}

/* Product details list mirrors the source bullet list. */
.single-product .theme-product-details ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.single-product .theme-product-details li {
	display: flex;
	align-items: flex-start;
	margin-bottom: 0.625rem;
}

.single-product .theme-product-details li::before {
	content: "";
	width: 0.25rem;
	height: 0.25rem;
	margin-top: 0.625rem;
	margin-right: 0.75rem;
	border-radius: 9999px;
	background-color: hsl(var(--primary));
	flex-shrink: 0;
}

.single-product .theme-product-details p {
	margin: 0 0 1rem;
}

/* Variations table: label above control. */
.single-product .variations {
	width: 100%;
	margin: 0 0 1.5rem;
	border-collapse: collapse;
}

.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;
	padding-left: 0;
}

.single-product .variations tbody td.label label {
	font-size: 12px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: hsl(var(--foreground) / 0.55);
}

.single-product .variations tbody td.value {
	padding-top: 0;
	padding-left: 0;
}

.single-product .variations select {
	width: 100%;
	height: 3rem;
	padding: 0 2.5rem 0 1rem;
	background-color: hsl(var(--ivory));
	border: 1px solid hsl(var(--foreground) / 0.15);
	border-radius: calc(var(--radius) - 2px);
	color: hsl(var(--foreground));
	font-family: 'Geist', system-ui, sans-serif;
	font-size: 14px;
	appearance: none;
	background-image: none;
}

.single-product .variations .reset_variations {
	display: inline-block;
	margin-top: 0.5rem;
	font-size: 12px;
	color: hsl(var(--foreground) / 0.55);
}

.single-product .single_variation_wrap {
	margin-top: 1rem;
}

.single-product .woocommerce-variation-price {
	margin-bottom: 1rem;
	font-size: 20px;
	font-weight: 500;
	color: hsl(var(--foreground) / 0.9);
}

.single-product .woocommerce-variation-availability {
	margin-bottom: 1rem;
	font-size: 14px;
	color: hsl(var(--muted-foreground));
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
	display: none;
}

/* WooCommerce notices on pages without alternative feedback. */
.woocommerce-notices-wrapper {
	margin: 0 0 1.5rem;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	list-style: none;
	padding: 1rem 1.25rem;
	margin: 0 0 1rem;
	background-color: hsl(var(--ivory));
	border: 1px solid hsl(var(--foreground) / 0.15);
	border-radius: calc(var(--radius) - 2px);
	color: hsl(var(--foreground));
	font-size: 14px;
	line-height: 1.6;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	display: none;
}

.woocommerce-error {
	border-color: hsl(var(--destructive) / 0.5);
}

.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.75rem;
	padding: 0.5rem 1.25rem;
	border-radius: 9999px;
	background-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

/* Page content typography for content with no source equivalent. */
.entry-content {
	font-size: 15px;
	line-height: 1.85;
	color: hsl(var(--foreground) / 0.78);
}

.entry-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

.entry-content h2,
.entry-content h3 {
	color: hsl(var(--foreground));
}

.page-title {
	font-size: 2.25rem;
	line-height: 1.05;
	margin: 0 0 2rem;
	color: hsl(var(--foreground));
	font-weight: 500;
}

@media (min-width: 768px) {
	.page-title {
		font-size: 3rem;
	}
}

/* Cart and account blocks use the same container as the checkout. */
body.woocommerce-cart .entry-content,
body.woocommerce-account .entry-content {
	max-width: 100%;
}

body.woocommerce-cart .site-main,
body.woocommerce-account .site-main {
	padding-bottom: 4rem;
}

/* Checkout block: one grid owner, 50/50 split. */
body.woocommerce-checkout .wc-block-checkout {
	display: block;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--checkout-gap, 2rem);
		align-items: start;
	}

	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout {
		display: grid;
	}
}

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-checkout__main {
	order: 1;
}

body.woocommerce-checkout .wc-block-checkout__sidebar {
	order: 2;
	background-color: hsl(var(--linen));
	border: 1px solid hsl(var(--foreground) / 0.1);
	border-radius: 1rem;
	padding: 1.5rem;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-checkout__sidebar {
		padding: 1.75rem;
		position: sticky;
		top: 7rem;
	}
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	grid-column: 1 / -1;
}

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-blocks-components-select__select {
	width: 100% !important;
	max-width: none !important;
	background-color: hsl(var(--ivory)) !important;
	border: 1px solid hsl(var(--foreground) / 0.15) !important;
	border-radius: calc(var(--radius) - 2px) !important;
	color: hsl(var(--foreground)) !important;
	font-family: 'Geist', system-ui, -apple-system, sans-serif !important;
	font-size: 14px !important;
}

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 {
	border-color: hsl(var(--primary)) !important;
	box-shadow: none !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(--foreground) / 0.45) !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
	background-color: hsl(var(--primary)) !important;
	border: 1px solid hsl(var(--primary)) !important;
	border-radius: 9999px !important;
	color: hsl(var(--primary-foreground)) !important;
	min-height: 3rem;
	font-family: 'Geist', system-ui, sans-serif !important;
	font-size: 14px !important;
	font-weight: 500 !important;
}

body.woocommerce-checkout .wc-block-checkout__main h2,
body.woocommerce-checkout .wc-block-checkout__main h3,
body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
	font-family: 'Clash Grotesk', 'Geist', system-ui, sans-serif !important;
	font-weight: 500 !important;
	color: hsl(var(--foreground)) !important;
	letter-spacing: 0;
}

body.woocommerce-checkout .wc-block-cart-items {
	border-color: hsl(var(--foreground) / 0.1);
}

body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__value {
	color: hsl(var(--foreground) / 0.75);
	font-size: 14px;
}

body.woocommerce-checkout .wc-block-components-product-name {
	color: hsl(var(--foreground));
	font-size: 14px;
	font-weight: 500;
}

/* Order summary line items — match Lovable / theme cart drawer thumbnails. */
body.woocommerce-checkout .wc-block-components-order-summary-item__image,
body.woocommerce-cart .wc-block-components-order-summary-item__image {
	flex-shrink: 0;
	width: 5rem;
	height: 6rem;
	border-radius: calc(var(--radius) - 2px);
	overflow: hidden;
	background-color: hsl(var(--bone));
}

body.woocommerce-checkout .wc-block-components-order-summary-item__image img,
body.woocommerce-cart .wc-block-components-order-summary-item__image img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover;
	object-position: center;
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	background-color: hsl(var(--ivory)) !important;
	border: 1px solid hsl(var(--foreground) / 0.15) !important;
	border-radius: calc(var(--radius) - 2px) !important;
	color: hsl(var(--foreground)) !important;
}

body.woocommerce-checkout .site-main {
	padding-top: var(--header-height, 128px);
	padding-bottom: 4rem;
}

/* Order received page. */
body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
	color: hsl(var(--foreground) / 0.78);
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
	font-family: 'Clash Grotesk', 'Geist', system-ui, sans-serif;
	font-weight: 500;
	color: hsl(var(--foreground));
	padding: 0 0 1rem;
	margin: 0;
	font-size: 1.5rem;
}

body.theme-thankyou-page .woocommerce-order-overview {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin: 0 0 2.5rem;
	padding: 1.5rem;
	border: 1px solid hsl(var(--foreground) / 0.15);
	border-radius: calc(var(--radius) - 2px);
	background-color: hsl(var(--ivory));
	font-size: 14px;
}

body.theme-thankyou-page .woocommerce-order-overview li {
	border: 0;
	margin: 0;
	padding: 0;
	float: none;
	line-height: 1.6;
}

body.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	margin-bottom: 2rem;
	font-size: 14px;
}

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(--foreground) / 0.1);
	text-align: left;
}

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;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	font-size: 14px;
	line-height: 1.8;
	border: 0;
	padding: 0;
}

/* Cart table fallbacks (block and classic markup). */
body.woocommerce-cart .wc-block-cart,
body.woocommerce-cart .woocommerce-cart-form {
	font-size: 14px;
}

/* Accessibility helpers. */
.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;
}

/* Reveal fallbacks: the Customizer preview and JS-less clients always see content. */
.is-customizer [data-reveal],
.is-customizer [data-reveal].is-revealed {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* SVG ring rotation needs an explicit transform box inside the hero badge. */
svg g.animate-spin {
	transform-box: fill-box;
	transform-origin: center;
}
