:root {
  --bg: #f6f5ef;
  --surface: #ffffff;
  --surface-2: #eeede4;
  --ink: #14201a;
  --ink-2: #4a574f;
  --ink-3: #7b857e;
  --line: #dcdcd0;
  --brand: #0f2a1d;
  --brand-2: #1d4a33;
  --accent: #b8f36b;
  --accent-ink: #0f2a1d;
  --deal: #c2410c;
  --deal-bg: #fff1e6;
  --good: #1f7a45;
  --focus: #3b82f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 32, 26, .06), 0 4px 16px rgba(20, 32, 26, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c140f;
    --surface: #131e17;
    --surface-2: #1a2820;
    --ink: #e9efe9;
    --ink-2: #b3bfb6;
    --ink-3: #849088;
    --line: #26362c;
    --brand: #07140d;
    --brand-2: #16311f;
    --deal: #fb923c;
    --deal-bg: #2c1a0e;
    --good: #6ee7a0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c140f; --surface: #131e17; --surface-2: #1a2820; --ink: #e9efe9; --ink-2: #b3bfb6; --ink-3: #849088;
  --line: #26362c; --brand: #07140d; --brand-2: #16311f; --deal: #fb923c; --deal-bg: #2c1a0e; --good: #6ee7a0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header + hero */
.top { background: var(--brand); color: #eaf5ec; }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 22px/1 "Space Grotesk", Inter, sans-serif; text-decoration: none; letter-spacing: -.02em; }
.logo.big { font-size: 30px; color: var(--ink); }
.leaf { width: 22px; height: 22px; border-radius: 50% 0 50% 50%; background: var(--accent); transform: rotate(-45deg); display: inline-block; }
.logo.big .leaf { width: 28px; height: 28px; }
.asof { font-size: 12.5px; opacity: .8; text-align: right; }

.hero { background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%); color: #f1f7f1; padding: 28px 0 32px; }
.hero h1 { font: 700 clamp(28px, 6vw, 46px)/1.08 "Space Grotesk", Inter, sans-serif; letter-spacing: -.025em; margin: 0 0 10px; }
.hero .sub { margin: 0 0 20px; color: #c9dccd; max-width: 620px; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 16px; padding: 6px 6px 6px 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: 820px; }
.search-ic { color: #6b7a70; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: #14201a; font-size: 16px; padding: 10px 2px; }
.search input::placeholder { color: #8a948d; }
.examples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; max-width: 820px; }
.examples button { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #e5f1e7; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.examples button:hover { background: rgba(255, 255, 255, .18); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; border: 1px solid transparent; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.96); }
.btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 7px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.full { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 4px 8px; }

/* Layout */
.main { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding-top: 24px; padding-bottom: 40px; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; align-self: start; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.filters-head { display: flex; align-items: center; justify-content: space-between; }
.filters h2 { font-size: 16px; margin: 0 0 6px; }
.fgroup { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.fgroup:last-of-type { border-bottom: 0; }
.fgroup.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.fgroup h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 6px; font-weight: 600; }
.filters input[type=number], .filters input[type=text], .filters select, .sort select {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 10px; font-size: 14.5px;
}
.filters .btn.full + .btn.full { margin-top: 8px; }
.filters > .btn { margin-top: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.pill small { color: var(--ink-3); margin-left: 4px; }
.pill[aria-pressed="true"] { background: var(--brand-2); border-color: var(--brand-2); color: #f1f7f1; }
.pill[aria-pressed="true"] small { color: #b9d2bf; }
.range-lbl { font-size: 13.5px; color: var(--ink-2); }
input[type=range] { width: 100%; accent-color: var(--brand-2); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle input { position: absolute; opacity: 0; }
.toggle span { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background .15s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + span { background: var(--good); }
.toggle input:checked + span::after { transform: translateX(16px); }
.toggle input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Results */
.results-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 12px; font-size: 13px; font-weight: 500; }
.chip button { border: 0; background: var(--surface-2); color: var(--ink-2); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; line-height: 1; font-size: 14px; }
.bar-right { display: flex; gap: 8px; align-items: center; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.sort select { width: auto; background: var(--surface); }
.count { color: var(--ink-2); font-size: 13.5px; margin: 10px 0 12px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid #d4a017; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cat { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.deal { background: var(--deal-bg); color: var(--deal); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pname { font-weight: 600; font-size: 15px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.brand { color: var(--ink-2); font-size: 13px; margin-top: -4px; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font: 700 22px/1 "Space Grotesk", Inter, sans-serif; }
.was { color: var(--ink-3); text-decoration: line-through; font-size: 13.5px; }
.unit { color: var(--ink-2); font-size: 13px; }
.no-price { color: var(--ink-3); font-size: 14px; font-style: italic; }
.stats { display: flex; flex-wrap: wrap; gap: 6px; }
.stat { background: var(--surface-2); border-radius: 8px; padding: 3px 8px; font-size: 12.5px; color: var(--ink-2); }
.stat b { color: var(--ink); font-weight: 600; }
.stat.muted { color: var(--ink-3); }
.store { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.store-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-sub { color: var(--ink-3); font-size: 12.5px; }
.store a { flex: none; font-weight: 600; color: var(--good); text-decoration: none; font-size: 13px; }
.store a:hover { text-decoration: underline; }
.more-wrap { display: flex; justify-content: center; margin-top: 18px; }

.empty { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 18px; text-align: center; color: var(--ink-2); }
.empty h3 { margin: 0 0 6px; color: var(--ink); }
.skeleton { height: 190px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sh 1.2s infinite; border: 1px solid var(--line); }
@keyframes sh { to { background-position: -200% 0; } }

.foot { border-top: 1px solid var(--line); padding: 20px 0 36px; color: var(--ink-3); font-size: 13px; }
.foot p { margin: 0 0 6px; max-width: 760px; }

/* Age gate */
.age { position: fixed; inset: 0; z-index: 50; background: rgba(6, 14, 9, .75); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(6px); }
.age-card { background: var(--surface); border-radius: 18px; padding: 26px 22px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.age-card h2 { margin: 14px 0 8px; font-size: 22px; }
.age-card p { color: var(--ink-2); margin: 0 0 18px; }
.age-btns { display: grid; gap: 8px; }

.only-mobile { display: none; }

@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; padding-top: 16px; }
  .only-mobile { display: inline-flex; }
  .filters { position: fixed; inset: auto 0 0 0; top: auto; z-index: 40; max-height: 86vh; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .22s ease; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .filters.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 39; }
  .hero { padding: 22px 0 24px; }
  .search { padding-left: 12px; }
  .search .btn { padding: 10px 12px; }
  .examples { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .examples button { flex: none; }
  .grid { grid-template-columns: 1fr; }
  .results-bar { flex-direction: column; align-items: stretch; }
  .bar-right { justify-content: space-between; }
}


/* --------------------------------------------------------------------------
   Mobile-first polish
   GoKC is primarily used on phones. These rules intentionally prioritize
   thumb reach, readable cards, bottom-sheet filters, and iPhone safe areas.
   -------------------------------------------------------------------------- */
html { min-width: 320px; background: var(--bg); }
body { min-width: 320px; overflow-x: hidden; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button, .btn, .pill, select { touch-action: manipulation; }
body.filters-open { overflow: hidden; }

@media (pointer: coarse) {
  .btn, .icon-btn, .examples button, .store a { min-height: 44px; }
  .pill { min-height: 38px; }
}

@media (max-width: 860px) {
  body { font-size: 15px; padding-bottom: env(safe-area-inset-bottom); }
  .wrap { width: 100%; max-width: none; padding-left: 14px; padding-right: 14px; }

  /* Compact app-like masthead */
  .top {
    position: sticky;
    top: 0;
    z-index: 32;
    padding-top: env(safe-area-inset-top);
    box-shadow: 0 1px 0 rgba(255,255,255,.08);
  }
  .top-row { height: 50px; }
  .logo { font-size: 20px; gap: 7px; }
  .leaf { width: 20px; height: 20px; }
  .asof { max-width: 52vw; font-size: 11px; line-height: 1.2; }

  /* Put the search experience ahead of decorative space */
  .hero { padding: 17px 0 19px; }
  .hero h1 {
    font-size: clamp(29px, 8.5vw, 38px);
    line-height: 1.01;
    letter-spacing: -.035em;
    margin-bottom: 9px;
    max-width: 560px;
  }
  .hero h1 br { display: none; }
  .hero .sub { font-size: 14px; line-height: 1.42; margin-bottom: 15px; max-width: 560px; }

  .search {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 56px;
    padding: 5px 5px 5px 12px;
    border-radius: 15px;
    box-shadow: 0 5px 18px rgba(0,0,0,.22);
  }
  .search-ic { width: 20px; height: 20px; }
  .search input {
    width: 100%;
    min-width: 0;
    font-size: 16px; /* prevents iOS auto-zoom */
    padding: 10px 0;
  }
  .search .btn {
    min-width: 76px;
    min-height: 44px;
    padding: 9px 13px;
    border-radius: 11px;
  }

  .examples {
    flex-wrap: nowrap;
    gap: 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    margin: 12px -14px 0 0;
    padding: 0 14px 2px 0;
    scrollbar-width: none;
  }
  .examples::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
  .examples button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 8px 12px;
    font-size: 12.5px;
  }

  /* Result controls stay within thumb reach while browsing */
  .main { display: block; padding-top: 10px; padding-bottom: 28px; }
  .results { min-width: 0; }
  .results-bar {
    position: sticky;
    top: calc(50px + env(safe-area-inset-top));
    z-index: 24;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin: 0 -14px;
    padding: 8px 14px 9px;
    background: var(--bg);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .bar-right {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 8px;
    order: 1;
  }
  .bar-right .btn { width: 100%; min-height: 44px; font-size: 14px; }
  .sort { display: block; min-width: 0; }
  .sort > span { display: none; }
  .sort select {
    width: 100%;
    min-height: 44px;
    padding: 9px 34px 9px 11px;
    font-size: 16px;
    background: var(--surface);
  }
  .chips {
    order: 2;
    width: calc(100% + 14px);
    flex-wrap: nowrap;
    flex: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-right: 14px;
    scrollbar-width: none;
  }
  .chip { flex: 0 0 auto; min-height: 34px; }
  .count { margin: 10px 0 10px; font-size: 13px; }
  .notice { margin-bottom: 10px; padding: 10px 12px; }

  /* Product cards read like shopping cards rather than desktop panels */
  .grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card {
    border-radius: 16px;
    padding: 14px;
    gap: 9px;
    box-shadow: 0 1px 2px rgba(20,32,26,.05), 0 3px 12px rgba(20,32,26,.05);
  }
  .card-top { gap: 10px; }
  .cat { font-size: 11px; line-height: 1.3; }
  .deal { font-size: 11.5px; padding: 3px 8px; }
  .pname { font-size: 16.5px; line-height: 1.27; letter-spacing: -.01em; }
  .brand { font-size: 13px; }
  .price { font-size: 25px; }
  .price-row { gap: 7px; }
  .stats { gap: 6px; }
  .stat { padding: 4px 8px; font-size: 12.5px; }
  .store {
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    font-size: 13px;
  }
  .store-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
  .store-sub { margin-top: 2px; line-height: 1.3; }
  .store a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
  }
  .skeleton { height: 205px; }
  .more-wrap .btn { width: 100%; min-height: 46px; }

  /* True mobile bottom sheet for filters */
  .filters {
    position: fixed;
    inset: auto 8px 0 8px;
    z-index: 40;
    width: auto;
    max-height: min(91dvh, 820px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 22px 22px 0 0;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
    transform: translateY(108%);
    transition: transform .22s ease;
    box-shadow: 0 -12px 44px rgba(0,0,0,.30);
  }
  .filters::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 2px auto 7px;
    border-radius: 999px;
    background: var(--line);
  }
  .filters.open { transform: none; }
  .filters-head {
    position: sticky;
    top: -6px;
    z-index: 2;
    margin: 0 -16px;
    padding: 9px 16px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .filters h2 { font-size: 18px; margin: 0; }
  .icon-btn { min-width: 44px; min-height: 44px; }
  .fgroup { padding: 14px 0; gap: 9px; }
  .fgroup h3 { font-size: 11.5px; }
  .filters input[type=number],
  .filters input[type=text],
  .filters select {
    min-height: 46px;
    padding: 10px 11px;
    font-size: 16px; /* prevents iOS auto-zoom */
    border-radius: 11px;
  }
  .filters .btn { min-height: 44px; }
  .pill { padding: 8px 11px; font-size: 13px; }
  .toggle { min-height: 44px; }
  #apply-mobile {
    position: sticky;
    bottom: 0;
    z-index: 3;
    min-height: 48px;
    margin-top: 10px;
    box-shadow: 0 -8px 18px var(--surface);
  }
  .scrim {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  /* Age check fits small screens and safe areas */
  .age { min-height: 100dvh; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
  .age-card { max-width: 370px; padding: 24px 18px; border-radius: 20px; }
  .age-card h2 { font-size: 21px; }
  .age-btns .btn { min-height: 48px; }

  .foot { padding: 18px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 12px; }
}

@media (max-width: 380px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 13.5px; }
  .search { grid-template-columns: 20px minmax(0, 1fr) auto; padding-left: 10px; }
  .search .btn { min-width: 68px; padding-left: 10px; padding-right: 10px; }
  .results-bar { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .bar-right { grid-template-columns: .9fr 1.1fr; }
  .card { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
