/*
 * Theme styles for markup that has no source equivalent (WordPress and
 * WooCommerce generated output) plus functional behaviour rules.
 * All shared design values are read from the source custom properties.
 */

/* ---------- Global helpers ---------- */

[hidden] {
	display: none !important;
}

/* No horizontal scroll: clip wide decorative bands without breaking sticky headers. */
html {
	overflow-x: clip;
}

body {
	overflow-x: clip;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
}

/* Long Customizer strings must wrap inside section shells. */
.hero-content,
.hero-title,
.hero-title span,
.section-heading,
.floral-stripe,
.site-announce-text {
	max-width: 100%;
	min-width: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.hero-content {
	width: 100%;
	box-sizing: border-box;
	padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

.site-brand-text {
	overflow-wrap: anywhere;
	word-break: break-word;
}

.container-wide,
.section-pad {
	min-width: 0;
	max-width: 100%;
}

.cucina-hero,
.story-parallax,
.floral-stripe {
	overflow-x: clip;
}

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

.screen-reader-text:focus {
	background-color: hsl(var(--background));
	border-radius: var(--radius);
	box-shadow: 0 0 2px 2px hsl(var(--foreground) / 0.2);
	clip: auto !important;
	clip-path: none;
	color: hsl(var(--primary));
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ---------- Site identity ---------- */

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

.site-logo-img--footer {
	height: var(--footer-logo-height) !important;
}

.site-logo-img--social {
	height: var(--social-logo-height) !important;
}

/* Selective-refresh wrappers must not introduce a box of their own. */
.theme-logo-partial {
	display: contents;
}

.site-logo-text {
	line-height: 1.1;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 1.75rem;
	color: inherit;
}

.site-header__brand {
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.theme-nav-list {
	min-width: 0;
}

/* Flex text safety: long labels must shrink rather than push siblings out. */
.theme-product-card h3,
.theme-product-card p,
footer h2,
footer li,
footer p,
#theme-cart-drawer a {
	min-width: 0;
	overflow-wrap: break-word;
}

/* Fallback nav markup emitted by wp_nav_menu */
.theme-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.theme-nav-list a {
	font-size: 0.875rem;
	color: hsl(var(--foreground));
	text-decoration: none;
	transition: color 0.2s var(--transition-smooth);
}

.theme-nav-list a:hover {
	color: hsl(var(--primary));
}

.theme-nav-list .current-menu-item > a {
	color: hsl(var(--primary));
}

/* ---------- Decorative artwork masks ---------- */

.watermark-art {
	aspect-ratio: 1 / 1;
}

.floral-art--mask {
	background-color: currentColor;
}

.story-parallax {
	background-color: transparent;
}

.story-parallax > .container-wide {
	position: relative;
	z-index: 1;
}

/* ---------- Mobile menu panel ---------- */

#theme-mobile-menu {
	max-height: calc(100dvh - var(--theme-header-height, 6rem));
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

#theme-mobile-menu a {
	color: hsl(var(--foreground));
	text-decoration: none;
	border-bottom: 1px solid hsl(var(--border));
}

#theme-mobile-menu a:last-child {
	border-bottom: 0;
}

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

#theme-cart-drawer {
	transform: translateX(100%);
	transition: transform 0.22s var(--transition-smooth);
	will-change: transform;
}

body.cart-open #theme-cart-drawer {
	transform: translateX(0);
}

#theme-cart-overlay {
	position: fixed;
	inset: 0;
	background: hsl(var(--foreground) / 0.2);
	z-index: 40;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s var(--transition-smooth), visibility 0.22s var(--transition-smooth);
}

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

body.cart-open {
	overflow: hidden;
}

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

#theme-cart-drawer a {
	text-decoration: none;
}

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

.theme-product-card {
	height: 100%;
}

.theme-product-card > a {
	color: inherit;
	text-decoration: none;
}

.theme-product-card .product-card__title,
.theme-product-card h3 {
	font-family: var(--font-accent);
}

.theme-product-grid {
	align-items: stretch;
}

.theme-product-thumbnails {
	flex-wrap: wrap;
	max-width: 100%;
}

.theme-product-thumb {
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	padding: 0;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s var(--transition-smooth), border-color 0.2s var(--transition-smooth);
}

.theme-product-thumb.is-active,
.theme-product-thumb:hover {
	opacity: 1;
	border-color: hsl(var(--primary));
}

.theme-product-thumb img {
	display: block;
}

/* ---------- Quantity control ---------- */

.theme-quantity-wrapper {
	overflow: hidden;
}

.theme-qty-input {
	appearance: textfield;
	-moz-appearance: textfield;
	width: 2.5rem;
	font-family: var(--font-body);
	font-size: 1rem;
	color: hsl(var(--foreground));
}

.theme-qty-input::-webkit-outer-spin-button,
.theme-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.theme-qty-minus svg,
.theme-qty-plus svg {
	width: 1rem;
	height: 1rem;
}

/* ---------- Add to cart states ---------- */

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

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

/* ---------- Variable product attribute pills ---------- */

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

.theme-variation-group + .theme-variation-group {
	margin-top: 1rem;
}

.theme-attr-pill.is-active {
	background: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	border-color: hsl(var(--primary));
}

.theme-variations {
	margin-bottom: 1.5rem;
}

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

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

.single-product .variations label {
	display: none;
}

.single-product .reset_variations {
	display: inline-block;
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	text-decoration: underline;
}

.single_variation_wrap {
	margin-top: 1.5rem;
}

.woocommerce-variation-price {
	font-family: var(--font-display);
	font-size: 1.5rem;
	color: hsl(var(--primary));
	margin-bottom: 0.75rem;
}

.woocommerce-variation-availability p {
	font-size: 0.875rem;
	color: hsl(var(--muted-foreground));
	margin-bottom: 0.75rem;
}

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

.single-product .single_add_to_cart_button {
	flex: 1 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-layout {
	min-width: 0;
}

.single-product .woocommerce-product-details__short-description,
.single-product .woocommerce-variation-description,
.single-product .posted_in {
	overflow-wrap: break-word;
	word-break: break-word;
}

/* ---------- WooCommerce notices ---------- */

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

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

.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button {
	margin-left: 1rem;
}

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

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

/* ---------- WooCommerce prices ---------- */

/* WooCommerce wraps the price in spans; inherit the source element's type
   so the price renders exactly like the design's plain text. */
.woocommerce-Price-amount,
.woocommerce-Price-currencySymbol,
.theme-product-card .price {
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	color: inherit;
}

.theme-product-card .price {
	color: hsl(var(--primary));
}

/* Footer brand link: remove the inline strut so the logo block sets the height */
.theme-footer-brand {
	line-height: 0;
	display: block;
	width: max-content;
}

/* ---------- Cart / account / block pages ---------- */

body.woocommerce-cart .site-main,
body.woocommerce-account .site-main,
body.theme-thankyou-page .site-main {
	padding-bottom: 4rem;
}

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

body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout {
	width: 100%;
}

.wp-block-woocommerce-cart .wc-block-cart__main,
.wp-block-woocommerce-cart .wc-block-cart__sidebar {
	min-width: 0;
}

/* ---------- Cart block: buttons match the source primary button ---------- */

body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-cart .wc-block-components-button:not(.is-link),
body.woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button {
	background: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border: 1px solid hsl(var(--primary)) !important;
	border-radius: var(--field-radius) !important;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	min-height: 3rem;
}

body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-cart .wc-block-components-button:not(.is-link):hover {
	background: hsl(var(--background)) !important;
	color: hsl(var(--primary)) !important;
}

body.woocommerce-cart .wc-block-components-quantity-selector {
	border-color: hsl(var(--border));
}

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

/* ---------- Checkout block ---------- */

body.woocommerce-checkout .site-main {
	padding-top: 1.5rem;
	padding-bottom: 4rem;
}

body.woocommerce-checkout .wc-block-checkout {
	display: block;
	width: 100%;
}

body.woocommerce-checkout .wc-block-components-sidebar-layout,
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,
	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__sidebar {
	background-color: hsl(var(--card));
	border-radius: var(--radius);
	padding: 2rem;
}

body.woocommerce-checkout .wc-block-checkout__sidebar .wp-block-woocommerce-checkout-order-summary-block {
	background: transparent;
	border: 0;
}

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

/* Fields copy the source .field component (no padding/height overrides) */
body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input textarea,
body.woocommerce-checkout .wc-block-components-textarea,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input,
body.woocommerce-checkout .wc-block-components-select .wc-block-components-select__select,
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-form .wc-block-components-text-input input {
	border: 1px solid hsl(var(--field-border)) !important;
	border-radius: var(--field-radius) !important;
	background: hsl(var(--field-bg)) !important;
	color: hsl(var(--field-text)) !important;
	font-family: var(--font-body);
	font-size: var(--field-font-size) !important;
	box-shadow: none !important;
	width: 100% !important;
	max-width: none !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-combobox label,
body.woocommerce-checkout .wc-blocks-components-select__label {
	color: hsl(var(--muted-foreground));
	font-family: var(--font-body);
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-block-components-combobox input:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus {
	outline: 2px solid hsl(var(--field-focus-ring));
	outline-offset: 2px;
}

body.woocommerce-checkout .wc-block-components-radio-control__option,
body.woocommerce-checkout .wc-block-checkout__shipping-method-option {
	border: 1px solid hsl(var(--border)) !important;
	border-radius: var(--field-radius);
}

body.woocommerce-checkout .wc-block-components-radio-control__option-checked,
body.woocommerce-checkout .wc-block-checkout__shipping-method-option--selected {
	border-color: hsl(var(--primary)) !important;
	background: hsl(var(--secondary));
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button {
	background: hsl(var(--primary)) !important;
	color: hsl(var(--primary-foreground)) !important;
	border: 1px solid hsl(var(--primary));
	border-radius: var(--field-radius);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	min-height: 3rem;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
	background: hsl(var(--background)) !important;
	color: hsl(var(--primary)) !important;
}

body.woocommerce-checkout .wc-block-cart-items,
body.woocommerce-checkout .wc-block-components-order-summary {
	font-family: var(--font-body);
	color: hsl(var(--foreground));
}

body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-checkout__main h2 {
	font-family: var(--font-accent);
	font-weight: 600;
}

/* ---------- Page title ---------- */

.page-title {
	font-family: var(--font-display);
	font-weight: 600;
}

/* ---------- Thank you page ---------- */

body.theme-thankyou-page {
	overflow-x: hidden;
}

body.theme-thankyou-page .woocommerce-order {
	max-width: 100%;
	font-family: var(--font-body);
}

body.theme-thankyou-page .woocommerce-order > p {
	font-size: 1rem;
	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-accent);
	font-weight: 600;
	font-size: 1.5rem;
	padding: 0 0 1rem 0;
	margin: 2rem 0 0;
}

body.theme-thankyou-page .woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	margin: 0 0 2rem;
	padding: 0 0 1.5rem;
	border-bottom: 1px solid hsl(var(--border));
	font-size: 0.9rem;
}

body.theme-thankyou-page .woocommerce-order-overview li {
	margin: 0;
	color: hsl(var(--muted-foreground));
}

body.theme-thankyou-page .woocommerce-order-overview li strong {
	display: block;
	color: hsl(var(--foreground));
	font-weight: 600;
	margin-top: 0.25rem;
}

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

body.theme-thankyou-page .woocommerce-order-details table th,
body.theme-thankyou-page .woocommerce-order-details table td {
	text-align: left;
	padding: 0.75rem 0.5rem;
	border-bottom: 1px solid hsl(var(--border));
	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: 2rem;
}

body.theme-thankyou-page .woocommerce-customer-details address {
	max-width: 480px;
	overflow-wrap: break-word;
	font-style: normal;
	line-height: 1.7;
	font-size: 0.95rem;
}

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

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

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

.woocommerce-pagination ul li span.current,
.woocommerce-pagination ul li a:hover {
	background: 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.9rem;
	color: hsl(var(--muted-foreground));
}

.woocommerce-ordering select {
	border: 1px solid hsl(var(--border));
	border-radius: calc(var(--radius) - 2px);
	background: hsl(var(--background));
	padding: 0.5rem 0.75rem;
}

/* ---------- Star ratings ---------- */

.star-rating {
	color: hsl(var(--primary));
	font-size: 0.9rem;
}

/* ---------- Reviews form ---------- */

.theme-rating-star {
	background: none;
	border: 0;
	line-height: 0;
}

.theme-rating-star svg {
	color: hsl(var(--primary));
}

/* ---------- Generic content styling for page/post bodies ---------- */

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

.entry-content h3 {
	font-family: var(--font-accent);
	font-weight: 600;
	margin: 1.5rem 0 0.75rem;
}

.entry-content p {
	margin-bottom: 1rem;
	font-family: var(--font-body);
	line-height: 1.75;
}

.entry-content a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

.entry-content ul,
.entry-content ol {
	margin: 0 0 1rem 1.25rem;
	font-family: var(--font-body);
	line-height: 1.75;
}

.entry-content ul {
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius);
}

/* ---------- Forms generated by WordPress ---------- */

.theme-form-field,
.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="tel"],
.entry-content input[type="search"],
.entry-content textarea {
	display: block;
	width: 100%;
	border: 1px solid hsl(var(--field-border));
	border-radius: var(--field-radius);
	background: hsl(var(--field-bg));
	color: hsl(var(--field-text));
	padding: var(--field-padding);
	font-size: var(--field-font-size);
	font-family: var(--font-body);
}

/* ---------- Customizer preview safety ---------- */

.is-customizer .theme-product-card,
.is-customizer [data-shop-grid] > * {
	opacity: 1;
	transform: none;
}
