/* London & Middlesex Food Map — styles */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --g900: #1a3d28;
  --g700: #2d5a3d;
  --g500: #4a7c5a;
  --g200: #c8dfc8;
  --g100: #edf5ed;
  --g50:  #f5faf5;
  --a700: #a85518;
  --a200: #f0d4b0;
  --a100: #faf0e4;
  --ink:  #1c1814;
  --mid:  #56493e;
  --light:#9c8f83;
  --faint:#c8beb4;
  --border:#e0d8cf;
  --paper:#faf8f4;
  --canvas:#f3efe8;
}

html, body { height: 100%; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font: inherit; color: inherit; }
button { background: none; border: none; padding: 0; cursor: pointer; }
a { color: inherit; }

#root { height: 100%; }

.serif { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; }
.label-eyebrow {
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--light);
}

/* ── APP SHELL ───────────────────────────────────────────────── */

.app {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  height: 100%;
  background: white;
}
@media (min-width: 900px) {
  .app {
    grid-template-columns: 380px 1fr;
    grid-template-rows: 64px 1fr;
  }
}

/* ── TOP NAV (desktop) ───────────────────────────────────────── */

.topnav {
  display: none;
}
@media (min-width: 900px) {
  .topnav {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    background: white;
    border-bottom: 1px solid var(--border);
    z-index: 30;
  }
}
.topnav-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.topnav-spacer { flex: 1; }
.topnav-link {
  font-size: 13px; color: var(--mid); padding: 6px 0;
}
.topnav-link:hover { color: var(--ink); }

/* ── MOBILE STATUS BAR (visual cue when standalone) ──────────── */

.m-statusbar {
  display: none;
}

/* ── PANEL (sidebar/main) ────────────────────────────────────── */

.panel {
  background: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
@media (min-width: 900px) {
  .panel {
    border-right: 1px solid var(--border);
  }
}

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── STAGE / MAP HOST ────────────────────────────────────────── */

.stage {
  position: relative;
  background: #e2ece0;
  overflow: hidden;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #e2ece0;
}

/* leaflet overrides */
.leaflet-container {
  background: #e2ece0 !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
}
.leaflet-control-attribution {
  background: rgba(255,255,255,0.85) !important;
  font-size: 10px !important;
  color: var(--light) !important;
}
.leaflet-control-attribution a { color: var(--mid) !important; }
.leaflet-control-zoom a {
  background: white !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  font-family: 'DM Sans', sans-serif !important;
}

/* ── PIN MARKER ──────────────────────────────────────────────── */

.pin {
  position: relative;
  transform-origin: bottom center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
  transition: transform .15s;
}
.pin:hover { transform: translateY(-3%) scale(1.06); }
.pin.is-active { transform: translateY(-3%) scale(1.15); z-index: 1000; }
.pin svg { display: block; }

.pin-dimmed { opacity: 0.28; }

/* user dot */
.user-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--g700);
  border: 2.5px solid white;
  box-shadow: 0 0 0 4px var(--g200);
}

/* ── PILLS & CHIPS ───────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--g100);
  color: var(--g700);
  border: 1px solid var(--g200);
  white-space: nowrap;
}
/* pill category colors applied via inline style from categories.csv */

.chip {
  font-size: 13px; font-weight: 500;
  padding: 8px 14px;
  background: white;
  color: var(--mid);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--mid); color: var(--ink); }
.chip.is-active {
  background: var(--g700); color: white; border-color: var(--g700); font-weight: 600;
}

/* ── BUTTONS ─────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; font-weight: 600;
  padding: 13px 20px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--mid); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--g700); color: white; border-color: var(--g700);
  box-shadow: 0 4px 16px rgba(45,90,61,0.22);
}
.btn-primary:hover { background: var(--g900); border-color: var(--g900); }
.btn-pill { border-radius: 100px; padding: 10px 18px; font-size: 13px; font-weight: 500; }
.btn-amber {
  background: var(--a700); color: white; border-color: var(--a700);
}
.btn-ghost { background: transparent; }

/* ── SEARCH ──────────────────────────────────────────────────── */

.search {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}
.search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--ink);
}
.search input::placeholder { color: var(--faint); }

/* ── CARDS ───────────────────────────────────────────────────── */

.card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.card:hover { border-color: var(--mid); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.card:active { transform: scale(0.997); }
.card.is-active { border-color: var(--g700); background: var(--g50); }

.card-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.card-meta { font-size: 13px; color: var(--mid); }
.card-faint { font-size: 12px; color: var(--light); }
.card-distance { font-size: 12px; font-weight: 600; color: var(--g700); white-space: nowrap; }
.card-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.card-cat {
  border-left: 4px solid var(--border);
}
/* card-cat border-left color applied via inline style from categories.csv */

/* category tile (home) */
.cat-tile {
  display: flex; align-items: center; gap: 14px;
  background: white;
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  text-align: left;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.cat-tile:hover { background: var(--paper); border-color: var(--mid); }
.cat-tile:active { transform: scale(0.99); }
.cat-tile .cat-label { flex: 1; font-size: 15px; font-weight: 600; color: var(--ink); }
.cat-tile .cat-count { font-size: 12px; color: var(--light); font-weight: 500; }
/* cat-tile border-left color applied via inline style from categories.csv */

.cat-swatch {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--canvas);
}
/* cat-swatch colors applied via inline style from categories.csv */

/* ── HOME ────────────────────────────────────────────────────── */

.home-wrap {
  display: flex; flex-direction: column;
  padding: 24px 22px 28px;
  gap: 22px;
  min-height: 100%;
}
.home-hero h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.home-hero .eyebrow { margin-bottom: 6px; }

.home-divider {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--faint);
}
.home-divider::before, .home-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.home-footer {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--light);
}

/* ── BROWSE / LIST ──────────────────────────────────────────── */

.subhead {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
  min-height: 60px;
}
.backbtn {
  width: 36px; height: 36px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--mid);
  flex-shrink: 0;
}
.backbtn:hover { background: white; border-color: var(--mid); color: var(--ink); }
.subhead-title { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.subhead-sub { font-size: 12px; color: var(--light); }

.filterbar {
  display: flex; gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
  scrollbar-width: none;
}
.filterbar::-webkit-scrollbar { display: none; }

.list {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 14px 16px 20px;
}

.empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--light);
  font-size: 13px;
}

/* ── MAP OVERLAYS (mobile) ──────────────────────────────────── */

.map-overlay {
  position: absolute;
  z-index: 30;
  pointer-events: none;
}
.map-overlay > * { pointer-events: auto; }

.map-search-row {
  top: 12px; left: 12px; right: 12px;
  display: flex; align-items: center; gap: 8px;
}
.map-iconbtn {
  width: 40px; height: 40px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--mid);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.map-search {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 9px 16px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.map-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px;
}
.map-search input::placeholder { color: var(--faint); }

.nearme-pill {
  position: absolute;
  top: 64px; left: 50%; transform: translateX(-50%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  font-size: 13px; font-weight: 500; color: var(--ink);
  z-index: 30;
  cursor: pointer;
  white-space: nowrap;
}

.map-filters {
  position: absolute;
  bottom: 104px; /* just above the sheet peek; sheet slides over these when open */
  left: 0; right: 0;
  padding: 0 12px;
  z-index: 30;
}
.map-filters .filterbar {
  border: none; background: transparent; padding: 0;
}
.map-filters .chip {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ── BOTTOM SHEET ────────────────────────────────────────────── */

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: white;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
  z-index: 40;
  transform: translateY(calc(100% - var(--sheet-peek, 92px)));
  transition: transform .28s cubic-bezier(.4,.0,.2,1);
  display: flex;
  flex-direction: column;
  max-height: 52%;
  min-height: var(--sheet-peek, 92px);
}
.sheet.is-open   { transform: translateY(0); }
.sheet.is-detail {
  transform: translateY(0);
  max-height: 60vh;
}
.sheet-handle {
  display: flex; justify-content: center; padding: 10px 0 6px;
  flex-shrink: 0; cursor: grab;
  touch-action: none;
}
.sheet-handle > span {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.sheet-head {
  padding: 4px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.sheet-head-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.sheet-head-action { font-size: 13px; font-weight: 500; color: var(--g700); }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 14px 20px; }
.sheet-body .list { padding: 0; gap: 10px; }

/* ── DETAIL ──────────────────────────────────────────────────── */

.detail-wrap {
  padding: 14px 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.detail-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.detail-title {
  font-size: 22px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.detail-row {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px; color: var(--mid);
  padding: 4px 0;
}
.detail-row .row-icon {
  width: 18px; flex-shrink: 0; text-align: center;
  color: var(--light); padding-top: 1px;
}
.detail-row strong { color: var(--ink); font-weight: 600; }

.detail-actions {
  display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap;
}

.detail-correction {
  background: var(--a100);
  border: 1.5px solid var(--a200);
  border-radius: 14px;
  padding: 16px 18px;
}
.detail-correction h3 {
  font-size: 14px; font-weight: 600; color: var(--a700);
  margin-bottom: 4px;
}
.detail-correction p {
  font-size: 13px; color: var(--mid); margin-bottom: 12px;
}
.detail-correction textarea {
  width: 100%;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  resize: vertical;
  min-height: 70px;
  margin-bottom: 10px;
  outline: none;
  font-family: inherit;
}
.detail-correction textarea:focus { border-color: var(--a700); }

/* ── DESKTOP RESULTS PANEL ───────────────────────────────────── */

.results-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
}

/* ── INSTALL HINT ────────────────────────────────────────────── */

.install-hint {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  background: white;
  border: 1.5px solid var(--g200);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.14);
  z-index: 80;
  font-size: 13px;
  max-width: 420px;
  margin: 0 auto;
}
.install-hint strong { color: var(--g700); }
.install-hint button.close {
  margin-left: auto; color: var(--light); font-size: 18px; padding: 0 4px;
}

/* ── TOAST ───────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: white;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0,0,0,0.20);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── DEMO BANNER ─────────────────────────────────────────────── */

.demo-banner {
  position: fixed;
  right: 12px; bottom: 12px;
  background: var(--ink);
  color: rgba(255,255,255,0.9);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 100px;
  z-index: 60;
  pointer-events: none;
  opacity: 0.7;
}
@media (min-width: 900px) { .demo-banner { display: none; } }

/* ── DESKTOP SUBHEAD (no back btn, used for filterbar header) ── */
@media (min-width: 900px) {
  .subhead.is-mobile-only { display: none; }
}

/* ── MOBILE-ONLY / DESKTOP-ONLY ──────────────────────────────── */

.mobile-only { display: block; }
.desktop-only { display: none; }
@media (min-width: 900px) {
  .mobile-only { display: none !important; }
  .desktop-only { display: block; }
  .desktop-only.flex { display: flex; }
}
