/**
 * Aunt Susan’s Kitchen — theme additions.
 *
 * app.css already ships the source preflight, base layer and utility classes.
 * This file only carries functional rules plus styling for markup that has no
 * equivalent in the source design (WooCommerce/WordPress output).
 */

[hidden] {
	display: none !important;
}

/* -------------------------------------------------------------------------
 * Lock page to vertical scroll only (no horizontal scrollbar)
 * ---------------------------------------------------------------------- */

html,
body {
	overflow-x: hidden;
	max-width: 100%;
}

body {
	overflow-y: auto;
}

/* -------------------------------------------------------------------------
 * WordPress admin bar — keep the fixed 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 interactive controls
 * ---------------------------------------------------------------------- */

a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"],
input[type="image"],
label[for],
select,
summary,
.theme-cat-filter,
.theme-thumb,
.theme-attr-pill,
[data-cart-open],
[data-cart-close],
[data-menu-toggle],
[data-anchor-link],
[data-scroll-top],
[data-mobile-link],
[data-cart-qty-update],
[data-cart-remove] {
	cursor: pointer;
}

a:where([aria-disabled="true"]),
button:disabled,
button[disabled],
.button:disabled,
.button.disabled {
	cursor: not-allowed;
}

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */

.site-header {
	top: 0;
}

.theme-cart-count:empty,
.theme-cart-count.is-empty {
	display: none !important;
}

footer .footer-chapters > a {
	display: inline-flex;
	width: auto;
	max-width: 100%;
	justify-content: flex-start;
	padding-left: 0;
	padding-right: 0;
	text-align: left;
	color: hsl(var(--cream) / 0.75);
}

.site-header .site-logo-img {
	height: 5rem;
	width: 5rem;
}

.site-header [data-menu-toggle] {
	width: 3rem;
	height: 3rem;
}

/* The source swaps the menu icon on open; keep the button's resting look. */
.site-header [data-menu-toggle][aria-expanded="true"]:hover,
.site-header [data-menu-toggle][aria-expanded="true"]:focus {
	background-color: transparent;
	color: inherit;
}

.theme-page-shell {
	min-height: 60vh;
}

/* -------------------------------------------------------------------------
 * Cart drawer state (body.cart-open)
 * ---------------------------------------------------------------------- */

#theme-cart-overlay {
	position: fixed;
	inset: 0;
	z-index: 40;
	display: none;
	background-color: hsl(var(--foreground) / 0.2);
}

body.cart-open #theme-cart-overlay {
	display: block;
	animation: themeFadeIn 0.2s linear;
}

#theme-cart-drawer {
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	animation: none !important;
}

body.cart-open #theme-cart-drawer {
	transform: translateX(0);
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

@keyframes themeFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* Disabled add-to-cart buttons (variable products / sold out) */
.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;
}

/* Button lock during AJAX add */
.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;
}

/* Hide the WooCommerce "View cart" link injected after AJAX add */
.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;
}

/* -------------------------------------------------------------------------
 * Reveal animations (source `.reveal` + framer-motion equivalents)
 * ---------------------------------------------------------------------- */

.reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.theme-fade-up,
.theme-fade-item {
	opacity: 0;
	transform: translateY(32px);
	filter: blur(8px);
	transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1), filter 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-fade-up.is-visible,
.theme-fade-item.is-visible {
	opacity: 1;
	transform: translateY(0);
	filter: blur(0);
}

.theme-fade-item:nth-child(2) { transition-delay: 0.08s; }
.theme-fade-item:nth-child(3) { transition-delay: 0.16s; }
.theme-fade-item:nth-child(4) { transition-delay: 0.24s; }

body.is-customizer .reveal,
body.is-customizer .theme-fade-up,
body.is-customizer .theme-fade-item,
.no-js .reveal {
	opacity: 1 !important;
	transform: none !important;
	filter: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.reveal,
	.theme-fade-up,
	.theme-fade-item {
		opacity: 1 !important;
		transform: none !important;
		filter: none !important;
		transition: none !important;
	}
}

/* -------------------------------------------------------------------------
 * WooCommerce shop grid
 * ---------------------------------------------------------------------- */

.theme-product-grid {
	display: grid;
	align-items: stretch;
}

.theme-product-grid > .product,
.theme-product-grid article {
	height: 100%;
}

.theme-product-grid article {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* -------------------------------------------------------------------------
 * Single product layout
 * ---------------------------------------------------------------------- */

.single-product .theme-product-layout,
.single-product .theme-product-gallery,
.single-product .theme-product-info {
	min-width: 0;
	max-width: 100%;
}

.single-product .theme-add-to-cart-area {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 1rem;
}

.single-product .single_add_to_cart_button {
	flex: 1 1 auto;
	min-width: 160px;
}

.single-product .theme-quantity-wrapper {
	flex: 0 0 auto;
}

.single-product .theme-quantity-wrapper .theme-qty-input {
	appearance: textfield;
	-moz-appearance: textfield;
}

.single-product .theme-quantity-wrapper .theme-qty-input::-webkit-outer-spin-button,
.single-product .theme-quantity-wrapper .theme-qty-input::-webkit-inner-spin-button {
	appearance: none;
	margin: 0;
}

.single-product .theme-quantity-wrapper .theme-qty-input:focus {
	outline: none;
}

.single-product .theme-product-thumbnails {
	flex-wrap: wrap;
	max-width: 100%;
}

.single-product .theme-thumb {
	position: relative;
	border: 1px solid hsl(var(--border));
	background: hsl(var(--card));
	cursor: pointer;
	padding: 0;
	overflow: hidden;
}

.single-product .theme-thumb.is-active {
	border-color: hsl(var(--primary));
	box-shadow: inset 0 0 0 1px hsl(var(--primary));
}

.single-product .theme-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.single-product .theme-product-main-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

.single-product .woocommerce-variation-price {
	margin-bottom: 1rem;
}

.single-product .single_variation_wrap {
	width: 100%;
}

/* Variation table: stacked label above control */
.single-product .variations,
.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: 0 0 0.25rem;
}

.single-product .variations tbody td.value {
	padding: 0;
}

.single-product .variations tbody td.label label {
	display: block;
	font-size: 0.75rem;
	line-height: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: hsl(var(--primary));
}

.theme-attr-select-hidden {
	display: none !important;
}

.theme-attr-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.theme-attr-pills .theme-attr-pill.is-active {
	background: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-color: hsl(var(--primary));
}

/* -------------------------------------------------------------------------
 * WordPress / WooCommerce generated markup
 * ---------------------------------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-message {
	list-style: none;
	padding: 1rem 1.25rem;
	margin: 0 0 1.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: 0.375rem;
	background: hsl(var(--card));
	color: hsl(var(--foreground));
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.5rem;
}

.woocommerce-error {
	border-color: hsl(var(--destructive));
	color: hsl(var(--destructive));
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
	display: none;
}

#theme-cart-drawer .woocommerce-message {
	display: none;
}

.woocommerce-error + .woocommerce-error {
	margin-top: 0.5rem;
}

/* Page titles */
.page-title {
	font-family: var(--font-display);
	font-weight: 400;
	letter-spacing: 0;
}

/* -------------------------------------------------------------------------
 * Checkout (Blocks) — scoped under body.woocommerce-checkout
 * ---------------------------------------------------------------------- */

body.woocommerce-checkout .page-title,
body.woocommerce-checkout .entry-content {
	max-width: 100%;
}

body.woocommerce-checkout .site-main,
body.woocommerce-checkout .theme-page-shell {
	padding-top: 6rem;
	padding-bottom: 4rem;
}

body.woocommerce-checkout .wc-block-checkout {
	display: block;
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		gap: 2rem !important;
		align-items: start;
	}

	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large > .wc-block-checkout__main,
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large > .wc-block-checkout__sidebar {
		flex: none !important;
		width: 100% !important;
		max-width: none !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-checkout__sidebar {
	background-color: hsl(var(--secondary));
	border-radius: var(--radius);
	padding: 2rem;
}

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,
body.woocommerce-checkout .woocommerce-checkout .form-row .input-text,
body.woocommerce-checkout .woocommerce-checkout .form-row select {
	width: 100% !important;
	max-width: none !important;
	border: 1px solid hsl(var(--border)) !important;
	border-radius: var(--radius) !important;
	background-color: hsl(var(--background)) !important;
	color: hsl(var(--foreground)) !important;
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	line-height: 1.5rem !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;
	outline: none !important;
	box-shadow: 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-components-checkout-place-order-button,
body.woocommerce-checkout .wc-block-checkout__actions .wc-block-components-button {
	background-color: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border-radius: var(--radius) !important;
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	line-height: 1.25rem !important;
	font-weight: 700 !important;
	text-transform: none !important;
	padding: 0.75rem 1rem !important;
	min-height: 3.5rem !important;
	letter-spacing: 0 !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover,
body.woocommerce-checkout .wc-block-checkout__actions .wc-block-components-button:hover {
	background-color: hsl(var(--primary) / 0.9) !important;
	color: hsl(var(--primary-foreground)) !important;
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
	font-family: var(--font-display) !important;
	font-weight: 400 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	border-radius: var(--radius);
	border-color: hsl(var(--border));
	background-color: hsl(var(--card));
	color: hsl(var(--foreground));
	font-family: var(--font-body);
}

body.woocommerce-checkout .wc-block-cart-items,
body.woocommerce-checkout .wc-block-components-order-summary {
	background: transparent;
}

/* Cart / account width parity */
body.theme-cart-page .theme-page-shell,
body.theme-account-page .theme-page-shell,
body.theme-thankyou-page .theme-page-shell {
	max-width: 100%;
}

body.theme-cart-page .page-title,
body.theme-account-page .page-title,
body.theme-thankyou-page .page-title {
	max-width: 100%;
}

/* -------------------------------------------------------------------------
 * Thank you page
 * ---------------------------------------------------------------------- */

body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
	font-family: var(--font-body);
	color: hsl(var(--foreground));
}

body.theme-thankyou-page .woocommerce-order h2,
body.theme-thankyou-page .woocommerce-order-details__title,
body.theme-thankyou-page .woocommerce-column__title {
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 2rem;
	padding: 0 0 1rem;
	letter-spacing: 0;
	text-transform: none;
}

body.theme-thankyou-page .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 1.5rem;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	background: hsl(var(--card));
}

body.theme-thankyou-page .woocommerce-order-overview li {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5rem;
	color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	color: hsl(var(--foreground));
	font-weight: 700;
}

body.theme-thankyou-page .woocommerce-order-details table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-size: 0.875rem;
	line-height: 1.5rem;
}

body.theme-thankyou-page .woocommerce-order-details table th,
body.theme-thankyou-page .woocommerce-order-details table td {
	padding: 0.75rem 0;
	border-bottom: 1px solid hsl(var(--border));
	vertical-align: top;
	overflow-wrap: break-word;
}

body.theme-thankyou-page .woocommerce-order-details tfoot th {
	text-align: left;
	font-weight: 400;
	color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-order-details tfoot td {
	text-align: right;
	font-weight: 700;
}

body.theme-thankyou-page .woocommerce-customer-details {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 2.5rem;
}

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.5rem;
	color: hsl(var(--muted-foreground));
}

/* Generic WooCommerce tables (cart/account) matching the design system */
.woocommerce table.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 0.875rem;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
	padding: 0.75rem;
	border-bottom: 1px solid hsl(var(--border));
	text-align: left;
}

.woocommerce table.shop_table tfoot th {
	color: hsl(var(--muted-foreground));
	font-weight: 400;
}

.woocommerce table.shop_table tfoot td {
	text-align: right;
	font-weight: 700;
}

.woocommerce .button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
	font-family: var(--font-body);
}

/* Pagination */
.woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 2rem 0 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: 1px solid hsl(var(--border));
	border-radius: var(--radius);
	color: hsl(var(--foreground));
	font-family: var(--font-body);
	font-size: 0.875rem;
}

.woocommerce-pagination ul li span.current {
	background: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* -------------------------------------------------------------------------
 * Home shop toolbar chips
 * ---------------------------------------------------------------------- */

#theme-shop-grid .theme-shop-item {
	height: 100%;
}

/* Generic post list (index.php) */
.theme-post-list > * + * {
	margin-top: 3rem;
}

/* -------------------------------------------------------------------------
 * Contact form state
 * ---------------------------------------------------------------------- */

#theme-contact-form.is-sending button[type="submit"] {
	opacity: 0.6;
	pointer-events: none;
}

#theme-contact-note[data-state="error"] {
	color: hsl(var(--accent));
}

#theme-contact-note[data-state="success"] {
	color: hsl(var(--brass-light));
}
