/* ==========================================================================
   JMK Cafe Bakery — theme layer
   Only rules for markup WordPress/WooCommerce generates (no source
   equivalent), functional behaviour, and animation state hooks.
   Typography, spacing and colour for source markup come from app.css.
   ========================================================================== */

[hidden] {
	display: none !important;
}

/* Closed overlays must never intercept clicks. */
#theme-cart-overlay,
.theme-lightbox {
	pointer-events: none;
}

body.cart-open #theme-cart-overlay,
.theme-lightbox:not([hidden]) {
	pointer-events: auto;
}

#theme-cart-drawer {
	pointer-events: none;
}

body.cart-open #theme-cart-drawer {
	pointer-events: auto;
}

/* Explicit interactive affordances for every theme control. */
a[href],
button:not(:disabled),
[role="button"]:not(:disabled),
label[for],
summary,
.theme-filter-chip,
.theme-category-card,
.theme-gallery-item,
.theme-faq-toggle,
[data-gallery-thumb],
[data-cart-open],
[data-cart-close],
[data-mobile-toggle],
[data-scroll-target] {
	cursor: pointer;
}

button:disabled,
.disabled,
[aria-disabled="true"] {
	cursor: not-allowed;
}

:root {
	--theme-header-height: 6rem;
	--theme-header-height-solid: 5rem;
	--theme-checkout-gap: 3rem;
}

/* --------------------------------------------------------------- Header ---- */

.site-header.is-solid {
	background-color: hsl(var(--background) / 0.95);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid hsl(var(--border));
}

.site-logo-img {
	display: block;
}

.site-logo-img.h-16 {
	height: var(--logo-height);
	width: auto;
}

.site-logo-img.h-14 {
	height: calc(var(--logo-height) * 0.875);
	width: auto;
}

.site-footer-logo-img {
	height: var(--footer-logo-height);
	width: auto;
	display: block;
}

.site-logo-text {
	line-height: var(--logo-height);
	display: block;
}

.theme-icon-close {
	display: none;
}

.theme-menu-open .theme-icon-close {
	display: block;
}

.theme-menu-open .theme-icon-menu {
	display: none;
}

.theme-nav-item > a {
	color: inherit;
}

.theme-mobile-nav-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.theme-footer-nav-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.theme-nav-list,
.theme-product-grid,
.theme-shop-grid {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ------------------------------------------------------- Reveal animation --- */

/* Initial states mirror the source's motion variants. */
[data-reveal] {
	opacity: 0;
	will-change: opacity, transform;
}

[data-reveal][data-reveal="fade-up"] {
	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);
	transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}

[data-reveal][data-reveal="blur-up"] {
	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);
	transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}

[data-reveal="rise"] {
	transform: translateY(24px);
	transition: opacity 0.65s ease-out, transform 0.65s ease-out;
	transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}

[data-reveal].is-visible {
	opacity: 1;
	transform: translateY(0);
	filter: blur(0);
}

/* Fallback: everything visible in the Customizer preview and without JS. */
.is-customizer [data-reveal],
.is-customizer .reveal,
.no-js [data-reveal],
.no-js .reveal {
	opacity: 1 !important;
	transform: none !important;
	filter: none !important;
}

/* Safety net: content stays readable if the observer never runs. */
html:not(.theme-js) .reveal,
html:not(.theme-js) [data-reveal] {
	opacity: 1;
	transform: none;
	filter: none;
}

/* ---------------------------------------------------------------- Hero ----- */

.theme-hero-content {
	animation: themeHeroIn 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes themeHeroIn {
	from {
		opacity: 0;
		transform: translateY(28px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* -------------------------------------------------------- Product cards ---- */

.theme-product-card .theme-product-card__image {
	transition: transform 0.8s cubic-bezier(0.25, 0.4, 0.25, 1), opacity 0.8s ease;
}

.theme-product-card:hover .theme-product-card__image {
	transform: scale(1.05);
}

.theme-product-card {
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
		border-color 0.5s ease, box-shadow 0.5s ease;
}

.theme-product-card-wrap a:hover .theme-product-card {
	transform: translateY(-6px);
}

.theme-product-card-wrap {
	display: flex;
	flex-direction: column;
}

.theme-card-price .woocommerce-Price-amount {
	color: inherit;
	font: inherit;
}

.theme-product-card-wrap .theme-card-price del {
	display: none;
}

/* --------------------------------------------------------- Cart drawer ----- */

#theme-cart-overlay {
	position: fixed;
	inset: 0;
	z-index: 55;
	background: hsl(var(--foreground) / 0.2);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.cart-open #theme-cart-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

#theme-cart-drawer {
	z-index: 60;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.35s;
}

body.cart-open #theme-cart-drawer {
	transform: translateX(0);
	visibility: visible;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s;
}

#theme-cart-drawer.is-updating > * {
	opacity: 0.6;
	pointer-events: none;
}

#theme-cart-drawer .theme-cart-item-thumb img,
#theme-cart-drawer img {
	display: block;
}

.theme-cart-subtotal .woocommerce-Price-amount {
	font: inherit;
	color: inherit;
}

/* Cart badge hides when the bag is empty, matching the source. */
.theme-cart-count:empty {
	display: none;
}

/* WooCommerce "View cart" link injected 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;
}

/* Add-to-cart locked state (theme + WooCommerce classes). */
.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;
}

.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 {
	opacity: 0.4 !important;
	transform: none !important;
}

/* -------------------------------------------------- Quantity input chrome --- */

.theme-quantity-wrapper input[type="number"] {
	-moz-appearance: textfield;
	appearance: textfield;
	width: 4rem;
}

.theme-quantity-wrapper input[type="number"]::-webkit-outer-spin-button,
.theme-quantity-wrapper input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ------------------------------------------------------ Variation pills ----- */

.theme-attr-select-hidden {
	display: none !important;
}

.theme-attr-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: transparent;
	color: hsl(var(--foreground));
	cursor: pointer;
}

.theme-attr-pill:hover {
	border-color: hsl(var(--primary) / 0.5);
}

.theme-attr-swatch {
	display: inline-block;
	width: 1rem;
	height: 1rem;
	border-radius: 9999px;
	border: 1px solid hsl(var(--border));
}

/* ---------------------------------------------------- Single product page --- */

.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%;
}

.single-product .theme-add-to-cart-area {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 1rem;
}

.single-product .theme-add-to-cart-area .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 {
	overflow-wrap: break-word;
	word-break: break-word;
}

.single-product .variations {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5rem;
}

.single-product .variations.shop_attributes 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.label label {
	display: block;
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
}

.single-product .variations tbody td.value {
	padding: 0;
}

.single-product .single_variation_wrap {
	margin-bottom: 0;
}

.single-product .woocommerce-variation-price {
	font-family: var(--font-body);
	font-size: 1.5rem;
	font-weight: 600;
	margin-bottom: 1rem;
}

.single-product .woocommerce-variation-availability p {
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 1rem;
}

.single-product .woocommerce-variation-description p {
	font-family: var(--font-body);
	color: hsl(var(--muted-foreground));
	margin-bottom: 1rem;
}

/* ------------------------------------------------------------ Notices ------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.6;
	padding: 1rem 1.25rem;
	border: 1px solid hsl(var(--border));
	background: hsl(var(--card));
	color: hsl(var(--foreground));
	list-style: none;
	margin: 0 0 1.5rem;
}

.woocommerce-error {
	border-color: hsl(var(--destructive) / 0.5);
	color: hsl(var(--destructive));
}

.woocommerce-message {
	border-color: hsl(var(--primary) / 0.5);
}

.woocommerce-notices-wrapper:empty {
	display: none;
}

.single-product .woocommerce-message,
.single-product .woocommerce-info {
	display: none;
}

#theme-cart-drawer .woocommerce-message {
	display: none;
}

/* --------------------------------------------------- Archive pagination ----- */

.woocommerce-pagination {
	display: flex;
	justify-content: center;
	margin-top: 3rem;
}

.woocommerce-pagination ul {
	display: flex;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0 0.75rem;
	border: 1px solid hsl(var(--border));
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--foreground));
	text-decoration: none;
}

.woocommerce-pagination span.current {
	background: hsl(var(--primary));
	border-color: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
}

/* ------------------------------------------------------- Page shell --------- */

.page-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 2.25rem;
	line-height: 1.05;
	letter-spacing: 0;
	margin: 0 0 1.5rem;
}

@media (min-width: 768px) {
	.page-title {
		font-size: 3rem;
	}
}

.entry-content > p {
	font-family: var(--font-body);
	color: hsl(var(--muted-foreground));
	line-height: 1.7;
	margin-bottom: 1rem;
}

.entry-content > h2,
.entry-content > h3 {
	font-family: var(--font-display);
	margin: 2rem 0 1rem;
}

/* ----------------------------------------------------- Checkout (Blocks) ---- */

body.woocommerce-checkout .entry-content {
	max-width: 100%;
}

body.woocommerce-checkout .wc-block-checkout {
	display: block;
	font-family: var(--font-body);
	color: hsl(var(--foreground));
}

@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
	body.woocommerce-checkout .wc-block-checkout.wc-block-components-sidebar-layout {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: var(--theme-checkout-gap);
		align-items: start;
	}
}

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(--card));
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	padding: 2rem;
}

body.woocommerce-checkout .wc-block-checkout__main h2,
body.woocommerce-checkout .wc-block-checkout__sidebar h2,
body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.2;
	letter-spacing: 0;
	color: hsl(var(--foreground));
	text-transform: none;
}

body.woocommerce-checkout .wc-block-components-checkout-step__description,
body.woocommerce-checkout .wc-block-components-checkout-step__container p {
	font-family: var(--font-body);
	font-size: 0.875rem;
	line-height: 1.7;
	color: hsl(var(--muted-foreground));
}

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 .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input,
body.woocommerce-checkout .woocommerce-checkout .form-row .input-text,
body.woocommerce-checkout .woocommerce-checkout .form-row select {
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	color: hsl(var(--foreground)) !important;
	background-color: hsl(var(--background)) !important;
	border: 1px solid hsl(var(--border)) !important;
	border-radius: 0 !important;
	box-shadow: none !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,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input.components-combobox-control__input:focus {
	border-color: hsl(var(--primary)) !important;
	outline: none !important;
	box-shadow: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-select label,
body.woocommerce-checkout .wc-block-components-checkbox__label,
body.woocommerce-checkout .wc-block-components-radio-control__label {
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	color: hsl(var(--muted-foreground)) !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-components-button.wc-block-components-checkout-place-order-button {
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	font-weight: 500 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	background-color: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border: 1px solid hsl(var(--primary)) !important;
	border-radius: calc(var(--radius) - 2px) !important;
	box-shadow: none !important;
	min-height: 3.5rem;
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	background-color: hsl(var(--primary) / 0.9) !important;
	box-shadow: 0 10px 28px -10px hsl(var(--primary) / 0.7) !important;
}

body.woocommerce-checkout .wc-block-cart-items__row,
body.woocommerce-checkout .wc-block-components-order-summary-item {
	font-family: var(--font-body);
}

body.woocommerce-checkout .wc-block-components-order-summary-item__description,
body.woocommerce-checkout .wc-block-components-product-metadata {
	font-family: var(--font-body);
	font-size: 0.8125rem;
	color: hsl(var(--muted-foreground));
}

body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__value {
	font-family: var(--font-body);
	font-size: 0.875rem;
}

body.woocommerce-checkout .wc-block-components-totals-item__value {
	font-weight: 500;
	color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-notice-banner {
	font-family: var(--font-body);
	border-radius: calc(var(--radius) - 2px);
	border: 1px solid hsl(var(--border));
	background: hsl(var(--card));
	color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-notice-banner.is-error {
	border-color: hsl(var(--destructive) / 0.5);
}

/* Order summary headings inside the cart/checkout blocks. */
body.woocommerce-checkout .wc-block-components-title.wc-block-components-title,
body.woocommerce-checkout .wc-block-checkout__sidebar .wc-block-components-title {
	font-family: var(--font-display);
	font-size: 1.5rem;
}

/* ---------------------------------------------- Cart / Account blocks ------ */

body.theme-cart-page .entry-content,
body.theme-account-page .entry-content {
	max-width: 100%;
}

body.theme-cart-page .wc-block-cart,
body.theme-account-page .woocommerce {
	font-family: var(--font-body);
	color: hsl(var(--foreground));
}

body.theme-cart-page .wc-block-components-title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.5rem;
	line-height: 1.2;
}

body.theme-cart-page .wc-block-cart__submit-button,
body.theme-cart-page .wc-block-components-button,
body.theme-account-page .woocommerce-Button,
body.theme-account-page button.button {
	font-family: var(--font-body) !important;
	font-size: 0.875rem !important;
	font-weight: 500 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	background-color: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border: 1px solid hsl(var(--primary)) !important;
	border-radius: calc(var(--radius) - 2px) !important;
	box-shadow: none !important;
}

body.theme-account-page .woocommerce-Input,
body.theme-account-page input[type="text"],
body.theme-account-page input[type="email"],
body.theme-account-page input[type="password"] {
	font-family: var(--font-body);
	font-size: 0.875rem;
	color: hsl(var(--foreground));
	background: hsl(var(--background));
	border: 1px solid hsl(var(--border));
	border-radius: 0;
	padding: 0.75rem 1rem;
}

/* --------------------------------------------------- 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 > p,
body.theme-thankyou-page .woocommerce-order > .woocommerce-thankyou-order-received {
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.7;
	color: hsl(var(--muted-foreground));
	margin-bottom: 1.5rem;
}

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: 700;
	font-size: 1.5rem;
	line-height: 1.2;
	color: hsl(var(--foreground));
	padding: 0 0 1rem;
	margin: 0;
}

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));
	background: hsl(var(--card));
}

body.theme-thankyou-page .woocommerce-order-overview li {
	font-family: var(--font-body);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: hsl(var(--muted-foreground));
	border: 0;
	padding: 0;
	margin: 0;
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	letter-spacing: 0;
	text-transform: none;
	color: hsl(var(--foreground));
	font-weight: 500;
}

body.theme-thankyou-page .woocommerce-order-details table,
body.theme-thankyou-page .woocommerce-table {
	width: 100%;
	table-layout: fixed;
	border-collapse: collapse;
	font-family: var(--font-body);
	font-size: 0.875rem;
}

body.theme-thankyou-page .woocommerce-order-details table th,
body.theme-thankyou-page .woocommerce-order-details table td,
body.theme-thankyou-page .woocommerce-table th,
body.theme-thankyou-page .woocommerce-table td {
	border: 1px solid hsl(var(--border));
	padding: 0.875rem 1rem;
	text-align: left;
	overflow-wrap: break-word;
}

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: 2.5rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	font-family: var(--font-body);
	font-size: 0.875rem;
	font-style: normal;
	line-height: 1.7;
	color: hsl(var(--muted-foreground));
	max-width: 480px;
	overflow-wrap: break-word;
}

/* ------------------------------------------------ Customizer controls ------ */

.theme-media-control {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.theme-media-url-input {
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.theme-media-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.theme-media-preview {
	max-width: 100%;
	height: auto;
	display: block;
	border: 1px solid #dcdcde;
}

/* ------------------------------------------------------ Pagination reset ---- */

nav.woocommerce-pagination ul li {
	border: 0;
}

/* -------------------------------------------------------- Utility reset ----- */

.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering {
	display: none;
}

/* Product grid children stretch so cards match heights. */
.theme-shop-grid,
.theme-product-grid {
	align-items: stretch;
}

/* Hide the "no products" state until filtering produces an empty result. */
[data-shop-empty][hidden] {
	display: none !important;
}
