/* SnackWhere website. Colours match the app: teal #0f8a8a, orange #f08424.
   Light and dark follow the visitor's device. */

:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --border: #e7e2d8;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f8a8a;
  --primary-dark: #0c5454;
  --primary-soft: #e3f5f5;
  --accent: #f08424;
  --accent-soft: #fdecdc;
  --star: #f5a623;
  --danger: #b91c1c;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
  --shadow-lift: 0 8px 30px rgba(15, 23, 42, 0.14);
  --cat-snack: #f08424;
  --cat-drink: #0f8a8a;
  --cat-coffee: #92400e;
  --cat-other: #64748b;
  --radius: 22px;
  --radius-sm: 12px;
  --header-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1418;
    --surface: #182027;
    --border: #2b353e;
    --text: #f1f5f9;
    --muted: #9aa7b4;
    --primary: #1fa7a7;
    --primary-dark: #7fdcdc;
    --primary-soft: #123a3c;
    --accent: #f59a4a;
    --accent-soft: #3a2a19;
    --star: #f5b33b;
    --danger: #f87171;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 8px 30px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand img { height: 30px; width: auto; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--primary-soft); }
.nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.nav .nav-soon { color: var(--muted); cursor: default; }
.nav .nav-soon:hover { background: none; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 20px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; padding: 10px 20px 16px;
    background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

.site-footer { margin-top: 80px; border-top: 1px solid var(--border); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }
.footer-brand img { height: 24px; width: auto; margin-bottom: 10px; }

/* ---------- Buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.btn-small { padding: 9px 16px; font-size: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--cat-other); }
.dot.snack { background: var(--cat-snack); } .dot.drink { background: var(--cat-drink); }
.dot.coffee { background: var(--cat-coffee); } .dot.other { background: var(--cat-other); }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: var(--primary-soft); color: var(--primary);
}
.badge.snack { color: var(--cat-snack); background: color-mix(in srgb, var(--cat-snack) 14%, transparent); }
.badge.drink { color: var(--cat-drink); background: color-mix(in srgb, var(--cat-drink) 14%, transparent); }
.badge.coffee { color: var(--cat-coffee); background: color-mix(in srgb, var(--cat-coffee) 14%, transparent); }
.badge.other { color: var(--cat-other); background: color-mix(in srgb, var(--cat-other) 14%, transparent); }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }

/* ---------- Home ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero-logo { width: min(520px, 86%); margin: 0 auto 28px; }
.hero h1 { font-size: clamp(32px, 5.4vw, 54px); font-weight: 900; margin-bottom: 16px; }
.hero p.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 680px; margin: 0 auto 28px; }
.search-row {
  display: flex; gap: 10px; max-width: 640px; margin: 0 auto 18px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 6px 6px 6px 22px;
  box-shadow: var(--shadow);
}
.search-row input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 17px; color: var(--text); min-width: 0; outline: none; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 26px; box-shadow: var(--shadow); min-width: 150px; }
.stat b { display: block; font-size: 30px; color: var(--primary); line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }

section.block { padding: 56px 0; }
section.block > .wrap > h2 { font-size: clamp(26px, 3.4vw, 34px); text-align: center; margin-bottom: 8px; }
section.block > .wrap > .sub { text-align: center; color: var(--muted); max-width: 640px; margin: 0 auto 36px; }
.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.card .icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); font-size: 24px; margin-bottom: 14px;
}
.card h3 { font-size: 19px; }
.card p:last-child { margin-bottom: 0; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist li::before { content: "✓"; color: #fff; background: var(--primary); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; flex: none; margin-top: 2px; }
.split { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; align-items: center; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.soon-pill { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 12px; border-radius: 999px; padding: 4px 12px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.store-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Documents (terms, privacy, contact) ---------- */
.doc { max-width: 760px; padding: 48px 0 0; }
.doc h1 { font-size: 36px; }
.doc h2 { font-size: 22px; margin-top: 1.8em; }
.doc .draft { background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 8px; margin-bottom: 28px; font-size: 14px; }
.doc ul, .doc ol { padding-left: 1.2em; } .doc li { margin-bottom: 0.4em; }

/* ---------- Map page ---------- */
body.map-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.map-page .site-footer { display: none; }
.map-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px 1fr; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-right: 1px solid var(--border); position: relative; z-index: 2; }
.side-top { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.side-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 4px 14px; }
.side-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 9px 0; outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.side-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.side-meta button { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 800; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 13px; }
.list { flex: 1; overflow-y: auto; padding: 12px 14px 24px; display: grid; gap: 10px; align-content: start; }
.item {
  text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow);
}
.item:hover, .item.active { border-color: var(--primary); }
.item .row { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item h3 { font-size: 16px; margin: 0; }
.item p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.item .dist { color: var(--primary); font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; }
.map-note { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; max-width: calc(100% - 28px); text-align: center; }
.mapboxgl-ctrl-attrib { font-size: 10px; }

.detail { flex: 1; overflow-y: auto; padding: 14px 16px 28px; display: none; }
.detail.show { display: block; }
.back { background: none; border: 0; color: var(--primary); font: inherit; font-weight: 800; cursor: pointer; padding: 4px 0 10px; font-size: 14px; }
.detail h2 { font-size: 24px; margin-bottom: 6px; }
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 6px; }
.facts { display: grid; gap: 14px; margin-top: 20px; }
.fact { display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--border); }
.fact label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.reviews h3 { font-size: 18px; margin-top: 26px; }
.review { padding: 14px 0; border-top: 1px solid var(--border); }
.review .who { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.review .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; object-fit: cover; }
.review small { color: var(--muted); }
.review p { margin: 6px 0 0; }
.app-cta { margin-top: 22px; padding: 14px 16px; background: var(--primary-soft); border-radius: var(--radius-sm); font-size: 14px; }

@media (max-width: 860px) {
  .map-layout { grid-template-columns: 1fr; grid-template-rows: 1fr; position: relative; }
  .map-wrap { grid-area: 1 / 1; }
  .side {
    grid-area: 1 / 1; align-self: end; z-index: 5;
    height: 52vh; max-height: 52vh; border-right: 0; border-top: 1px solid var(--border);
    border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
    transition: height 0.2s ease, max-height 0.2s ease;
  }
  .side.collapsed { height: 112px; max-height: 112px; }
  .side.collapsed .list, .side.collapsed .detail, .side.collapsed .chips, .side.collapsed .side-meta { display: none; }
  .side.full { height: calc(100dvh - var(--header-h) - 16px); max-height: none; }
  .grab { display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--border); margin: 8px auto 0; cursor: pointer; }
}
.grab { display: none; }

/* ---------- Machine page ---------- */
.machine-page { padding: 32px 0 0; max-width: 860px; }
.machine-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.machine-hero .mini-map { height: 260px; background: var(--primary-soft); }
.machine-hero .body { padding: 26px; }
.machine-hero h1 { font-size: clamp(26px, 4vw, 36px); }
.crumbs { font-size: 14px; margin-bottom: 14px; }
.crumbs a { text-decoration: none; font-weight: 700; }
.machine-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 20px; }
.notfound { text-align: center; padding: 80px 0; }

/* Nav entries that aren't live yet */
.nav span.nav-soon { padding: 8px 14px; font-weight: 600; font-size: 15px; color: var(--muted); }

.machine-hero .meta-row { margin-bottom: 14px; }

.area-note { font-size: 13px; margin: 0 2px 2px; }
.list .back { justify-self: start; }

/* A machine's own icon, when its business has set one */
.mi { width: 40px; height: 40px; border-radius: 11px; object-fit: cover; flex: none; background: var(--primary-soft); }
.mi-big { width: 56px; height: 56px; border-radius: 15px; }
.item-main { display: flex; gap: 12px; align-items: flex-start; }
.item-text { flex: 1; min-width: 0; }
.title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.title-row h1, .title-row h2 { margin: 0; }
