/* Design layer 4.0 of the storefront. Loaded last.
   1. tokens  2. typography  3. controls  4. cards and placeholder
   5. page blocks  6. motion  7. dark theme  8. reduced motion
   Rules of the system are described in docs/UX-AUDIT.md. */

/* 1. Tokens */
:root {
	--milk: #fbf9f3; --paper: #f4f1e6; --white: #fff; --sand: #ece7d3; --sage-soft: #e9efd9;
	--forest: #1f4a2c; --forest-2: #163820; --surface-inverse: #163820; --on-inverse: #f0f5e9; --sage: #5d9a2b; --lime: #9bd94a;
	--ink: #1d2a1a; --muted: #566150; --border: #dfe3cf;
	--danger: #b3261e; --danger-soft: #fbe5e2; --warn-soft: #fbf0c9; --ok-soft: #e2f1d2;
	--focus: #c2780c;
	--font-sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
	--radius-s: 10px; --radius: 18px; --radius-l: 28px;
	--shadow-1: 0 1px 2px rgb(22 56 32 / 6%), 0 6px 18px rgb(22 56 32 / 6%);
	--shadow-2: 0 2px 4px rgb(22 56 32 / 8%), 0 18px 40px rgb(22 56 32 / 12%);
	--shadow: var(--shadow-1);
	--t-fast: 160ms; --t-mid: 260ms; --t-slow: 420ms; --ease: cubic-bezier(.2, .7, .2, 1);
}
body.zl-site { background: var(--milk); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* 2. Typography */
.zl-site :is(h1, h2, .hero h1, .section-heading h2, .catalog-header h1, .page-header h1, .price-product-page__content h1, .finder h2, .consultation h2, .delivery-section h2) {
	font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.12; text-wrap: balance;
}
.zl-site .hero h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); }
.zl-site .hero h1 em { font-style: italic; color: var(--sage); }
.zl-site :is(.section-heading h2, .finder h2, .consultation h2, .delivery-section h2) { font-size: clamp(1.7rem, 3.2vw, 2.7rem); }
.zl-site :is(.catalog-header h1, .page-header h1) { font-size: clamp(1.9rem, 3.6vw, 3rem); }
.zl-site .price-product-page__content h1 { font-size: clamp(1.7rem, 3vw, 2.5rem); }
.zl-site h3 { font-family: var(--font-sans); font-weight: 650; }
.zl-site .eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); }
.zl-site .eyebrow--light { color: #d5efb0; }
.zl-site p { text-wrap: pretty; }
.zl-site .hero__copy > p { font-size: 1.06rem; color: var(--muted); max-width: 34em; }
.zl-site .hero__facts { font-size: .8rem; }
.zl-site .hero__facts strong { display: block; font-family: var(--font-display); font-size: 1.5rem; line-height: 1.2; color: var(--forest); }
.zl-site .latin-name { font-style: italic; color: var(--muted); }
.zl-site .latin-name--large { font-size: 1.1rem; }
.zl-site :is(.woocommerce-breadcrumb, .product-card__container, .stock, .woocommerce-result-count, .footer-bottom, .catalog-notice) { font-size: .84rem; }
.zl-site .prose { max-width: 46em; font-size: 1.04rem; }
.zl-site .prose :is(h2, h3) { margin-top: 1.6em; }
.zl-site .prose a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* 3. Controls: buttons, fields, focus, messages */
.zl-site :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.zl-site .button { min-height: 48px; padding: 12px 24px; gap: 10px; font-size: .95rem; font-weight: 650; letter-spacing: 0; border-radius: 999px; transition: transform var(--t-fast) var(--ease), background-color var(--t-fast) ease, box-shadow var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease; }
.zl-site .button--primary, .zl-site .button--primary:visited { color: #fff !important; background: var(--forest) !important; box-shadow: 0 1px 0 rgb(255 255 255 / 20%) inset, 0 6px 16px rgb(31 74 44 / 22%); }
.zl-site .button--primary:hover { background: var(--forest-2) !important; }
.zl-site .button--secondary { color: var(--forest); background: transparent; border: 1.5px solid var(--forest); }
.zl-site .button--secondary:hover { background: var(--sage-soft); }
.zl-site .button--terracotta { color: #2a1c02; }
.zl-site .button:active { transform: translateY(1px) scale(.985); }
.zl-site .button[aria-disabled="true"], .zl-site .button:disabled { cursor: progress; opacity: .75; }
.zl-site .button[aria-disabled="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ui-spin .7s linear infinite; }
.zl-site .button.is-added { background: var(--sage) !important; }
.zl-site .button.is-added::before { content: "✓"; font-weight: 800; animation: ui-pop var(--t-mid) var(--ease); }
.zl-site .icon-button { transition: background-color var(--t-fast) ease, transform var(--t-fast) var(--ease), border-color var(--t-fast) ease; }
.zl-site .icon-button:hover { transform: translateY(-1px); }
.zl-site :is(input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea) {
	min-height: 48px; padding: 11px 14px; border: 1.5px solid #c9cfb8; border-radius: var(--radius-s); background: var(--white); color: var(--ink); font: inherit; font-size: 1rem;
	transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
.zl-site :is(input, select, textarea):hover { border-color: #a9b394; }
.zl-site :is(input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea):focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 4px rgb(93 154 43 / 22%); }
.zl-site .site-search input { border-radius: 999px; padding-left: 46px; }
.zl-site .site-search::before { pointer-events: none; color: var(--muted); }
.zl-site input::placeholder { color: var(--muted); opacity: 1; }
.zl-site .form-field label { display: block; margin-bottom: 6px; font-weight: 650; font-size: .92rem; }
.zl-site .form-field__help { display: block; margin-top: 6px; color: var(--muted); font-size: .84rem; }
.zl-site .form-field--error :is(input, select, textarea) { border-color: var(--danger); background: var(--danger-soft); }
.zl-site .form-field__error { display: flex; gap: 6px; margin-top: 6px; color: var(--danger); font-weight: 650; font-size: .88rem; }
.zl-site .form-field__error::before { content: "!"; flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .75rem; }
.zl-site :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .catalog-notice) { border-radius: var(--radius-s); animation: ui-rise var(--t-slow) var(--ease) both; }
.zl-site .check-row input { width: 20px; height: 20px; accent-color: var(--forest); }
.zl-site a { transition: color var(--t-fast) ease, background-color var(--t-fast) ease, border-color var(--t-fast) ease; }
.zl-site :is(.category-pills a, .active-filters a, .page-numbers) { min-height: 44px; display: inline-flex; align-items: center; transition: background-color var(--t-fast) ease, border-color var(--t-fast) ease, color var(--t-fast) ease, transform var(--t-fast) var(--ease); }
.zl-site .category-pills a[aria-current], .zl-site .page-numbers.current { background: var(--forest); border-color: var(--forest); color: #fff; }
.zl-site .category-pills a:hover { border-color: var(--forest); transform: translateY(-1px); }
.zl-site .menu a { position: relative; }
.zl-site .primary-nav .menu > li > a[aria-current="page"] { font-weight: 700; }

/* 4. Cards and the photo placeholder */
.zl-site .product-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: none; transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) ease, border-color var(--t-mid) ease; }
.zl-site .product-card__media { display: block; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper); }
.zl-site .product-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease); }
.zl-site .product-card h3 { font-size: 1.06rem; line-height: 1.3; }
.zl-site .product-card h3 a { color: var(--ink); }
.zl-site .product-card .price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; color: var(--forest); }
.zl-site .stock { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--muted); }
.zl-site .stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #b9bfae; }
.zl-site .stock.is-available { color: #2f6b34; }
.zl-site .stock.is-available::before { background: var(--sage); }
.zl-site .product-card:focus-within { border-color: var(--forest); box-shadow: var(--shadow-1); }
@media (hover: hover) and (pointer: fine) {
	.zl-site .product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: #c9d6b2; }
	.zl-site .product-card:hover .product-card__media img { transform: scale(1.045); }
	.zl-site .product-card:hover .plant-placeholder svg { transform: translateY(-3px) rotate(-2deg); }
	.zl-site .category-card { transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) ease; }
	.zl-site .category-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
	.zl-site .button--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgb(31 74 44 / 26%); }
}
.plant-placeholder { position: relative; display: grid; place-items: center; align-content: center; gap: 10px; width: 100%; height: 100%; min-height: 150px; padding: 18px;
	background: radial-gradient(120% 90% at 85% 10%, #e3efcc 0, transparent 60%), linear-gradient(160deg, #f5f3e6, #eaf0db); color: #6f8a55; text-align: center; }
.plant-placeholder svg { width: clamp(54px, 32%, 96px); height: auto; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-mid) var(--ease); }
.zl-site .plant-placeholder .no-photo-label, .zl-site .price-product-page__media .plant-placeholder .no-photo-label { position: static; font-size: .78rem; font-weight: 650; letter-spacing: .04em; text-transform: none; color: #55693f; }
.zl-site .product-card--no-photo .product-card__media { background: none; }
.zl-site .price-product-page__media > .plant-placeholder { position: static; max-width: none; min-height: inherit; border-radius: inherit; }
.zl-site .price-product-page__media { border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--paper); }
.zl-site .price-product-page__media.has-photo img { transition: transform var(--t-slow) var(--ease); }

/* 5. Page blocks */
.zl-site .brand__logo { mix-blend-mode: multiply; }
[data-theme="dark"] .zl-site .brand__logo { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }
[data-theme="dark"] .zl-site .brand { background: transparent; }
.zl-site .announcement { background: var(--surface-inverse); color: var(--on-inverse); font-size: .82rem; }
.zl-site .site-header { background: rgb(251 249 243 / 92%); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border); }
.zl-site :is(.catalog-header, .page-header) { border-radius: var(--radius-l); }
.zl-site .catalog-header { background: linear-gradient(120deg, #eef3de, #f6f3e4); border: 1px solid var(--border); }
.zl-site .hero__image, .zl-site .catalog-header__image, .zl-site .delivery-section__photo { border-radius: var(--radius-l); }
.zl-site .single-price { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 600; color: var(--forest); }
.zl-site .product-specs { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--white); }
.zl-site .product-contact-note { padding: 12px 14px; border-left: 3px solid var(--sage); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--sage-soft); font-size: .92rem; }
.zl-site .qty { width: 92px; text-align: center; font-weight: 650; }
.zl-site .filters { background: var(--white); border: 1px solid var(--border); }
.zl-site .filter-group__title { font-weight: 700; font-size: .9rem; }
.zl-site .empty-state { padding: var(--space-7) var(--space-5); border: 1px dashed #c9cfb8; border-radius: var(--radius-l); background: var(--paper); text-align: center; }
.zl-site .advantages__grid article { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) ease; }
.zl-site .advantages__grid article > span { font-family: var(--font-display); font-size: 1.6rem; color: var(--sage); }
.zl-site .home-faq details { border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--white); transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.zl-site .home-faq details[open] { border-color: #c2d1a6; box-shadow: var(--shadow-1); }
.zl-site .home-faq summary { min-height: 52px; padding: 14px 48px 14px 18px; cursor: pointer; font-weight: 650; position: relative; list-style: none; }
.zl-site .home-faq summary::-webkit-details-marker { display: none; }
.zl-site .home-faq summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; margin-top: -8px; border-right: 2px solid var(--forest); border-bottom: 2px solid var(--forest); transform: rotate(45deg); transition: transform var(--t-mid) var(--ease); }
.zl-site .home-faq details[open] summary::after { transform: translateY(4px) rotate(-135deg); }
.zl-site .home-faq details > p { margin: 0; padding: 0 18px 16px; color: var(--muted); }
.zl-site details[open] > :not(summary) { animation: ui-open var(--t-mid) var(--ease); }
.zl-site .site-footer { background: var(--surface-inverse); }
.zl-site .site-footer h3, .zl-site .site-footer a:hover { color: var(--on-inverse); }
.zl-site .commerce-content table { width: 100%; border-collapse: collapse; }
.zl-site .commerce-content :is(th, td) { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.zl-site :is(.commerce-content, .cart-table-wrap, .prose) { overflow-wrap: anywhere; }
.zl-site .order-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper); font-size: .84rem; font-weight: 650; }
.zl-site .order-status--new { border-color: #e0a52a; background: var(--warn-soft); }
.zl-site .order-status--completed { background: var(--ok-soft); border-color: #b7d79a; }
.zl-site .order-status--cancelled { color: var(--muted); text-decoration: line-through; }
.zl-site .cart-count { transition: transform var(--t-fast) var(--ease); }
.zl-site .cart-count.is-bumped { animation: ui-bump 420ms var(--ease); }

/* toast: stays in the layout while hidden so that it can fade */
.zl-site .shop-toast { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; border-radius: 16px; background: var(--surface-inverse); box-shadow: var(--shadow-2); transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease), visibility 0s; }
.zl-site .shop-toast[hidden] { display: flex; visibility: hidden; opacity: 0; transform: translate(-50%, 14px); transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease), visibility 0s var(--t-mid); pointer-events: none; }
.zl-site .shop-toast a { color: #d5efb0; min-height: 32px; display: inline-flex; align-items: center; }

/* 6. Motion: panels and reveal */
.zl-site .filters { transition: transform var(--t-mid) var(--ease), visibility 0s var(--t-mid); }
.zl-site .filters.is-open { transition: transform var(--t-mid) var(--ease), visibility 0s; }
.filter-backdrop { transition: opacity var(--t-mid) ease; }
@media (max-width: 820px) {
	.zl-site .site-search { display: block; grid-column: 1 / -1; grid-row: 2; width: 100%; padding-bottom: 12px; }
	.zl-site .site-search::before { top: 24px; }
	.zl-site .primary-nav { transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease), visibility 0s var(--t-mid); transform: translateY(-8px); }
	.zl-site .primary-nav.is-open { transform: none; transition: opacity var(--t-mid) ease, transform var(--t-mid) var(--ease), visibility 0s; }
	.zl-site .menu-toggle span { transition: transform var(--t-mid) var(--ease), opacity var(--t-fast) ease; }
	.zl-site .button { min-height: 50px; }
	.zl-site .product-purchase-actions .button { width: 100%; }
}
.zl-site .catalog-panel { animation: ui-open var(--t-mid) var(--ease); }
.zl-site .search-suggestions:not([hidden]) { animation: ui-open var(--t-fast) var(--ease); }
/* .ui-reveal is added by ui.js only to blocks below the first screen, so nothing is hidden without scripts */
.ui-reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--t-slow) ease, transform var(--t-slow) var(--ease); transition-delay: calc(var(--ui-order, 0) * 55ms); }
.ui-reveal.is-revealed, .ui-reveal:focus-within { opacity: 1; transform: none; }
.zl-site .reveal { transition-duration: var(--t-slow); }

@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ui-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes ui-open { from { opacity: 0; transform: translateY(-6px); } }
@keyframes ui-bump { 30% { transform: scale(1.35); } 60% { transform: scale(.92); } }

/* 7. Dark theme */
html[data-theme="dark"] { --milk: #101410; --paper: #171c16; --white: #1b211a; --sand: #2a3324; --sage-soft: #223020; --forest: #bfe3a0; --forest-2: #d7edc2; --surface-inverse: #0c120d; --sage: #9ccf6a; --ink: #e8ede1; --muted: #b0bba6; --border: #333d2e; --danger: #ff9c94; --danger-soft: #3d1b19; --warn-soft: #3f3410; --ok-soft: #1f3320; --focus: #f0b84a;
	--shadow-1: 0 1px 2px rgb(0 0 0 / 40%); --shadow-2: 0 10px 30px rgb(0 0 0 / 45%); }
[data-theme="dark"] body.zl-site { background: var(--milk); }
[data-theme="dark"] .zl-site .site-header { background: rgb(16 20 16 / 92%); }
[data-theme="dark"] .zl-site .button--primary, [data-theme="dark"] .zl-site .button--primary:visited { color: #0d150e !important; background: #bfe3a0 !important; box-shadow: none; }
[data-theme="dark"] .zl-site .button--primary:hover { background: #d6f0bf !important; }
[data-theme="dark"] .zl-site .button--secondary { color: #d6f0bf; border-color: #7da35c; }
[data-theme="dark"] .zl-site :is(input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=search], select, textarea) { background: #141913; border-color: #46533e; color: var(--ink); }
[data-theme="dark"] .zl-site .catalog-header { background: linear-gradient(120deg, #1b2418, #171c16); }
[data-theme="dark"] .plant-placeholder { background: radial-gradient(120% 90% at 85% 10%, #26331f 0, transparent 60%), linear-gradient(160deg, #1a2018, #1f271b); color: #8fae72; }
[data-theme="dark"] .zl-site .plant-placeholder .no-photo-label { color: #a9c48f; }
[data-theme="dark"] .zl-site .product-card h3 a { color: var(--ink); }
[data-theme="dark"] .zl-site .stock.is-available { color: #a9d58a; }
[data-theme="dark"] .zl-site .category-pills a[aria-current], [data-theme="dark"] .zl-site .page-numbers.current { background: #bfe3a0; border-color: #bfe3a0; color: #0d150e; }
[data-theme="dark"] .zl-site .home-faq summary::after { border-color: #bfe3a0; }
[data-theme="dark"] .zl-site .shop-toast { background: #26331f; border: 1px solid #46533e; }
[data-theme="dark"] .zl-site .form-field__error::before { color: #2a0d0b; }
[data-theme="dark"] .zl-site .consultation h2 { color: var(--ink); }
[data-theme="dark"] .zl-site .consultation .button--ghost-light { color: var(--ink); }
[data-theme="dark"] .zl-site .order-status { color: var(--ink); }
[data-theme="dark"] .zl-site .form-field--error :is(input, select, textarea) { border-color: var(--danger); background: var(--danger-soft); }
@media (max-width: 640px) {
	.zl-site .footer-bottom { flex-direction: column; gap: 10px; }
}

/* 8. Reduced motion: no decorative movement, state changes stay instant and visible */
@media (prefers-reduced-motion: reduce) {
	.zl-site *, .zl-site *::before, .zl-site *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
	.ui-reveal, .zl-site .reveal { opacity: 1 !important; transform: none !important; }
	.zl-site .product-card:hover, .zl-site .category-card:hover, .zl-site .button:hover { transform: none !important; }
	.zl-site .product-card:hover .product-card__media img { transform: none; }
	.zl-site .button[aria-disabled="true"]::after { animation: none; border-right-color: currentColor; opacity: .5; }
}
