/* HerbsAfrika base styles.
   Palette: deep green leads (headers, side menus, footer), white carries the content,
   and gold and amethyst are small accents. Every text colour below meets WCAG AA contrast. */
:root {
  /* Greens: the main colour, darkest to lightest */
  --green-950: #06231A;   /* footer, deepest shade */
  --green-900: #0B3325;   /* header, side menus, hero */
  --green-800: #0F4430;   /* category bar, hover on dark */
  --green-700: #155A3E;   /* primary buttons */
  --green-600: #1D7050;   /* links, focus rings */
  --green-400: #5FA882;   /* soft glows, illustrations */
  --green-300: #9FC7B0;   /* quiet text on dark green */
  --green-100: #E3F0E8;   /* tints */
  --green-50:  #F4F8F5;   /* page background behind white cards */
  /* Gold: a hint of yellow */
  --gold: #E7B84B;
  --gold-soft: #F3D68C;
  --gold-ink: #8A6410;    /* gold-family text on white */
  --gold-tint: #FBF3DC;
  --star: #C0840F;        /* rating stars: gold deep enough to see on white (3:1) */
  /* Amethyst: a hint of purple */
  --amethyst: #5E3F85;
  --amethyst-soft: #C9B6E4;
  --amethyst-tint: #F1EBF8;
  /* Neutrals */
  --white: #FFFFFF;
  --ink: #10261C;
  --ink-2: #33473C;
  --muted: #5B6B62;
  --line: #DDE6E0;
  --line-strong: #BFCDC5;
  --danger: #B42318;
  --danger-tint: #FDECEA;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(6, 35, 26, .06);
  --shadow: 0 1px 2px rgba(6, 35, 26, .06), 0 10px 28px rgba(6, 35, 26, .08);
  --shadow-lg: 0 24px 60px rgba(6, 35, 26, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-600); }
a:hover { color: var(--green-800); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .45em; color: var(--green-950); text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
::selection { background: var(--gold-soft); color: var(--green-950); }
:focus-visible { outline: 3px solid var(--green-600); outline-offset: 2px; }
[hidden] { display: none !important; }

.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; top: 8px; background: var(--gold); color: var(--green-950); padding: 8px 14px; border-radius: 8px; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 8px; color: var(--green-950); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic, .ic-sm, .ic-lg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic { width: 18px; height: 18px; }
.ic-sm { width: 14px; height: 14px; vertical-align: -2px; }
.ic-lg { width: 42px; height: 42px; stroke-width: 1.5; }
.ic-leaf { fill: currentColor; stroke: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--font-mono); }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 20px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border-radius: 10px; border: 1.5px solid transparent; font: 600 15px/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green-700); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 2px 6px rgba(6, 35, 26, .18); }
.btn-primary:hover { background: var(--green-800); color: #fff; }
.btn-gold { background: var(--gold); color: var(--green-950); }
.btn-gold:hover { background: var(--gold-soft); color: var(--green-950); }
.btn-secondary { background: var(--white); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--green-600); color: var(--green-700); }
.btn-danger { background: var(--white); color: var(--danger); border-color: #F1B5AF; }
.btn-danger:hover { background: var(--danger-tint); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: rgba(6, 35, 26, .05); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
/* A button that looks like a link, for small actions inside a sentence */
.btn-link { display: inline; padding: 0; border: 0; background: none; font: inherit; color: var(--green-600); text-decoration: underline; cursor: pointer; }
.btn-link:hover { color: var(--green-800); }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 16.5px; border-radius: 12px; }
.js .js-hide { display: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Forms */
.form .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
label { font-weight: 600; font-size: 15px; color: var(--ink); }
.optional { font-weight: 400; color: var(--muted); }
/* :where() keeps these defaults easy to override (e.g. the header search box). */
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line-strong); border-radius: 10px;
  background: var(--white); font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green-600); outline: none; box-shadow: 0 0 0 4px rgba(29, 112, 80, .16); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
input[type=file] { font: inherit; padding: 6px 0; max-width: 100%; }
input[type=file]::file-selector-button { font: 600 14px var(--font-body); padding: 8px 14px; margin-right: 12px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--green-50); color: var(--green-800); cursor: pointer; }
.help { font-size: 14px; color: var(--muted); margin: 0; }
.field-error { font-size: 14px; color: var(--danger); font-weight: 600; margin: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 4px 0 16px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--green-700); flex: none; }
.check-invalid { color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.form-narrow { max-width: 680px; }
.field-narrow { max-width: 240px; }
.form-actions + .help { margin-top: 10px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.form legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 15px; color: var(--ink); }
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--white); font-weight: 400; cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--green-600); }
.choice:has(input:checked) { border-color: var(--green-600); background: var(--green-50); box-shadow: inset 3px 0 0 var(--green-600); }
.choice input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--green-700); flex: none; }
.choice strong { display: block; color: var(--ink); }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) { .field-row, .field-row-3 { grid-template-columns: minmax(0, 1fr); } }

/* Password fields with a show/hide ("peek") button. The button needs JavaScript, so it only appears with it. */
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; }
.js .password-field input { padding-right: 52px; }
.peek { display: none; position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 40px; height: 34px; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.js .peek { display: inline-flex; }
.peek:hover { background: var(--green-50); color: var(--green-700); }
.peek[aria-pressed="true"] { color: var(--green-700); background: var(--green-100); }
.peek .ic { width: 20px; height: 20px; }

/* Messages */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; }
.alert p { margin: 0; }
.alert .ic { margin-top: 2px; }
.alert-success { background: var(--green-50); border-color: #BCD9C7; color: var(--green-900); }
.alert-success .ic { color: var(--green-600); }
.alert-status { background: var(--amethyst-tint); border-color: #DCCDEE; color: var(--amethyst); }
.alert-warning { background: var(--gold-tint); border-color: #EDD9A0; color: #5A4108; }
.alert-error { background: var(--danger-tint); border-color: #F1B5AF; color: #8A1A12; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; }
.notice p { margin: 0 0 .5em; }
.notice p:last-child { margin: 0; }
.notice > .ic { margin-top: 2px; }
.notice-warning { background: var(--gold-tint); border-color: #EDD9A0; color: #5A4108; }
.notice-info { background: var(--green-50); border-color: #CFE3D6; color: var(--green-900); }
.notice-info > .ic { color: var(--green-600); }

/* Status pills: green = live, gold = waiting, amethyst = draft, red = needs changes */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill-green { background: var(--green-100); color: var(--green-700); }
.pill-yellow { background: var(--gold-tint); color: var(--gold-ink); }
.pill-purple { background: var(--amethyst-tint); color: var(--amethyst); }
.pill-red { background: var(--danger-tint); color: var(--danger); }
.pill-grey { background: #EDF1EE; color: var(--muted); }
.tag { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.tag-sale { background: var(--gold); color: var(--green-950); }

/* Product cards (shop and wishlist) */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-3px); border-color: #CFDDD4; }
.pcard-img { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--green-50); }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.img-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: var(--green-400); background: radial-gradient(circle at 70% 25%, var(--gold-tint), var(--green-50) 60%); }
.img-placeholder .ic-leaf { width: 34%; height: 34%; }
.pcard-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcard-vendor { font-size: 13px; color: var(--amethyst); text-decoration: none; font-weight: 600; }
.pcard-vendor:hover { color: var(--amethyst); text-decoration: underline; }
.pcard-name { font-size: 16px; margin: 2px 0; }
.pcard-name a { color: var(--ink); text-decoration: none; }
.pcard-name a:hover { color: var(--green-700); }
.pcard-size { font-size: 14px; color: var(--muted); margin: 0; }
.pcard-rating { display: flex; align-items: center; gap: 5px; margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* Star ratings: a grey row of five stars with a gold row on top, cut to the rating in half stars */
.stars { position: relative; display: inline-flex; flex: none; line-height: 0; vertical-align: -2px; }
.stars-row, .stars-fill { display: inline-flex; }
.stars-row { color: var(--line-strong); }
.stars-fill { position: absolute; inset: 0 auto 0 0; width: 0; overflow: hidden; color: var(--star); }
.star { width: 16px; height: 16px; flex: none; fill: currentColor; stroke: none; }
.stars-sm .star { width: 14px; height: 14px; }
.stars-lg .star { width: 22px; height: 22px; }
.stars-1 .stars-fill { width: 10%; }
.stars-2 .stars-fill { width: 20%; }
.stars-3 .stars-fill { width: 30%; }
.stars-4 .stars-fill { width: 40%; }
.stars-5 .stars-fill { width: 50%; }
.stars-6 .stars-fill { width: 60%; }
.stars-7 .stars-fill { width: 70%; }
.stars-8 .stars-fill { width: 80%; }
.stars-9 .stars-fill { width: 90%; }
.stars-10 .stars-fill { width: 100%; }

/* Choosing a rating: five radio buttons drawn as stars, lit up to the one chosen (or pointed at) */
.rate-stars { display: inline-flex; gap: 2px; }
.rate-stars label { display: inline-flex; padding: 3px; border-radius: 8px; color: var(--line-strong); cursor: pointer; }
.rate-stars .star { width: 32px; height: 32px; }
.rate-stars input:focus-visible + label { outline: 3px solid var(--green-600); outline-offset: 1px; }
.rate-stars input:checked + label,
.rate-stars:has(input:nth-of-type(1):checked) label:nth-of-type(-n+1),
.rate-stars:has(input:nth-of-type(2):checked) label:nth-of-type(-n+2),
.rate-stars:has(input:nth-of-type(3):checked) label:nth-of-type(-n+3),
.rate-stars:has(input:nth-of-type(4):checked) label:nth-of-type(-n+4),
.rate-stars:has(input:nth-of-type(5):checked) label:nth-of-type(-n+5) { color: var(--star); }
@media (hover: hover) {
  .rate-stars:has(label:nth-of-type(1):hover) label:nth-of-type(-n+1),
  .rate-stars:has(label:nth-of-type(2):hover) label:nth-of-type(-n+2),
  .rate-stars:has(label:nth-of-type(3):hover) label:nth-of-type(-n+3),
  .rate-stars:has(label:nth-of-type(4):hover) label:nth-of-type(-n+4),
  .rate-stars:has(label:nth-of-type(5):hover) label:nth-of-type(-n+5) { color: var(--star); }
  .rate-stars:has(label:nth-of-type(1):hover) label:nth-of-type(n+2),
  .rate-stars:has(label:nth-of-type(2):hover) label:nth-of-type(n+3),
  .rate-stars:has(label:nth-of-type(3):hover) label:nth-of-type(n+4),
  .rate-stars:has(label:nth-of-type(4):hover) label:nth-of-type(n+5) { color: var(--line-strong); }
}
.pcard-price { margin: 8px 0 0; display: flex; gap: 8px; align-items: baseline; }
.pcard-price s { color: var(--muted); font-size: 14px; }
.pcard-price strong { font-size: 17px; color: var(--green-900); }
.pcard-stock { font-size: 13px; color: var(--danger); font-weight: 600; margin: 4px 0 0; }
.pcard-wish { position: absolute; top: 10px; right: 10px; margin: 0; }
.wish-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--ink-2); cursor: pointer; box-shadow: 0 2px 8px rgba(6, 35, 26, .14); transition: color .15s, transform .15s; }
.wish-btn:hover { color: var(--amethyst); transform: scale(1.06); }
.wish-btn.on, .wish-toggle.on { color: var(--amethyst); }
.wish-btn.on .ic, .wish-toggle.on .ic { fill: currentColor; }

/* Shared blocks */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .ic-lg { color: var(--green-400); }
.empty p { margin: 0; max-width: 52ch; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 28px 0 8px; }
.pager-info { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: var(--green-50); }
.table tbody tr:hover td { background: #FAFCFA; }
.table tr:last-child td { border-bottom: 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 12px 0 0; }
.facts > div { display: contents; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.code { background: var(--green-950); color: #D5E8DC; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font: 13px/1.6 var(--font-mono); }
details.debug { margin-top: 18px; text-align: left; }
details.debug pre { white-space: pre-wrap; font-size: 12px; background: var(--green-950); color: #D5E8DC; padding: 12px; border-radius: 8px; max-height: 420px; overflow: auto; }

/* Money rows: a label on the left, the amount on the right (cart, checkout, orders, earnings) */
.summary-rows { display: grid; gap: 10px; margin: 0 0 14px; }
.summary-rows > div { display: flex; justify-content: space-between; gap: 12px; }
.summary-rows dt { color: var(--ink-2); }
.summary-rows dd { margin: 0; font-weight: 600; text-align: right; }
.summary-total { padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 1.15rem; }
.summary-total dt, .summary-total dd { font-weight: 800; color: var(--green-950); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Signing up to sell: 1 Your account, 2 Confirm your email, 3 Your business */
.seller-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; font-weight: 600; color: var(--muted); }
.seller-steps li { display: inline-flex; align-items: center; gap: 8px; }
.seller-step-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12.5px; font-weight: 800; }
.seller-step-num .ic { width: 14px; height: 14px; }
.seller-steps .done { color: var(--green-700); }
.seller-steps .done .seller-step-num { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.seller-steps .now { color: var(--ink); }
.seller-steps .now .seller-step-num { background: var(--gold); border-color: var(--gold); color: var(--green-950); }
.auth-head .seller-steps { margin: 16px 0 0; color: rgba(255, 255, 255, .62); }
.auth-head .seller-steps .done { color: var(--green-300); }
.auth-head .seller-steps .done .seller-step-num { background: var(--green-400); border-color: var(--green-400); color: var(--green-950); }
.auth-head .seller-steps .now { color: #fff; }

/* A value that can't be changed on this form (a seller's country), and the box for a town that isn't listed */
.field-label { font-weight: 600; font-size: 15px; color: var(--ink); }
.fixed-field { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 10px 12px; border: 1.5px dashed var(--line-strong); border-radius: 10px; background: var(--green-50); font-weight: 600; color: var(--ink); }
.fixed-field .ic { color: var(--green-600); }
.town-other { margin-top: 8px; }
