/* Layout idea: a shop window for one person's Natura catalogue. Sticky search + category rail on top,
   a dense grid of catalogue pages as product cards, a slide-up order sheet that ends in WhatsApp. */
:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --ink: #18261f;
  --muted: #5d6b62;
  --line: #dde3dc;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-soft: #fde9dc;
  --leaf: #2f6b4f;
  --deal: #c2255c;
  --shadow: 0 1px 2px rgba(24, 38, 31, .06), 0 6px 20px rgba(24, 38, 31, .07);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111814; --surface: #1a231e; --ink: #e9efe9; --muted: #9fb0a5; --line: #2b3830;
    --accent: #ff7a33; --accent-ink: #1a0d04; --accent-soft: #3a2215; --leaf: #7cc49f; --deal: #ff6b9a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111814; --surface: #1a231e; --ink: #e9efe9; --muted: #9fb0a5; --line: #2b3830;
  --accent: #ff7a33; --accent-ink: #1a0d04; --accent-soft: #3a2215; --leaf: #7cc49f; --deal: #ff6b9a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.brand { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.brand h1 { font-size: 20px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { color: var(--muted); font-size: 12.5px; }
.cart-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.cart-btn .count { background: var(--accent-ink); color: var(--accent); border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; font-size: 12.5px; padding: 0 6px; }
.icon-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none; }
.search-row { display: flex; gap: 8px; padding-bottom: 10px; align-items: center; }
.search { flex: 1; position: relative; }
.search input { width: 100%; padding: 11px 14px 11px 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
select.sort { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); max-width: 46vw; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; border-radius: 999px; font-size: 14px; white-space: nowrap; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 4px; font-size: 12.5px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] b { color: inherit; opacity: .7; }
.chip.deal[aria-pressed="true"] { background: var(--deal); border-color: var(--deal); color: #fff; }

/* grid */
main { padding: 16px 0 120px; }
.result-line { color: var(--muted); font-size: 13.5px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; content-visibility: auto; contain-intrinsic-size: 170px 420px; }
.card .shot { position: relative; aspect-ratio: 519 / 793; background: var(--line); border: 0; padding: 0; width: 100%; display: block; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; }
.off { position: absolute; top: 8px; left: 8px; background: var(--deal); color: #fff; font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 999px; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.line-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--leaf); font-weight: 700; }
.card .name { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--muted); font-size: 12.5px; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.was { color: var(--muted); text-decoration: line-through; font-size: 12.5px; }
.add { margin-top: 8px; border: 1.5px solid var(--accent); color: var(--accent); background: transparent; border-radius: 10px; padding: 8px; font-weight: 700; }
.add:hover { background: var(--accent-soft); }
.add.in { background: var(--accent); color: var(--accent-ink); }

.empty { text-align: center; padding: 60px 16px; color: var(--muted); max-width: 520px; margin: 0 auto; }
.empty h2 { color: var(--ink); font-size: 24px; margin-bottom: 8px; }
.foot { color: var(--muted); font-size: 12.5px; padding: 24px 0 0; border-top: 1px solid var(--line); margin-top: 32px; }

/* sheets & dialogs */
.scrim { position: fixed; inset: 0; background: rgba(10, 16, 12, .55); z-index: 40; display: none; }
.scrim.open { display: block; }
.sheet { position: fixed; z-index: 50; background: var(--surface); color: var(--ink); display: none; flex-direction: column; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
.sheet.open { display: flex; }
.sheet.side { right: 0; top: 0; bottom: 0; width: min(440px, 100%); }
.sheet.center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(1000px, calc(100% - 24px)); max-height: calc(100% - 24px); border-radius: 18px; }
@media (max-width: 700px) {
  .sheet.center, .sheet.side { left: 0; right: 0; bottom: 0; top: auto; transform: none; width: 100%; max-height: 92%; border-radius: 18px 18px 0 0; }
  .sheet.side { height: 92%; }
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 19px; flex: 1; }
.sheet-body { overflow: auto; padding: 16px; flex: 1; }
.sheet-foot { border-top: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 10px; }

/* product detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 700px) { .detail { grid-template-columns: 1fr; } }
.pageview { position: relative; border-radius: 10px; overflow: hidden; background: var(--line); align-self: start; }
.pageview img { width: 100%; }
.pageview .hl { position: absolute; border: 3px solid var(--accent); border-radius: 8px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18); pointer-events: none; }
.detail h3 { font-size: 24px; line-height: 1.2; margin: 4px 0 8px; }
.detail .price { font-size: 30px; }
.promo { background: var(--accent-soft); color: var(--ink); padding: 8px 10px; border-radius: 10px; font-size: 14px; margin-top: 8px; }
.desc { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.variants { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.variant { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; text-align: left; }
.variant small { display: block; color: var(--muted); font-size: 11.5px; }
.variant[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.label { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 16px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: transparent; width: 36px; height: 36px; font-size: 18px; }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.primary { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 800; padding: 13px 16px; border-radius: 12px; text-align: center; text-decoration: none; display: block; font-size: 15.5px; }
.primary[aria-disabled="true"], .primary:disabled { opacity: .45; pointer-events: none; }
.ghost { border: 1px solid var(--line); background: var(--surface); padding: 11px 14px; border-radius: 12px; font-weight: 600; }
.wa { background: #1f9d55; color: #fff; }
.hint { color: var(--muted); font-size: 13px; }
.warn { color: var(--deal); font-size: 13.5px; }

/* cart */
.cart-item { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item img { width: 54px; aspect-ratio: 519/793; object-fit: cover; border-radius: 6px; background: var(--line); }
.cart-item .n { font-size: 14px; font-weight: 600; line-height: 1.25; }
.cart-item .s { color: var(--muted); font-size: 12.5px; }
.total { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field input, .field textarea { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); width: 100%; }

/* admin */
.admin-bar { background: var(--ink); color: var(--bg); font-size: 13.5px; }
.admin-bar .wrap { display: flex; gap: 10px; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.admin-bar button { border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); background: transparent; color: var(--bg); border-radius: 999px; padding: 5px 12px; font-weight: 600; }
.admin-bar .go { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.admin-bar span { flex: 1; min-width: 180px; }
.section { display: grid; gap: 12px; padding: 4px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.section h3 { font-size: 17px; }
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; display: grid; gap: 8px; place-items: center; background: var(--bg); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.log { font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 80; font-weight: 600; font-size: 14px; display: none; }
.toast.show { display: block; }
.fab { position: fixed; right: 16px; bottom: 16px; z-index: 30; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
@media (min-width: 701px) { .fab { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 420px) { .cart-btn .lbl { display: none; } .brand h1 { font-size: 18px; } }
.admin-link { color: var(--muted); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }
