/* Karoo Pantry — warm & vibey, light. Mobile-first; nothing overflows at 375px. */
/* Colour tokens are tuned for WCAG AA: white on --apricot 5.1:1, --olive on cream 6.6:1 / on --olive-soft 5.4:1, --warn on #FFF3DF 5.5:1. */
:root {
  --apricot: #BC4A10; --apricot-deep: #9E3D0C; --apricot-bright: #E07A2F; --rooibos: #8B3A1E; --plum: #5A2A4A;
  --olive: #55651F; --olive-soft: #E9EED3; --cream: #FFF8EF; --sand: #F6E7D2; --peach: #FBD9BC;
  --ink: #2B1D16; --ink-soft: #6D5A4E; --line: #EAD9C4; --white: #fff;
  --ok: #2F7A4A; --warn: #8F5510; --bad: #B3261E;
  --r: 20px; --r-sm: 12px; --shadow: 0 10px 30px rgba(139, 58, 30, .12);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--cream); line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--rooibos); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.price, .money { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wrap { width: min(1160px, 100% - 2rem); margin: 0 auto; }
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.5rem; }
.section-head p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; color: var(--olive); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--apricot); outline-offset: 2px; border-radius: 6px; }

/* Icons — always the SVG sprite, never emoji */
.icon { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.22em; display: inline-block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Header */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 248, 239, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: .25rem; }
.nav a, .nav button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; border: 0; background: transparent; cursor: pointer; }
.nav a:hover, .nav button:hover, .nav a.active { background: var(--sand); }
.nav .cart-link { background: var(--apricot); color: #fff; }
.nav .cart-link:hover { background: var(--apricot-deep); }
.nav-toggle { display: none; min-width: 44px; min-height: 44px; border: 0; background: var(--sand); color: var(--ink); border-radius: 12px; cursor: pointer; font-size: 1.3rem; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav { position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; background: var(--cream); padding: .75rem 1rem 1rem; border-bottom: 1px solid var(--line); display: none; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a, .nav button { justify-content: flex-start; }
}

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem; border-radius: 999px; border: 2px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--apricot); color: #fff; box-shadow: 0 8px 20px rgba(188, 74, 16, .3); }
.btn-primary:hover { background: var(--apricot-deep); }
.btn-dark { background: var(--rooibos); color: #fff; }
.btn-olive { background: var(--olive); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--rooibos); color: var(--rooibos); }
.btn-ghost:hover { background: var(--sand); }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-sm { min-height: 40px; padding: 0 1rem; font-size: .9rem; }
.btn-block { width: 100%; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.input, input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: .65rem .9rem; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--apricot); outline: none; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.help { font-size: .82rem; color: var(--ink-soft); margin-top: .3rem; }
.notice { padding: .9rem 1.1rem; border-radius: var(--r-sm); background: var(--sand); border-left: 5px solid var(--apricot); margin-bottom: 1rem; }
.notice.ok { background: #E7F3EA; border-left-color: var(--ok); }
.notice.bad { background: #FBE9E7; border-left-color: var(--bad); }
.notice.warn { background: #FFF3DF; border-left-color: var(--warn); }

/* Confirmation dialog (replaces native confirm()) */
dialog.confirm { border: 0; border-radius: var(--r); padding: 1.5rem; width: min(92vw, 440px); background: #fff; color: var(--ink); box-shadow: var(--shadow); }
dialog.confirm::backdrop { background: rgba(43, 29, 22, .55); }
dialog.confirm h3 { margin-bottom: .6rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin-top: .5rem; }

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; background: linear-gradient(120deg, rgba(90, 42, 74, .92) 0%, rgba(139, 58, 30, .82) 45%, rgba(188, 74, 16, .6) 100%), url('/assets/stock-1.jpg') center/cover no-repeat; }
.hero .wrap { padding: clamp(3.5rem, 9vw, 7rem) 0; display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.2fr .8fr; } }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); line-height: 1.02; margin-bottom: 1rem; text-wrap: balance; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 34rem; color: rgba(255,255,255,.92); }
.hero .eyebrow { color: var(--peach); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.hero-card { background: rgba(255, 248, 239, .96); color: var(--ink); border-radius: var(--r); padding: 1.4rem; box-shadow: var(--shadow); }
.hero-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.hero-card li { display: flex; gap: .7rem; align-items: flex-start; }
.hero-card li b { color: var(--rooibos); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; pointer-events: none; }
.blob-1 { width: 380px; height: 380px; background: var(--apricot-bright); right: -120px; top: -120px; }
.blob-2 { width: 280px; height: 280px; background: var(--olive); left: -100px; bottom: -120px; }

/* Cards & product grid */
.cat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-card { position: relative; display: block; border-radius: var(--r); overflow: hidden; min-height: 160px; text-decoration: none; color: #fff; background: var(--plum) center/cover no-repeat; box-shadow: var(--shadow); transition: transform .15s ease; }
.cat-card:hover { transform: translateY(-3px); }
.cat-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(43,29,22,0) 30%, rgba(43,29,22,.85) 100%); }
.cat-card .label { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; z-index: 1; }
.cat-card h3 { color: #fff; margin: 0; }
.cat-card .label span { font-size: .85rem; opacity: .9; }
.product-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.product-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: 0 6px 20px rgba(43, 29, 22, .07); border: 1px solid var(--line); height: 100%; transition: transform .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-card .img { aspect-ratio: 4 / 3; background: var(--sand) center/cover no-repeat; position: relative; }
.product-card .img a { position: absolute; inset: 0; }
.product-card .body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-card h3 { font-size: 1.1rem; margin: 0; }
.product-card h3 a { color: var(--ink); text-decoration: none; }
.product-card .short { color: var(--ink-soft); font-size: .9rem; margin: 0; flex: 1; }
.product-card .row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; }
.product-card .price { font-size: 1.25rem; color: var(--rooibos); }
.stock { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; }
.stock::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.in_stock { background: #E7F3EA; color: var(--ok); }
.stock.low_stock { background: #FFF3DF; color: var(--warn); }
.stock.sold_out, .stock.unavailable { background: #FBE9E7; color: var(--bad); }
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--sand); color: var(--rooibos); white-space: nowrap; }
.pill.pending { background: #FFF3DF; color: var(--warn); }
.pill.confirmed, .pill.processing { background: #E9EED3; color: var(--olive); }
.pill.shipped { background: #E3ECFA; color: #2B4E8C; }
.pill.delivered, .pill.paid { background: #E7F3EA; color: var(--ok); }
.pill.cancelled, .pill.refunded { background: #FBE9E7; color: var(--bad); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.chip { min-height: 44px; padding: 0 1rem; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--rooibos); color: #fff; border-color: var(--rooibos); }

/* Feature strip & about */
.features { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: #fff; border-radius: var(--r); padding: 1.4rem; border: 1px solid var(--line); height: 100%; }
.feature .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--peach); color: var(--rooibos); font-weight: 800; margin-bottom: .8rem; font-family: var(--font-display); }
.split { display: grid; gap: 2rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split .photo { border-radius: var(--r); aspect-ratio: 4/3; background: var(--sand) center/cover no-repeat; box-shadow: var(--shadow); }
.band { background: var(--olive-soft); }
.band-plum { background: var(--plum); color: #fff; }
.band-plum h2 { color: #fff; }

/* Product detail */
.detail { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 860px) { .detail { grid-template-columns: 1fr 1fr; } }
.detail .photo { border-radius: var(--r); aspect-ratio: 1; background: var(--sand) center/cover no-repeat; box-shadow: var(--shadow); }
.detail .price { font-size: 2rem; color: var(--rooibos); }
.qty { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.2rem; cursor: pointer; }
.qty input { width: 52px; min-height: 44px; border: 0; text-align: center; font-weight: 700; padding: 0; }
.qty input:focus { outline: none; }

/* Cart / checkout / tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; box-shadow: 0 6px 20px rgba(43, 29, 22, .05); }
.card + .card { margin-top: 1rem; }
.checkout { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 960px) { .checkout { grid-template-columns: 1.4fr 1fr; } .checkout .sticky { position: sticky; top: 84px; } }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: .9rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--sand) center/cover no-repeat; }
.line .name { font-weight: 600; }
.line .meta { font-size: .85rem; color: var(--ink-soft); }
.totals { display: grid; gap: .45rem; margin-top: 1rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals .grand { font-size: 1.3rem; font-weight: 800; border-top: 2px solid var(--line); padding-top: .6rem; margin-top: .3rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--cream); }
.area-option { display: flex; gap: .8rem; align-items: flex-start; padding: .9rem 1rem; border: 2px solid var(--line); border-radius: var(--r-sm); margin-bottom: .6rem; cursor: pointer; background: #fff; }
.area-option.active { border-color: var(--apricot); background: #FFF6EC; }
.area-option input { margin-top: .3rem; width: 20px; height: 20px; min-height: 0; }
.area-option .fee { margin-left: auto; }
.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.steps span { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.steps span.done { background: var(--olive-soft); color: var(--olive); }
.steps span.now { background: var(--apricot); color: #fff; border-color: var(--apricot); }

/* Invoice */
.invoice { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: clamp(1.2rem, 4vw, 2.2rem); }
.invoice header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--ink); padding-bottom: 1rem; margin-bottom: 1rem; }
.invoice .parties { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 640px) { .invoice .parties { grid-template-columns: 1fr 1fr; } }
.invoice td.num, .invoice th.num { text-align: right; }
.invoice tfoot td { font-weight: 700; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding-left: 1.6rem; padding-bottom: 1rem; }
.timeline li::before { content: ''; position: absolute; left: .35rem; top: .4rem; width: 10px; height: 10px; border-radius: 50%; background: var(--apricot); }
.timeline li::after { content: ''; position: absolute; left: .62rem; top: 1.1rem; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* Footer */
footer.site { background: var(--ink); color: #EFE3D6; padding: 3rem 0 2rem; margin-top: 3rem; }
footer.site .cols { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { footer.site .cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
footer.site h4 { color: #fff; font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; }
footer.site a { color: #EFE3D6; text-decoration: none; display: block; padding: .3rem 0; min-height: 32px; }
footer.site a:hover { color: var(--peach); }
footer.site .trust { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
footer.site .trust span { padding: .35rem .7rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); font-size: .8rem; }
footer.site .legal { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1rem; font-size: .8rem; color: #C9B8A8; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 999px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 2rem); text-align: center; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.skeleton { background: linear-gradient(90deg, var(--sand), #fff, var(--sand)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--r); min-height: 120px; }
@keyframes sh { to { background-position: -200% 0; } }
.signin { max-width: 460px; margin: 0 auto; }
.code-input { letter-spacing: .5em; font-size: 1.5rem; text-align: center; font-weight: 700; }
@media print { .topbar, footer.site, .no-print { display: none !important; } body { background: #fff; } }
