/* ==========================================================================
   GreenNest design system
   --------------------------------------------------------------------------
   Fluid, mobile-first, and responsive from 320px phones through 4:3 desktops
   to 21:9 ultrawide displays. Layout scales via fluid containers + auto-fit
   grids rather than fixed column counts, so no viewport is left with dead
   space or cramped content.

   Palette is unchanged from the original theme.

   Structure:
     1. Tokens
     2. Reset + typography
     3. Layout primitives (container, stack, cluster, page head)
     4. Header / nav / footer / ads / flashes
     5. Buttons
     6. Forms (incl. checkbox + radio components)
     7. Cards, tables, modals
     8. Storefront components
     9. Home page sections
    10. Auth
    11. Admin
    12. Animations
    13. Responsive tiers
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Greens */
  --green-950: #0c2a1a;
  --green-900: #123d27;
  --green-800: #185233;
  --green-700: #1f6b43;
  --green-600: #278552;
  --green-500: #2e9e60;
  --green-400: #52b97e;
  --green-300: #86d3a5;
  --green-200: #c3e6d0;   /* was referenced but never defined */
  --green-100: #e4f3ea;
  --green-50:  #f1f9f4;

  /* Warm accents */
  --amber-500: #e0902b;
  --amber-400: #f0a942;
  --terra-500: #d9663f;

  /* Neutrals */
  --sand: #f6f4ec;
  --cream: #fbfaf5;
  --header: #FBF7ED;
  --ink: #17241d;
  --muted: #5c6a63;
  --border: #dde6df;
  --white: #ffffff;

  /* Status */
  --danger: #c0392b;
  --danger-bg: #fdeeeb;
  --danger-border: #eaa593;
  --danger-ink: #a03027;
  --info-bg: #eef4fb;
  --info-border: #a9c6e6;

  /* Radii + depth */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(18, 61, 39, .06), 0 1px 3px rgba(18, 61, 39, .08);
  --shadow: 0 6px 18px rgba(18, 61, 39, .10);
  --shadow-lg: 0 18px 44px rgba(12, 42, 26, .18);
  --shadow-glow: 0 10px 30px rgba(46, 158, 96, .28);

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #123d27 0%, #1f6b43 45%, #2e9e60 100%);
  --grad-btn: linear-gradient(135deg, #2e9e60 0%, #1f6b43 100%);
  --grad-amber: linear-gradient(135deg, #f0a942 0%, #d9663f 100%);
  --grad-soft: linear-gradient(160deg, #f1f9f4 0%, #e4f3ea 100%);

  /* Fluid spacing + measure */
  --pad: clamp(1rem, 3vw, 2rem);
  --gap: clamp(1rem, 1.6vw, 1.5rem);
  --section-y: clamp(2rem, 5vw, 4.5rem);
  --maxw: 1400px;
  --maxw-narrow: 820px;
  --maxw-wide: 1760px;
  --measure: 68ch;

  /* Minimum card width — drives how many columns each grid gets */
  --card-min: 260px;

  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);

  --pattern-leaf:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.10) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.08) 0 2px, transparent 3px),
    radial-gradient(circle at 45% 85%, rgba(255,255,255,.06) 0 2px, transparent 3px);
}

/* --------------------------------------------------------------------------
   2. Reset + typography
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* The HTML `hidden` attribute must always win, regardless of any class rule
   that sets `display`. Without this, `.flash { display: flex }` keeps a
   `hidden` error box visible as an empty box showing just its ⚠️ pseudo-element. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

html, body { margin: 0; padding: 0; min-width: 320px; }
body { overflow-x: clip; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  line-height: 1.18;
  margin: 0 0 .5em;
  letter-spacing: -.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.85rem); }
h2 { font-size: clamp(1.4rem, 1.05rem + 1.3vw, 2.1rem); }
h3 { font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--green-700); text-decoration: none; transition: color .2s var(--ease); }
a:hover, a:focus-visible { color: var(--green-500); }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .88em; background: var(--green-50); padding: .1em .4em;
  border-radius: 5px; color: var(--green-800);
}

hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

:focus-visible { outline: 3px solid var(--green-400); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--green-200); color: var(--green-950); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: var(--pad); top: var(--pad); background: var(--white); padding: .6rem 1.1rem;
  z-index: 200; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  font-weight: 600;
}

/* Muted / helper text */
.text-muted { color: var(--muted); }
.text-sm { font-size: .88rem; }
.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.container-wide { max-width: var(--maxw-wide); }
.container-narrow { max-width: var(--maxw-narrow); }
.container-flush { padding-inline: 0; }

/* Vertical rhythm between page sections */
.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }

/* Section heading block */
.section-head { max-width: 640px; margin: 0 auto clamp(1.5rem, 3vw, 2.5rem); text-align: center; }
.section-head.align-start { text-align: left; margin-inline: 0; }
.section-head h1, .section-head h2 { margin-bottom: .35rem; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow {
  display: inline-block; text-transform: uppercase; letter-spacing: .14em;
  font-size: .74rem; font-weight: 700; color: var(--green-600);
  background: var(--green-100); padding: .32rem .85rem; border-radius: var(--radius-pill);
  margin-bottom: .85rem;
}
.eyebrow-invert { background: rgba(255,255,255,.16); color: #fff; }

/* Page header: title left, actions right, wraps on small screens */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-block: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 2vw, 1.5rem);
}
.page-head-text { min-width: 0; }
.page-head h1 { margin-bottom: .15rem; }
.page-head p { color: var(--muted); margin: 0; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Generic flex helpers */
.stack { display: flex; flex-direction: column; gap: .85rem; }
.stack-sm { gap: .5rem; }
.stack-lg { gap: 1.5rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.cluster-between { justify-content: space-between; }
.cluster-end { justify-content: flex-end; }
.spacer { flex: 1 1 auto; }

/* Breadcrumb */
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  color: var(--muted); font-size: .88rem;
  margin-block: clamp(1rem, 2vw, 1.5rem) .5rem;
}
.breadcrumb a { color: var(--green-700); }
.breadcrumb .sep { opacity: .5; }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 500; }

/* Auto-fit grid: the core responsive primitive. Column count derives from
   available width, so phones get 1, tablets 2-3, desktops 4, ultrawide 5-6. */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
}
.grid-narrow { --card-min: 200px; }
.grid-wide { --card-min: 320px; }
.grid-2 { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* Prose block for long-form copy */
.prose { max-width: var(--measure); margin-inline: auto; }
.prose.align-start { margin-inline: 0; }
.prose p { color: var(--ink); }
.prose > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. Header / nav / ads / flashes / footer
   -------------------------------------------------------------------------- */
.site-header {
  background: var(--header);
  color: var(--green-900);
  position: sticky; top: 0; z-index: 60;
  border-bottom: 1px solid rgba(18, 61, 39, .10);
  box-shadow: 0 2px 12px rgba(18, 61, 39, .06);
}
.header-inner {
  display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem);
  min-height: var(--header-h); padding-block: .6rem;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; flex: none; }
.brand-name {
  font-family: "Poppins", sans-serif; font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem);
  font-weight: 700; color: var(--green-900); letter-spacing: -.02em; white-space: nowrap;
}
.brand-name::before { content: "🌿"; margin-right: .35rem; }
.brand-logo { max-height: 44px; width: auto; }

/* Desktop nav sits inline; mobile nav becomes a dropdown sheet. */
.site-nav {
  display: flex; align-items: center; gap: clamp(.5rem, 1.2vw, 1.4rem);
  margin-left: auto; flex-wrap: wrap;
}
.site-nav a, .site-nav .link-button {
  color: var(--green-900); font-weight: 500; position: relative;
  padding: .45rem .1rem; white-space: nowrap; font-size: .95rem;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: .18rem;
  height: 2px; background: var(--green-600); border-radius: 2px;
  transition: right .25s var(--ease);
}
.site-nav a:hover::after, .site-nav a:focus-visible::after { right: 0; }
.site-nav a:hover, .site-nav .link-button:hover { color: var(--green-600); }
.site-nav a[aria-current="page"] { color: var(--green-600); font-weight: 600; }
.site-nav a[aria-current="page"]::after { right: 0; }

/* Nav items that carry a count badge */
.nav-notif, .nav-cart { display: inline-flex; align-items: center; gap: .3rem; }
.notif-badge, .cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  font-size: .7rem; font-weight: 700; line-height: 1;
  background: var(--amber-500); color: #fff; border-radius: var(--radius-pill);
}
.cart-badge { background: var(--green-600); }

.nav-toggle {
  display: none; margin-left: auto; flex: none;
  background: var(--green-700); color: #fff;
  border: 1px solid var(--green-800); border-radius: var(--radius-sm);
  font-size: 1.1rem; width: 44px; height: 44px; min-height: 44px; padding: 0;
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle::after { content: none; }

.inline-form { display: inline; margin: 0; }
.link-button {
  background: none; border: none; color: var(--green-900); cursor: pointer;
  font: inherit; font-weight: 500; padding: .45rem .1rem; min-height: auto;
  box-shadow: none;
}
.link-button::after { content: none; }
.link-button:hover { color: var(--green-600); background: none; box-shadow: none; filter: none; }

/* Sitewide ad banner */
.site-ad {
  background: var(--grad-amber); color: #fff; padding-block: .6rem;
  text-align: center; font-weight: 500;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
}
.site-ad img { margin-inline: auto; max-height: 120px; border-radius: var(--radius-sm); }
.site-ad a { color: #fff; text-decoration: underline; font-weight: 600; }

/* Flash messages */
.flashes { list-style: none; padding: 0; margin-block: clamp(1rem, 2vw, 1.5rem); }
.flash {
  padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: .5rem;
  border: 1px solid var(--border); background: var(--white); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: .6rem; animation: fade-up .3s var(--ease);
}
.flash::before { font-size: 1.05rem; flex: none; }
.flash-success { background: var(--green-50); border-color: var(--green-300); }
.flash-success::before { content: "✅"; }
.flash-error { background: var(--danger-bg); border-color: var(--danger-border); }
.flash-error::before { content: "⚠️"; }
.flash-info { background: var(--info-bg); border-color: var(--info-border); }
.flash-info::before { content: "ℹ️"; }

/* Footer */
.site-footer {
  background: var(--green-950); color: #cfe3d6; margin-top: var(--section-y);
  padding-block: clamp(2rem, 4vw, 3.5rem) 1.5rem; position: relative;
}
.site-footer::before {
  content: ""; position: absolute; inset: 0; background-image: var(--pattern-leaf);
  background-size: 200px 200px; opacity: .4; pointer-events: none;
}
.footer-inner {
  position: relative; z-index: 1;
  display: grid; gap: clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.footer-brand { max-width: 42ch; }
.footer-brand .brand-name { color: #fff; }
.footer-tagline { margin-top: .75rem; color: #b9d5c4; }
.footer-col h4 { color: #fff; margin-bottom: .75rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.footer-inner a { color: #a9d2ba; }
.footer-inner a:hover { color: #fff; }
.newsletter-form { margin-top: 1.25rem; }
.newsletter-form label { color: #eaf5ee; }
.newsletter-row { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 420px; }
.newsletter-row input { flex: 1 1 190px; min-width: 0; }
.newsletter-row button { flex: none; }
.footer-bottom {
  position: relative; z-index: 1; margin-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,.12);
}
.copyright { color: #7ea88e; font-size: .85rem; margin: 0; }

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--grad-btn); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: .6rem 1.15rem;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  cursor: pointer; min-height: 44px; position: relative; overflow: hidden;
  text-align: center; box-shadow: var(--shadow-sm); white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
button:hover, .btn:hover { box-shadow: var(--shadow); filter: brightness(1.05); color: #fff; }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled, button[aria-disabled="true"] {
  opacity: .55; cursor: not-allowed; filter: none; box-shadow: none; transform: none;
}
/* Sheen sweep */
button::after, .btn::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg); transition: left .6s var(--ease); pointer-events: none;
}
button:hover::after, .btn:hover::after { left: 140%; }
button:disabled::after, .btn:disabled::after { content: none; }

.btn-secondary {
  background: var(--white); color: var(--green-700);
  border: 1.5px solid var(--green-500); box-shadow: none;
}
.btn-secondary:hover { background: var(--green-50); color: var(--green-800); }
.btn-ghost {
  background: transparent; color: var(--green-700); border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--green-50); border-color: var(--green-300); color: var(--green-800); }
.btn-amber { background: var(--grad-amber); }
.btn-danger { background: linear-gradient(135deg, #e06552 0%, #b83224 100%); }
.btn-block { width: 100%; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1rem; min-height: 50px; }
.btn-sm { min-height: 38px; padding: .35rem .85rem; font-size: .87rem; }
.btn-icon { width: 44px; padding: 0; flex: none; }

/* Icon-only circular control (modal close, panel close) */
.btn-round {
  width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%;
  background: var(--green-50); color: var(--ink); box-shadow: none; flex: none;
  font-size: .95rem;
}
.btn-round:hover { background: var(--green-100); filter: none; box-shadow: none; }
.btn-round::after { content: none; }

/* --------------------------------------------------------------------------
   6. Forms
   --------------------------------------------------------------------------
   Text-like inputs stretch to fill their field. Checkboxes and radios are
   explicitly excluded from that rule (they are fixed-size boxes that sit
   inline with their label) — this is what the old `input { width: 100% }`
   blanket rule got wrong.
   -------------------------------------------------------------------------- */
input, textarea, select { font: inherit; color: var(--ink); }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea,
select {
  width: 100%;
  padding: .7rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 46px;
  background: var(--white);
  transition: border-color .18s, box-shadow .18s;
}
textarea { line-height: 1.6; resize: vertical; }

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus, select:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 4px rgba(46, 158, 96, .15);
}
input::placeholder, textarea::placeholder { color: #93a29a; }
input:disabled, textarea:disabled, select:disabled {
  background: var(--green-50); color: var(--muted); cursor: not-allowed;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235c6a63' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.4rem;
}

/* Native checkbox / radio: accent-coloured, comfortably sized, never stretched */
input[type="checkbox"], input[type="radio"] {
  width: 1.15rem; height: 1.15rem; min-height: 0; flex: none; margin: 0;
  accent-color: var(--green-600); cursor: pointer;
}

label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .93rem; }

.field { margin-bottom: 1rem; }
.field > label { margin-bottom: .35rem; }
.field-hint { font-size: .82rem; color: var(--muted); margin: .35rem 0 0; font-weight: 400; }
.field-error, .error { color: var(--danger); font-size: .86rem; margin: .35rem 0 0; font-weight: 500; }
.field-optional { color: var(--muted); font-weight: 400; font-size: .85em; }

/* Label + control on one row, label above (default) */
.form-grid {
  display: grid; gap: 0 var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.form-grid .field-full { grid-column: 1 / -1; }
/* Legacy two-up row, now fluid */
.form-row {
  display: grid; gap: 0 var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

/* Fieldset styled as a labelled group */
.field-group { border: none; padding: 0; margin: 0 0 1rem; }
.field-group > legend, .field-legend {
  font-weight: 600; font-size: .93rem; margin-bottom: .5rem; padding: 0; display: block;
}

/* ── Checkbox / radio as a clickable row ───────────────────────────────────
   Used for standalone booleans. The whole row is the hit target (≥44px),
   the box sits left, the text block sits right. */
.check {
  display: grid; grid-template-columns: auto 1fr; align-items: start;
  gap: .7rem; cursor: pointer; margin: 0;
  font-weight: 500; font-size: .95rem; line-height: 1.45;
}
.check input[type="checkbox"], .check input[type="radio"] { margin-top: .18rem; }
.check .check-text { min-width: 0; }
.check .check-title { display: block; font-weight: 600; }
.check .check-hint { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; margin-top: .1rem; }
.check:hover .check-title { color: var(--green-700); }

/* Boxed variant: reads as a distinct, tappable setting card */
.check-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: .85rem 1rem; background: var(--white); min-height: 44px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.check-card:hover { border-color: var(--green-300); background: var(--green-50); }
.check-card:has(input:checked) {
  border-color: var(--green-500); background: var(--green-50);
  box-shadow: 0 0 0 3px rgba(46, 158, 96, .12);
}
.check-card:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,158,96,.15); }

/* Inline row of checkboxes/radios */
.check-list { display: grid; gap: .6rem; }
.check-row { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; min-height: 32px; }
.check-row input { flex: none; }
/* Back-compat alias for the old class name */
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; min-height: 32px; }
.checkbox-row input { width: auto; min-height: auto; flex: none; }

/* Switch-style toggle for prominent on/off settings */
.switch { display: flex; align-items: center; gap: .75rem; cursor: pointer; margin: 0; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .switch-track {
  position: relative; flex: none; width: 46px; height: 26px; border-radius: var(--radius-pill);
  background: #cbd5ce; transition: background .2s var(--ease);
}
.switch .switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--green-500); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--green-300); outline-offset: 2px; }
.switch .switch-text { min-width: 0; }
.switch .switch-title { display: block; font-weight: 600; font-size: .95rem; }
.switch .switch-hint { display: block; font-size: .82rem; color: var(--muted); font-weight: 400; }

/* Form footer: actions aligned, separated from the fields */
.form-actions {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.form-actions.no-rule { border-top: none; padding-top: 0; margin-top: 1rem; }
.form-actions .spacer { flex: 1 1 auto; }

/* `.stack` inside forms keeps a tighter default */
form.stack .field { margin-bottom: .35rem; }

/* --------------------------------------------------------------------------
   7. Cards, panels, tables, modals
   -------------------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1.1rem, 2vw, 1.6rem);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--gap); }
.card-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: 1.1rem; padding-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
.card-head h2, .card-head h3 { margin: 0; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); }
.card-head p { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.card-head-text { min-width: 0; }
.card-body > :last-child { margin-bottom: 0; }
.card-muted { background: var(--grad-soft); }
.card.unread { border-left: 4px solid var(--green-500); }
.mini-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--white); }

/* Collapsible section built on <details> */
details.panel {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
details.panel + details.panel, details.panel + .card, .card + details.panel { margin-top: var(--gap); }
details.panel > summary {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: 1rem clamp(1.1rem, 2vw, 1.6rem); font-weight: 600; color: var(--green-800);
  list-style: none; min-height: 52px; transition: background .18s;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary:hover { background: var(--green-50); }
details.panel > summary::after {
  content: "＋"; margin-left: auto; font-size: 1.1rem; color: var(--green-600);
  transition: transform .2s var(--ease); flex: none;
}
details.panel[open] > summary::after { content: "－"; }
details.panel[open] > summary { border-bottom: 1px solid var(--border); background: var(--green-50); }
details.panel > .panel-body { padding: clamp(1.1rem, 2vw, 1.6rem); }

/* Stat tiles */
.stat-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.stat-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: .9rem;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm); flex: none;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--green-100); color: var(--green-700);
}
.stat-card .stat-value {
  display: block; font-family: "Poppins", sans-serif; font-weight: 700;
  font-size: clamp(1.3rem, 1.1rem + .7vw, 1.75rem); line-height: 1.1; color: var(--green-900);
}
.stat-card .stat-label { display: block; color: var(--muted); font-size: .85rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600;
  padding: .28rem .65rem; border-radius: var(--radius-pill);
  background: var(--green-100); color: var(--green-800); width: fit-content;
  white-space: nowrap;
}
.badge-out { background: var(--danger-bg); color: var(--danger-ink); }
.badge-sale { background: var(--grad-amber); color: #fff; }
.badge-info { background: var(--info-bg); color: #2c5d92; }
.badge-neutral { background: var(--green-50); color: var(--muted); }

/* Empty states */
.empty-state {
  color: var(--muted); padding: clamp(1.75rem, 4vw, 3rem) 1.5rem; text-align: center;
  background: var(--grad-soft); border: 1px dashed var(--green-300);
  border-radius: var(--radius);
}
.empty-state .icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: .25rem; }
td.empty-state, .empty-state-cell { background: none; border: none; }

/* Media / image placeholder.
   Product photos are taken out of normal flow and cropped to the frame so a
   landscape shot and a portrait shot occupy the same square. */
.media { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--green-50); }
.media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  max-width: none; object-fit: cover; object-position: center;
}
.media-square { aspect-ratio: 1 / 1; }
.media-4x3 { aspect-ratio: 4 / 3; }
.media-16x9 { aspect-ratio: 16 / 9; }
.img-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .4rem; text-align: center; padding: 1rem;
  background:
    repeating-linear-gradient(45deg, rgba(46,158,96,.06) 0 12px, rgba(46,158,96,.12) 12px 24px),
    var(--grad-soft);
  color: var(--green-700); border: 2px dashed var(--green-300);
  border-radius: var(--radius); min-height: 180px; font-size: .85rem;
}
.img-ph .icon { font-size: 1.8rem; }
.img-ph .dim { color: var(--muted); font-size: .75rem; }

/* Tables: scroll horizontally on narrow screens without breaking layout */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--white); box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th {
  background: var(--green-50); color: var(--green-800); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap;
}
tbody tr { transition: background .15s; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--green-50); }
tfoot th, tfoot td { background: var(--green-50); font-weight: 700; border-bottom: none; }
.table-compact th, .table-compact td { padding: .55rem .75rem; }
.nowrap { white-space: nowrap; }
.actions-cell { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
/* Right-align numeric columns for scannability */
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Thumbnails inside tables */
.thumb {
  width: 52px; height: 52px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--green-50); flex: none;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; font-size: 1.3rem; }
.thumb-strip { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.thumb-strip .thumb { width: 72px; height: 72px; }
/* Product identity cell: thumb + name stacked sensibly */
.cell-media { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.cell-media .cell-text { min-width: 0; }
.cell-media strong { display: block; }

/* Modals */
.modal {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; padding: var(--pad);
  background: rgba(12, 42, 26, .55); backdrop-filter: blur(3px);
  animation: fade-in .18s var(--ease);
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  width: 100%; max-width: 540px; max-height: min(88vh, 900px); overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: fade-up .25s var(--ease);
}
.modal-card-lg { max-width: 760px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1.2rem; }
.modal-close {
  background: var(--green-50); color: var(--ink); border: none; cursor: pointer;
  width: 34px; height: 34px; min-height: 34px; border-radius: 50%; padding: 0;
  font-size: .95rem; box-shadow: none; flex: none;
}
.modal-close::after { content: none; }
.modal-close:hover { background: var(--green-100); transform: none; filter: none; }

/* Timeline (order tracking history) */
.timeline { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .4rem; }
.timeline li {
  padding: .6rem .85rem; border-left: 3px solid var(--green-400);
  background: var(--green-50); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.timeline .ts { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* --------------------------------------------------------------------------
   8. Storefront components
   -------------------------------------------------------------------------- */

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative; color: #fff; border-radius: var(--radius-lg);
  background: var(--grad-hero); overflow: hidden;
  margin-block: clamp(1.25rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-lg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; background-image: var(--pattern-leaf);
  background-size: 180px 180px; opacity: .7; pointer-events: none;
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(1.75rem, 4vw, 3.75rem); align-items: center;
}
.hero-copy { min-width: 0; }
.hero-copy h1, .hero-copy h2 { color: #fff; }
.hero-copy p { color: rgba(255,255,255,.9); font-size: clamp(1rem, .95rem + .3vw, 1.1rem); max-width: 52ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-actions .btn-on-dark {
  background: rgba(255,255,255,.14); color: #fff; border: 1.5px solid rgba(255,255,255,.45);
  backdrop-filter: blur(4px);
}
.hero-actions .btn-on-dark:hover { background: rgba(255,255,255,.24); color: #fff; }
.hero-media {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 3;
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media .img-ph {
  min-height: 100%; height: 100%; border-color: rgba(255,255,255,.5); color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 12px, rgba(255,255,255,.14) 12px 24px),
    rgba(255,255,255,.06);
}
.hero-media .img-ph .dim { color: rgba(255,255,255,.8); }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(1rem, 3vw, 2.5rem); margin-top: 1.75rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stats .stat strong {
  display: block; font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem);
  font-family: "Poppins", sans-serif;
}
.hero-stats .stat span { color: rgba(255,255,255,.8); font-size: .85rem; }
/* Centered CTA variant */
.hero-centered .hero-inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.hero-centered .hero-copy p { margin-inline: auto; }
.hero-centered .hero-actions { justify-content: center; }

/* ── Feature strip ──────────────────────────────────────────────────────── */
.features {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin-block: clamp(1.25rem, 2.5vw, 2rem);
}
.feature {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: 1.15rem 1.25rem; background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .fi { font-size: 1.55rem; line-height: 1; flex: none; color: var(--green-600); }
.feature h3 { font-size: 1rem; margin: 0 0 .2rem; }
.feature p { margin: 0; color: var(--muted); font-size: .89rem; }

/* ── Product card ───────────────────────────────────────────────────────── */
.product-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
  display: flex; flex-direction: column; position: relative;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--green-200); }
.product-card > a:first-of-type { position: relative; display: block; }
.product-card .media, .product-card .img-ph { border-radius: 0; aspect-ratio: 1 / 1; min-height: 0; }
.product-card .media img { transition: transform .5s var(--ease); }
.product-card:hover .media img { transform: scale(1.06); }
.product-card .body {
  padding: .95rem 1.05rem 1.15rem; display: flex; flex-direction: column;
  gap: .45rem; flex: 1; min-width: 0;
}
.product-card h3 { font-size: 1.02rem; margin: 0; line-height: 1.35; }
.product-card h3 a { color: var(--ink); }
.product-card h3 a:hover { color: var(--green-600); }
.product-card .body > .price { margin: 0; }
/* Push actions to the bottom so cards in a row align */
.product-card .card-actions { margin-top: auto; padding-top: .35rem; }
.card-overlay { position: absolute; top: .65rem; left: .65rem; z-index: 2; }
.card-overlay-right { left: auto; right: .65rem; }

.price { font-weight: 700; color: var(--green-900); font-size: 1.15rem; }
.price .per-kg {
  font-weight: 600; font-size: .72em; color: var(--muted); margin-left: .2rem;
  letter-spacing: 0;
}
.qty-with-unit { display: flex; align-items: center; gap: .45rem; }
.qty-unit { font-size: .82rem; font-weight: 700; color: var(--muted); }
.price .original {
  text-decoration: line-through; color: var(--muted); font-weight: 400;
  margin-right: .45rem; font-size: .9rem;
}

.card-pot-note { font-size: .78rem; color: var(--muted); margin: 0; }
.card-actions { display: flex; flex-direction: column; gap: .5rem; }
.card-action-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.card-action-btns .inline-form { display: block; }
.card-action-btns .btn-sm { width: 100%; padding: .4rem .5rem; }

/* Blog card variant */
.blog-card .media, .blog-card .img-ph { aspect-ratio: 16 / 10; }
.blog-excerpt { color: var(--muted); font-size: .87rem; margin: 0; }
.read-more { font-size: .87rem; font-weight: 600; margin-top: auto; padding-top: .35rem; }
.card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.mini-tag {
  font-size: .68rem; font-weight: 600; padding: .14rem .5rem; border-radius: var(--radius-pill);
  background: var(--green-100); color: var(--green-800);
}

/* ── Category tiles ─────────────────────────────────────────────────────── */
.categories-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.category-tile {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-end; color: #fff;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.category-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: #fff; }
.category-tile .tile-media { position: absolute; inset: 0; }
.category-tile .tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.category-tile:hover .tile-media img { transform: scale(1.07); }
.category-tile .tile-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.5rem;
  background: var(--grad-soft);
}
.category-tile .img-ph { position: absolute; inset: 0; border-radius: 0; min-height: 0; }
.category-tile .label {
  position: relative; z-index: 2; padding: 1rem; width: 100%;
  font-weight: 700; font-family: "Poppins", sans-serif;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
  background: linear-gradient(to top, rgba(12,42,26,.82), rgba(12,42,26,.25) 60%, transparent);
}
.category-tile .label small { display: block; font-weight: 500; font-size: .78rem; opacity: .85; }

/* ── Testimonials ───────────────────────────────────────────────────────── */
.testimonial {
  background: var(--white); border-radius: var(--radius); padding: 1.6rem 1.5rem 1.25rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm); position: relative;
  margin: 0; display: flex; flex-direction: column; gap: .75rem;
}
.testimonial::before {
  content: "\201C"; position: absolute; top: .1rem; left: .7rem; font-size: 3.5rem;
  color: var(--green-300); font-family: Georgia, serif; line-height: 1;
}
.testimonial p { position: relative; font-style: italic; margin: 0; flex: 1; }
.testimonial footer {
  font-weight: 600; color: var(--green-700); display: flex; align-items: center; gap: .6rem;
}
.testimonial .avatar {
  width: 42px; height: 42px; border-radius: 50%; background: var(--grad-btn); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex: none;
}

/* ── Search bar ─────────────────────────────────────────────────────────── */
.search-hero { margin-block: 0 var(--gap); }
.search-hero-inner {
  display: flex; align-items: center; gap: .4rem;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: .4rem; transition: border-color .2s, box-shadow .2s;
}
.search-hero-inner:focus-within {
  border-color: var(--green-500); box-shadow: 0 4px 20px rgba(46,158,96,.18);
}
.search-hero-icon {
  flex: none; color: var(--muted); display: grid; place-items: center;
  padding-inline: .35rem; pointer-events: none;
}
.search-hero-input {
  flex: 1 1 140px; min-width: 0; border: none !important; background: transparent;
  font-size: 1rem; min-height: 42px; padding: 0 .2rem; box-shadow: none !important;
}
.search-hero-input:focus { outline: none; }
.search-hero-submit { flex: none; min-height: 42px; }
.filter-toggle {
  flex: none; width: 42px; height: 42px; min-height: 42px; padding: 0;
  border-radius: var(--radius-sm); background: var(--green-50); color: var(--green-700);
  border: 1.5px solid var(--green-200); box-shadow: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.filter-toggle:hover { background: var(--green-100); box-shadow: none; filter: none; }
.filter-toggle::after { content: none; }
.filter-toggle[aria-expanded="true"] { background: var(--green-100); border-color: var(--green-500); }

/* Active filter chips */
.search-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: var(--gap); }
.search-chip {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--green-100); color: var(--green-800);
  padding: .3rem .75rem; border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 500;
}
a.search-chip:hover { background: var(--green-200); color: var(--green-900); }

/* Category pills */
.category-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: var(--gap); }
.category-pill {
  display: inline-block; padding: .45rem 1rem; border-radius: var(--radius-pill);
  background: var(--white); border: 1.5px solid var(--border); color: var(--green-800);
  font-size: .9rem; font-weight: 500; transition: all .18s var(--ease);
}
.category-pill:hover { border-color: var(--green-500); background: var(--green-50); color: var(--green-800); }
.category-pill.active { background: var(--grad-btn); color: #fff; border-color: transparent; }

/* ── Shop layout: sidebar filters + results ─────────────────────────────── */
.shop-layout {
  display: grid; grid-template-columns: minmax(240px, 270px) 1fr;
  gap: clamp(1.25rem, 2.5vw, 2.25rem); align-items: start;
  margin-bottom: var(--section-y);
}
.shop-layout.filters-collapsed { grid-template-columns: 1fr; }
.shop-layout.filters-collapsed .filter-panel { display: none; }
.shop-main { min-width: 0; }
.results-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: var(--gap);
}
.results-count { color: var(--muted); font-size: .9rem; margin: 0; }

.filter-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
  position: sticky; top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto;
}
.filter-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: 1.1rem; padding-bottom: .85rem; border-bottom: 1px solid var(--border);
}
.filter-panel-head h2 { margin: 0; font-size: 1.1rem; }
.filter-close {
  background: var(--green-50); color: var(--ink); border: none; cursor: pointer;
  width: 32px; height: 32px; min-height: 32px; border-radius: 50%; padding: 0;
  font-size: .85rem; box-shadow: none; flex: none;
}
.filter-close::after { content: none; }
.filter-close:hover { background: var(--green-100); filter: none; }
.filter-group { margin-bottom: 1.35rem; }
.filter-group:last-of-type { margin-bottom: 1rem; }
.filter-group > label, .filter-group .filter-legend {
  display: block; font-weight: 600; font-size: .9rem; margin-bottom: .6rem;
}
.filter-actions { display: grid; gap: .5rem; }
.filter-form { display: block; }
.filter-backdrop { position: fixed; inset: 0; background: rgba(12,42,26,.45); z-index: 90; border: none; }

/* Results grid on shop/blog — inherits .grid; named for page-specific tweaks. */
.shop-grid { margin-bottom: var(--gap); }

/* Price range slider */
.price-slider { padding-bottom: .25rem; }
.price-slider .price-values {
  display: flex; justify-content: space-between; font-size: .85rem;
  color: var(--green-800); font-weight: 600; margin-bottom: .5rem;
}
.range-wrap { position: relative; height: 34px; }
.range-wrap input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; margin: 0; background: none;
  pointer-events: none; -webkit-appearance: none; appearance: none; height: 34px; min-height: 0;
}
.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-600); border: 2px solid #fff; box-shadow: var(--shadow-sm);
  cursor: pointer; pointer-events: auto; margin-top: -8px;
}
.range-wrap input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--green-600);
  border: 2px solid #fff; cursor: pointer; pointer-events: auto;
}
.range-wrap .range-track {
  position: absolute; left: 0; right: 0; top: 15px; height: 4px;
  border-radius: 2px; background: var(--border);
}
.range-wrap .range-fill {
  position: absolute; top: 15px; height: 4px; border-radius: 2px; background: var(--green-500);
}

/* Tag chips as a multi-select */
.tag-multiselect { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag-chip { cursor: pointer; margin: 0; font-weight: 400; }
.tag-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tag-chip > span {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .38rem .8rem; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: var(--white);
  font-size: .85rem; color: var(--green-800); transition: all .15s var(--ease);
}
.tag-chip:hover > span { border-color: var(--green-300); background: var(--green-50); }
.tag-chip input:checked + span { background: var(--grad-btn); color: #fff; border-color: transparent; }
.tag-chip input:focus-visible + span { outline: 3px solid var(--green-300); outline-offset: 2px; }

/* ── Product detail ─────────────────────────────────────────────────────── */
.product-detail { margin-bottom: var(--section-y); }
.product-layout {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 3vw, 3rem);
  align-items: start;
}
.product-gallery { min-width: 0; }
.gallery { display: grid; gap: .75rem; }
.gallery .media, .gallery .img-ph { aspect-ratio: 1 / 1; min-height: 0; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.gallery-thumbs .media, .gallery-thumbs .img-ph { aspect-ratio: 1 / 1; min-height: 0; }
.product-info { min-width: 0; }
.product-info h1 { margin-bottom: .5rem; }
.product-info .price { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.85rem); margin: .5rem 0; }
.product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.rating-row { display: flex; align-items: center; gap: .5rem; }
.stars { color: var(--amber-500); letter-spacing: 2px; }
.product-description { margin: 1.25rem 0; color: var(--muted); }
.stock-note { color: var(--green-700); font-weight: 600; margin: .5rem 0 .25rem; font-size: .9rem; }
.product-buy {
  margin-block: 1.25rem; padding: 1.25rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--green-50);
}
.product-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1rem; }
.product-actions .inline-form { display: block; }
.review-card { border-left: 3px solid var(--green-400); }

/* Pot selection */
.pot-select { margin-bottom: 1.1rem; }
.pot-select .pot-label-hd { font-weight: 600; margin-bottom: .5rem; display: block; font-size: .93rem; }
.pot-options { display: flex; flex-wrap: wrap; gap: .5rem; }
.pot-option { cursor: pointer; margin: 0; }
.pot-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pot-swatch {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .15s, box-shadow .15s; min-height: 44px;
}
.pot-option:hover .pot-swatch { border-color: var(--green-300); }
.pot-option input:checked + .pot-swatch {
  border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(46,158,96,.15);
}
.pot-option input:focus-visible + .pot-swatch { outline: 3px solid var(--green-300); outline-offset: 2px; }
.pot-swatch .dot {
  width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15);
  flex: none; background: var(--green-300);
}
.pot-swatch .pot-name { font-size: .88rem; font-weight: 500; }
.pot-swatch img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; flex: none; }

/* Quantity selector */
.qty-selector {
  display: inline-flex; align-items: stretch; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; background: var(--white); width: fit-content;
}
.qty-selector .qty-btn {
  background: var(--green-50); color: var(--green-800); border: none; cursor: pointer;
  width: 44px; min-height: 44px; font-size: 1.2rem; line-height: 1; padding: 0;
  box-shadow: none; border-radius: 0;
}
.qty-selector .qty-btn::after { content: none; }
.qty-selector .qty-btn:hover { background: var(--green-100); transform: none; filter: none; }
.qty-selector .qty-btn:disabled { opacity: .4; cursor: not-allowed; }
.qty-selector .qty-input {
  width: 58px; text-align: center; border: none;
  border-inline: 1.5px solid var(--border); min-height: 44px; border-radius: 0;
  font-weight: 600; -moz-appearance: textfield; padding: 0;
}
.qty-selector .qty-input::-webkit-outer-spin-button,
.qty-selector .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-selector .qty-input:focus { box-shadow: none; outline: none; }
.qty-selector-sm .qty-btn { width: 34px; min-height: 36px; font-size: 1rem; }
.qty-selector-sm .qty-input { width: 44px; min-height: 36px; }

/* Cart */
.cart-layout {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 2.5vw, 2rem);
  align-items: start; margin-bottom: var(--section-y);
}
.cart-qty-form { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cart-update-btn { white-space: nowrap; }
.cart-pot { display: block; font-size: .8rem; color: var(--muted); margin-top: .15rem; }
.cart-summary { position: sticky; top: calc(var(--header-h) + 1rem); }
.summary-row {
  display: flex; justify-content: space-between; gap: 1rem; padding-block: .5rem;
  font-size: .93rem;
}
.summary-row .label { color: var(--muted); }
.summary-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-top: .5rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.summary-total .amount {
  font-size: clamp(1.3rem, 1.1rem + .6vw, 1.6rem); font-weight: 700;
  color: var(--green-900); font-family: "Poppins", sans-serif;
}

/* Notifications list */
.notification-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.notification-item { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.notification-item .n-body { min-width: 0; flex: 1 1 260px; }
.notification-item .n-title { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* Blog article */
.article { max-width: var(--maxw-narrow); margin-inline: auto; margin-bottom: var(--section-y); }
.article-hero { margin-block: 1.25rem; border-radius: var(--radius); overflow: hidden; aspect-ratio: 2 / 1; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; }
.article-body { line-height: 1.85; }
.article-body p { margin-bottom: 1.15rem; }

/* --------------------------------------------------------------------------
   9. Home page sections
   (previously inline <style> in home.html — now part of the design system)
   -------------------------------------------------------------------------- */

/* ── About split ────────────────────────────────────────────────────────── */
.about-split {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.about-split-media { border-radius: var(--radius-lg); overflow: hidden; position: relative; aspect-ratio: 4 / 3; min-height: 240px; }
.about-split-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.about-split-body { min-width: 0; }
.about-split-body .rule { width: 2px; height: 38px; background: var(--green-800); margin-block: 1.5rem; }
.about-split-body p { color: var(--muted); }

/* Outline CTA used in the about split */
.btn-outline-dark {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .65rem 1.35rem; border: 1.5px solid var(--green-800);
  background: transparent; color: var(--green-800);
  font-size: .92rem; font-weight: 600; border-radius: var(--radius-sm);
  box-shadow: none; transition: background .18s var(--ease), color .18s var(--ease);
}
.btn-outline-dark::after { content: none; }
.btn-outline-dark:hover { background: var(--green-800); color: #fff; filter: none; }

/* ── Editorial collection mosaic ────────────────────────────────────────── */
.collection-mosaic {
  display: grid; gap: var(--gap);
  grid-template-columns: 1fr;
}
.col-card {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--sand); padding: clamp(1.25rem, 2.5vw, 1.9rem);
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 230px; isolation: isolate;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
}
.col-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.col-card > * { position: relative; z-index: 2; }
.col-card .col-subtitle { font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.col-card .col-title {
  font-size: clamp(1.15rem, 1rem + .7vw, 1.55rem); font-weight: 700;
  color: var(--ink); margin-bottom: 1.1rem; line-height: 1.2; max-width: 16ch;
}
.col-card .bg-img {
  position: absolute; z-index: 0; pointer-events: none;
  inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.col-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(105deg, rgba(251,250,245,.94) 0%, rgba(251,250,245,.78) 36%, rgba(251,250,245,.2) 100%);
}
.col-card-tall { min-height: 380px; background: var(--green-50); }
.col-card-tall .bg-img { object-position: center; }
.col-card-wide { background: #f5f3f4; }

/* ── Services grid ──────────────────────────────────────────────────────── */
.services-grid {
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
}
.service-item { text-align: center; }
.service-item .icon-circle {
  width: clamp(84px, 8vw, 106px); aspect-ratio: 1; border-radius: 50%;
  background: var(--green-50); display: grid; place-items: center;
  margin: 0 auto 1.35rem; transition: background .2s var(--ease), transform .2s var(--ease);
}
.service-item:hover .icon-circle { background: var(--green-100); transform: translateY(-3px); }
.service-item .icon-circle svg {
  width: 48%; height: 48%; stroke: var(--green-600); fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.service-item h3 { font-size: 1rem; margin-bottom: .55rem; text-transform: uppercase; letter-spacing: .03em; }
.service-item p { font-size: .92rem; color: var(--muted); max-width: 26ch; margin-inline: auto; }

/* --------------------------------------------------------------------------
   10. Auth pages
   -------------------------------------------------------------------------- */
.auth-body {
  min-height: 100vh; min-height: 100dvh; margin: 0; display: flex; align-items: stretch;
  background: var(--grad-hero);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); line-height: 1.65;
}
.auth-shell { display: grid; grid-template-columns: 1fr; width: 100%; min-height: 100vh; min-height: 100dvh; }
.auth-visual {
  display: none; position: relative; color: #fff;
  padding: clamp(1.75rem, 3vw, 3rem); background: var(--grad-hero); overflow: hidden;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0; background-image: var(--pattern-leaf);
  background-size: 160px 160px; opacity: .6;
}
.auth-visual .visual-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.auth-visual .visual-media {
  flex: 1; border-radius: var(--radius-lg); overflow: hidden;
  margin-block: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow-lg); min-height: 0;
}
.auth-visual .visual-media img { width: 100%; height: 100%; object-fit: cover; }
.auth-visual .visual-media .img-ph {
  min-height: 100%; height: 100%; border-color: rgba(255,255,255,.5); color: #fff;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 12px, rgba(255,255,255,.14) 12px 24px),
    rgba(255,255,255,.06);
}
.auth-visual .visual-media .img-ph .dim { color: rgba(255,255,255,.8); }
.auth-visual .visual-quote { font-size: clamp(1rem, .95rem + .35vw, 1.2rem); line-height: 1.55; margin: 0; }
.auth-visual .brand-name { color: #fff; font-size: 1.5rem; }
.auth-visual-logo { max-height: 52px; width: auto;}

.auth-panel {
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad); background: var(--cream);
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 440px; background: var(--white); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); animation: fade-up .5s var(--ease);
}
.auth-card .auth-logo { text-align: center; margin-bottom: 1.25rem; }
.auth-card .auth-logo .brand { justify-content: center; }
.auth-card .auth-logo .brand-name { color: var(--green-800); font-size: 1.45rem; }
.auth-card-logo { max-height: 56px; width: auto; margin-inline: auto; display: block; }
/* Container that gives the logo a dark green pill background so it's legible
   on the white card regardless of whether the image is light or dark. */
.auth-logo-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-900); border-radius: var(--radius);
  padding: .5rem .9rem; margin-inline: auto;
}
.auth-card h1 { text-align: center; font-size: clamp(1.45rem, 1.25rem + .6vw, 1.75rem); margin-bottom: .35rem; }
.auth-card .subtitle { text-align: center; color: var(--muted); margin-bottom: 1.75rem; }
.auth-card form { display: grid; gap: .25rem; }
.auth-card .btn-block { margin-top: .75rem; }
.auth-alt { text-align: center; margin: 1.35rem 0 0; color: var(--muted); font-size: .92rem; }
.auth-meta { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .5rem; }
.auth-meta label { margin-bottom: 0; }
.auth-meta a { font-size: .87rem; }
.pw-hint { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); margin-block: 1.35rem; font-size: .85rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }

/* --------------------------------------------------------------------------
   11. Admin
   -------------------------------------------------------------------------- */
.admin-layout {
  display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-block: clamp(1.25rem, 2.5vw, 2rem) var(--section-y); align-items: start;
}
.admin-nav {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .75rem; position: static;
}
.admin-nav .admin-nav-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700;
  color: var(--muted); padding: .5rem .75rem .35rem;
}
.admin-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; font-size: .93rem; min-height: 42px;
}
.admin-nav a:hover { background: var(--green-50); color: var(--green-700); }
.admin-nav a[aria-current="page"] {
  background: var(--green-100); color: var(--green-800); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--green-600);
}
.admin-nav a .ico { flex: none; width: 1.25rem; text-align: center; }
.admin-content { min-width: 0; }
.admin-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.admin-head h1 { margin-bottom: .15rem; }
.admin-head p { color: var(--muted); margin: 0; }
.admin-head-text { min-width: 0; }
.admin-nav-toggle { display: none; }

/* Admin pot swatch */
.pot-swatch-dot {
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
}
.pot-assign-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.pot-assign-list .tag-chip > span { display: flex; align-items: center; gap: .4rem; }
.pot-assign-list .dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); flex: none; }

/* --------------------------------------------------------------------------
   Image upload widget
   -------------------------------------------------------------------------- */
.image-field { margin-bottom: 1rem; }
.image-field > label { margin-bottom: .5rem; }
.upload-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; padding: 1.5rem 1rem; text-align: center; cursor: pointer;
  border: 2px dashed var(--green-300); border-radius: var(--radius);
  background: var(--green-50); color: var(--green-700);
  transition: background .18s, border-color .18s; position: relative;
}
.upload-zone:hover, .upload-zone:focus-visible, .upload-zone.drag-over {
  background: var(--green-100); border-color: var(--green-500);
}
.upload-zone.uploading { opacity: .6; pointer-events: none; }
.upload-zone.uploading::after {
  content: "Uploading…"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255,255,255,.7); border-radius: var(--radius);
  font-weight: 600; color: var(--green-700);
}
.upload-zone-sm { padding: 1rem; }
.upload-icon { font-size: 1.6rem; }
.upload-hint { font-weight: 500; }
.upload-hint u { text-underline-offset: 2px; }
.upload-hint-small { font-size: .78rem; color: var(--muted); }
.upload-file-input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.image-field-sep {
  display: flex; align-items: center; gap: .6rem; color: var(--muted);
  font-size: .82rem; margin-block: .7rem;
}
.image-field-sep::before, .image-field-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.image-url-input { margin-top: 0; }
.image-url-text { resize: vertical; min-height: 60px; }
.upload-preview-single { position: relative; display: inline-block; margin-block: .5rem; }
.upload-preview-img { max-height: 140px; max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-clear {
  position: absolute; top: -.5rem; right: -.5rem; width: 24px; height: 24px;
  min-height: 24px; padding: 0; border-radius: 50%; font-size: .7rem;
  background: var(--white); color: var(--ink); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); display: grid; place-items: center;
}
.upload-clear::after { content: none; }
.upload-clear:hover { background: var(--danger-bg); transform: none; filter: none; }
.upload-previews { display: flex; flex-wrap: wrap; gap: .5rem; margin-block: .5rem; }
.thumb-uploaded { position: relative; width: 80px; height: 80px; flex: none; }
.thumb-uploaded img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.thumb-remove {
  position: absolute; top: -.4rem; right: -.4rem; width: 20px; height: 20px;
  min-height: 20px; padding: 0; border-radius: 50%; font-size: .65rem;
  background: var(--white); color: var(--ink); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); display: grid; place-items: center;
}
.thumb-remove::after { content: none; }
.thumb-remove:hover { background: var(--danger-bg); transform: none; filter: none; }
.upload-error { margin: .25rem 0; }

/* --------------------------------------------------------------------------
   12. Animations
   -------------------------------------------------------------------------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in-left { from { transform: translateX(-100%); } to { transform: none; } }

.reveal { animation: fade-up .6s var(--ease) both; }
.reveal-2 { animation: fade-up .6s .08s var(--ease) both; }
.reveal-3 { animation: fade-up .6s .16s var(--ease) both; }
.reveal-4 { animation: fade-up .6s .24s var(--ease) both; }

/* ==========================================================================
   13. Responsive tiers
   --------------------------------------------------------------------------
   Most layout adapts automatically via auto-fit grids + clamp(), so these
   breakpoints only handle structural changes (nav mode, sidebar behaviour,
   mosaic placement) and the ultrawide upper bound.
   ========================================================================== */

/* ── Phones: collapse the nav into a toggleable sheet ───────────────────── */
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; order: 3; width: 100%; margin-left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding-top: .5rem; margin-top: .5rem;
    border-top: 1px solid rgba(18, 61, 39, .12);
    max-height: min(70vh, 480px); overflow-y: auto;
  }
  .site-nav.open { display: flex; animation: fade-down .22s var(--ease); }
  .site-nav a, .site-nav .link-button {
    display: flex; align-items: center; padding: .8rem .25rem;
    min-height: 48px; width: 100%; text-align: left; font-size: 1rem;
    border-bottom: 1px solid rgba(18, 61, 39, .07);
  }
  .site-nav a::after { content: none; }
  .site-nav .inline-form { display: block; width: 100%; }
  .site-nav .link-button { border-bottom: none; }
}

/* ── Small phones: single-column forms and tighter cards ────────────────── */
@media (max-width: 560px) {
  :root { --card-min: 100%; }
  .form-row, .form-grid { grid-template-columns: 1fr; }
  .card-action-btns { grid-template-columns: 1fr; }
  .gallery-thumbs { grid-template-columns: repeat(3, 1fr); }
  .hero-stats { gap: 1.25rem 2rem; }
  .search-hero-submit { padding-inline: .85rem; }
  .product-buy { padding: 1rem; }
  /* Let long action rows wrap instead of overflowing */
  .actions-cell { width: 100%; }
}

/* Very small phones: hide the search button text, keep the icon affordance */
@media (max-width: 400px) {
  .search-hero-submit { display: none; }
  .search-hero-inner { padding-right: .5rem; }
}

/* ── Landscape phones / small tablets ──────────────────────────────────── */
@media (min-width: 561px) {
  :root { --card-min: 250px; }
  .cart-layout { grid-template-columns: 1fr; }
}

/* ── Tablets portrait and up ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .about-split { grid-template-columns: 1.05fr 1fr; }
  .hero-inner { grid-template-columns: 1.05fr .95fr; }
  .hero-centered .hero-inner { grid-template-columns: 1fr; }
  .product-layout { grid-template-columns: 1.05fr .95fr; }
  .auth-shell { grid-template-columns: 1.05fr .95fr; }
  .auth-visual { display: block; }
  .cart-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
}

/* ── Tablets landscape / small laptops: filters become a real sidebar ──── */
@media (max-width: 900px) {
  /* Filter panel slides in as an overlay rather than occupying a column */
  .shop-layout { grid-template-columns: 1fr; }
  .filter-panel {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    width: min(86%, 340px); z-index: 95; border-radius: 0;
    max-height: none; overflow-y: auto; box-shadow: var(--shadow-lg);
    animation: slide-in-left .25s var(--ease);
  }
  .shop-layout.filters-collapsed .filter-panel { display: none; }
}

@media (min-width: 901px) {
  .filter-backdrop { display: none !important; }
  /* Admin sidebar becomes a sticky rail */
  .admin-layout { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); }
  .admin-nav { position: sticky; top: calc(var(--header-h) + 1rem); }
}

/* ── Desktops: mosaic takes its editorial shape ────────────────────────── */
@media (min-width: 992px) {
  .collection-mosaic {
    grid-template-columns: minmax(280px, .95fr) 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .col-card-tall  { grid-column: 1; grid-row: 1 / 3; min-height: 480px; }
  .col-card-port  { grid-column: 2; grid-row: 1; }
  .col-card-office{ grid-column: 3; grid-row: 1; }
  .col-card-wide  {
    grid-column: 2 / 4; grid-row: 2; min-height: 260px;
    flex-direction: row; align-items: center; justify-content: flex-end;
  }
  .col-card-wide .content {
    display: flex; flex-direction: column; align-items: flex-end;
    text-align: right; position: relative; z-index: 2;
  }
  .col-card-wide .col-title { max-width: 20ch; }
  .col-card-wide .bg-img { object-position: left center; }
  .col-card-wide::after {
    background: linear-gradient(255deg, rgba(251,250,245,.94) 0%, rgba(251,250,245,.72) 42%, rgba(251,250,245,.12) 100%);
  }
}

/* ── Large desktops (typical 16:9 / 4:3 at high res) ───────────────────── */
@media (min-width: 1280px) {
  :root { --card-min: 270px; }
  .shop-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

/* ── Ultrawide (21:9 and wider) ────────────────────────────────────────────
   Widen the shell and let grids grow to more columns so content fills the
   display instead of sitting in a narrow centre strip. The reading measure
   for prose stays capped for legibility. */
@media (min-width: 1700px) {
  :root {
    --maxw: 1600px;
    --card-min: 290px;
    --pad: 2.5rem;
  }
  .shop-layout { grid-template-columns: 300px minmax(0, 1fr); }
}

@media (min-width: 2100px) {
  :root {
    --maxw: 1880px;
    --card-min: 310px;
    --pad: 3rem;
    --section-y: 5rem;
  }
  .hero-inner { padding: 4.5rem; }
  /* Keep the product page from stretching text too wide */
  .product-layout { grid-template-columns: 1fr minmax(0, 720px); }
}

@media (min-width: 2560px) {
  :root { --maxw: 2200px; --card-min: 330px; }
}

/* ── Short landscape viewports (phones/tablets held sideways) ───────────── */
@media (max-height: 560px) and (orientation: landscape) {
  .site-header { position: static; }
  .hero-inner { padding-block: 1.5rem; }
  .hero-media { aspect-ratio: 16 / 9; }
  .auth-body, .auth-shell { min-height: 0; }
  .auth-panel { align-items: flex-start; padding-block: 1.5rem; }
  .filter-panel, .admin-nav, .cart-summary { position: static; max-height: none; }
}

/* ── Homepage: edge-to-edge sections, tighter vertical rhythm ─────────── */
.home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.home-main > .hero {
  border-radius: 0;
  margin: 0;
}
.home-main > .section,
.home-main > .features {
  padding-inline: clamp(.85rem, 1.6vw, 1.75rem);
}
.home-main > .section {
  padding-block: clamp(1rem, 2vw, 1.75rem);
}
.home-main > .features {
  margin-block: 0;
  padding-block: clamp(.85rem, 1.6vw, 1.25rem);
}
.home-main .section-head {
  max-width: none;
  margin-bottom: clamp(.7rem, 1.4vw, 1.15rem);
}
.home-main .grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.home-main .about-split { width: 100%; }
.home-main .collection-mosaic,
.home-main .categories-grid,
.home-main .services-grid,
.home-main .features { width: 100%; }

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .site-ad, .filter-panel, .nav-toggle,
  .search-hero, .card-actions, .product-buy, .admin-nav { display: none !important; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* ── Reduced motion ────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   CAPTCHA widget (contact form, anonymous visitors)
   ========================================================================== */
.captcha-wrap {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-bottom: .35rem;
}
.captcha-img {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--green-50); display: block;
  /* Prevent browsers from caching the image and re-using a stale CAPTCHA. */
  image-rendering: pixelated;
}
.captcha-refresh {
  white-space: nowrap; flex: none;
}
