/*
  Good Taste Club — design system
  Editorial & Luxury: warm crème, deep navy, champagne accenten.

  Inhoud
  1. Tokens
  2. Basis
  3. Header (merk, navigatie, stedenmenu, olijftak)
  4. Filterbalk
  5. Resultaten (teller, sorteren, kaarten)
  6. Kaart (Leaflet, pins, clusters, legenda)
  7. Detailpaneel
  8. Weergavemodi (Kaart / Lijst / Favorieten)
  9. Responsive

  Breakpoints (CSS-variabelen werken niet in media queries, daarom hier vastgelegd):
  - >= 1400px  filterbalk op één rij
  - 921-1399px filterbalk op twee rijen, kaart en lijst naast elkaar
  - <= 920px   mobiel: tabbalk onderaan, Kaart of Lijst op volle breedte
  (app.js gebruikt dezelfde 920px-grens via matchMedia)
*/

/* 1. Tokens ------------------------------------------------------------- */
:root {
  /* Kleur */
  --cream: #fbf8f2;
  --cream-deep: #f3ede1;
  --white: #fff;
  --navy: #1f3338;
  --navy-soft: #3f5358;
  --muted: #7b807d;
  --champagne: #b38f64;
  --champagne-deep: #8a6a45;
  --champagne-soft: #eadfcc;
  --sage-soft: #dde3d8;
  --sage-deep: #4b6256;
  --rose: #b4585f;
  --gold: #d4a03a;
  --border: #e7e0d3;
  --border-strong: #d7cab6;

  /* Categorie-kleuren (pins en legenda) */
  --cat-restaurant: #a56f47;
  --cat-bar: #7b3d44;
  --cat-coffee: #2e4a46;
  --cat-bakery: #b49a78;
  --cat-other: #6c665b;

  /* Typografie */
  --font-sans: 'DM Sans', Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Vorm en diepte */
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(31, 51, 56, .05);
  --shadow-md: 0 8px 24px rgba(31, 51, 56, .07);
  --shadow-lg: 0 22px 60px rgba(24, 38, 43, .2);

  /* Layout */
  --tabbar-h: 66px;
}

/* 2. Basis -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--navy);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: 2px; }

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 3. Header ------------------------------------------------------------- */
.site-head {
  position: relative;
  z-index: 30;
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) auto minmax(0, .9fr);
  align-items: center;
  column-gap: var(--space-5);
  min-height: 136px;
  padding: 20px 36px 18px;
  background: linear-gradient(180deg, #fbf8f2 0%, #f6f0e4 100%);
  border-bottom: 1px solid var(--border);
}
.olive-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.olive-photo {
  position: absolute;
  top: -12px;
  right: -14px;
  width: clamp(250px, 26vw, 370px);
  height: auto;
  user-select: none;
}

.site-brand { position: relative; min-width: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--champagne-deep);
}
.site-title {
  margin: 6px 0 8px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(38px, 3.4vw, 50px);
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--navy);
}
.site-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
}
.byline-sign {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--navy-soft);
}
.byline-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
  color: var(--champagne-deep);
}

.site-nav { position: relative; display: flex; gap: var(--space-2); justify-self: center; }
.nav-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 86px;
  padding: 10px 14px 14px;
  background: none;
  border: 0;
  font-size: 13px;
  font-weight: 500;
  color: #8b7e70;
  transition: color .18s;
}
.nav-button .icon { width: 24px; height: 24px; }
.nav-button:hover { color: var(--navy); }
.nav-button.selected { color: var(--navy); font-weight: 600; }
.nav-button.selected .icon { color: var(--champagne-deep); }
.nav-button.selected::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 36px;
  height: 2px;
  margin-left: -18px;
  border-radius: 2px;
  background: var(--champagne);
}

.site-side { position: relative; display: flex; align-items: center; padding-left: clamp(0px, 5.5vw, 96px); }

/* Stedenmenu (rechtsboven) */
.city-menu { position: relative; }
.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  transition: border-color .15s, box-shadow .15s;
}
.city-btn:hover { border-color: var(--champagne); box-shadow: var(--shadow-md); }
.city-btn .icon { width: 18px; height: 18px; color: var(--champagne-deep); }
.city-btn .chevron { width: 16px; height: 16px; color: var(--navy-soft); opacity: .7; transition: transform .18s; }
.city-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.city-list {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  min-width: 250px;
  max-height: min(380px, 60dvh);
  overflow: auto;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.city-list[hidden] { display: none; }
.city-list li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.city-list li:hover,
.city-list li:focus { background: var(--cream-deep); }
.city-list li:focus-visible { outline: 2px solid var(--champagne-deep); outline-offset: -2px; }
.city-name { flex: 1; }
.city-list li[aria-selected="true"] .city-name { font-weight: 600; }
.city-count { font-size: 12px; color: var(--muted); }
.city-check { width: 16px; height: 16px; color: var(--champagne-deep); visibility: hidden; }
.city-list li[aria-selected="true"] .city-check { visibility: visible; }

/* 4. Filterbalk --------------------------------------------------------- */
.app {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(400px, 34%) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-4) 20px;
  padding: 18px 28px 24px;
}
.toolbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 940px) auto;
  align-items: center;
  gap: var(--space-3);
}
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--navy);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field:hover { border-color: var(--border-strong); }
.field:focus-within {
  border-color: var(--champagne);
  box-shadow: 0 0 0 3px rgba(179, 143, 100, .2);
}
.field > .icon { width: 19px; height: 19px; color: var(--champagne-deep); }

.search-field { gap: 10px; padding: 0 16px; }
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14.5px;
  text-overflow: ellipsis;
}
.search-field input::placeholder { color: #8f8a80; opacity: 1; }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }

.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.select-field { position: relative; gap: 8px; padding: 0 10px 0 12px; }
.select-field.is-active { border-color: var(--champagne); background: #fffdf9; }
.select-field select,
.sort select {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 20px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font-size: 13.5px;
  text-overflow: ellipsis;
  cursor: pointer;
}
.field .chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  color: #8f8372;
  pointer-events: none;
}

.reset {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 54px;
  padding: 0 6px;
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--champagne-deep);
  text-decoration: underline;
  text-decoration-color: rgba(138, 106, 69, .4);
  text-underline-offset: 4px;
  white-space: nowrap;
}
.reset:hover { text-decoration-color: currentColor; }
.reset .icon { width: 18px; height: 18px; }

/* 5. Resultaten --------------------------------------------------------- */
.results-pane { grid-column: 1; grid-row: 2; min-height: 0; display: flex; flex-direction: column; }
.counts { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 2px 2px 12px; }
.count { font-family: var(--font-serif); font-size: 14px; line-height: 1.3; color: var(--navy-soft); }
.count strong { margin-right: 3px; font-size: 18px; font-weight: 600; color: var(--navy); }
.count-map { display: block; margin-top: 2px; font-family: var(--font-sans); font-size: 12px; color: var(--muted); }
.sort { flex: none; position: relative; height: 40px; padding: 0 12px; gap: 8px; border-radius: 12px; }
.sort select { font-size: 13px; padding-right: 18px; }
.sort .icon { width: 16px; height: 16px; }
.sort .chevron { width: 14px; height: 14px; margin-top: -7px; }

.results {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-right: -6px;
  padding: 2px 6px 8px 2px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d8cdb9 transparent;
}
.load { padding: 24px 6px; color: var(--muted); }
.noresults {
  margin: 4px 2px;
  padding: 36px 20px;
  text-align: center;
  line-height: 1.7;
  color: var(--muted);
  background: rgba(255, 255, 255, .55);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
}

.place {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 16px;
  padding: 10px 12px 10px 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.place:hover { border-color: #d6c3a8; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.place.active { border-color: var(--champagne); box-shadow: 0 0 0 1px var(--champagne), var(--shadow-md); }

.thumb {
  display: block;
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 11px;
  background: var(--cream-deep);
}
.thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--champagne);
  background: linear-gradient(135deg, #f3ecdf, #e8dec9);
}
.thumb.placeholder .icon { width: 30px; height: 30px; stroke-width: 1.4; }

.placebody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.place-title { font-family: var(--font-serif); font-size: 19px; font-weight: 500; line-height: 1.2; color: var(--navy); }
.place-open {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  text-align: left;
}
/* Hele kaart klikbaar via de titelknop (toetsenbordvriendelijk) */
.place-open::after { content: ''; position: absolute; inset: 0; border-radius: 16px; }
.place-open:focus-visible { outline: 0; }
.place-open:focus-visible::after { outline: 2px solid var(--champagne-deep); outline-offset: 2px; }
.place-sub { font-size: 12.5px; color: var(--muted); }
.place-sub:empty { display: none; }
.place-ratings { display: flex; align-items: center; gap: 14px; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--navy); }
.rate { display: inline-flex; align-items: center; gap: 5px; }
.rate-own .icon { width: 14px; height: 14px; fill: var(--gold); stroke: var(--gold); }
.g-mark {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #4285f4 0 35%, #ea4335 35% 60%, #fbbc05 60% 80%, #34a853 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.place-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: #6f7573; }
.place-meta .price { font-weight: 500; letter-spacing: .04em; color: var(--navy-soft); }

.place-aside {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-2);
  pointer-events: none;
}
.save-heart {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -4px -4px 0 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: #8b8379;
  pointer-events: auto;
  transition: color .15s, background .15s;
}
.save-heart:hover { color: var(--rose); background: #f8eeee; }
.save-heart[aria-pressed="true"] { color: var(--rose); }
.save-heart[aria-pressed="true"] .icon { fill: currentColor; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status .icon { width: 14px; height: 14px; }
.status-visited { background: var(--champagne-soft); color: #6e5638; }
.status-favorite { background: var(--navy); color: var(--white); }
.status-favorite .icon { fill: currentColor; }
.status-wishlist { background: var(--sage-soft); color: var(--sage-deep); }
.status-default { background: #eee9df; color: #6e6a60; }

/* 6. Kaart -------------------------------------------------------------- */
.mapwrap {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #e9ece6;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
#map { position: absolute; inset: 0; width: 100%; height: 100%; background: #e9ece6; }
.leaflet-container { font-family: var(--font-sans); }
/* CARTO Voyager, iets rustiger zodat de kaart bij het crème-palet past */
.leaflet-tile-pane { filter: saturate(.72) sepia(.03) contrast(.97) brightness(1.02); }

.leaflet-bar {
  overflow: hidden;
  border: 0 !important;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31, 51, 56, .14) !important;
}
.leaflet-bar a {
  width: 40px;
  height: 40px;
  line-height: 40px;
  font-size: 20px;
  color: var(--navy) !important;
  background: var(--white);
  border-bottom: 1px solid var(--border) !important;
}
.leaflet-bar a:last-child { border-bottom: 0 !important; }
.leaflet-bar a:hover { background: var(--cream); }
.leaflet-top.leaflet-right .leaflet-control-zoom { margin: 16px 16px 0 0; }
.leaflet-control-attribution { font-size: 10px !important; color: #6b6f6c; background: rgba(251, 248, 242, .85) !important; }

.pin {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--white);
  border-radius: 50% 50% 50% 4px;
  box-shadow: 0 4px 12px rgba(20, 36, 40, .28);
  color: var(--white);
  transform: rotate(-45deg);
  transition: transform .15s;
}
.pin .icon { width: 17px; height: 17px; stroke-width: 2; transform: rotate(45deg); }
.leaflet-marker-icon:hover .pin { transform: rotate(-45deg) scale(1.1); }
.pin.restaurant { background: var(--cat-restaurant); }
.pin.bar { background: var(--cat-bar); }
.pin.coffee { background: var(--cat-coffee); }
.pin.bakery { background: var(--cat-bakery); }
.pin.other { background: var(--white); border-color: #cfc7b8; color: var(--cat-other); }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: rgba(31, 51, 56, .16) !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--navy) !important;
  color: var(--white) !important;
  font-family: var(--font-sans);
  font-weight: 600 !important;
  border: 2px solid var(--white);
  box-shadow: 0 3px 10px rgba(20, 36, 40, .3);
}

.map-legend {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 9px 20px 9px 10px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  font-weight: 500;
}
.map-legend li { display: flex; align-items: center; gap: 8px; }
.lg { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--white); }
.lg .icon { width: 14px; height: 14px; stroke-width: 2; }
.lg-restaurant { background: var(--cat-restaurant); }
.lg-bar { background: var(--cat-bar); }
.lg-coffee { background: var(--cat-coffee); }
.lg-bakery { background: var(--cat-bakery); }
.lg-other { background: var(--white); color: var(--cat-other); border: 1.5px solid #cfc7b8; }

.map-notice {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 600;
  padding: 8px 16px;
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  transform: translateX(-50%);
}
.map-notice[hidden] { display: none; }
.map-fab { display: none; }

/* 7. Detailpaneel ------------------------------------------------------- */
.detail {
  position: fixed;
  z-index: 1200;
  top: 200px; /* desktop: app.js zet dit onder de filterbalk */
  right: 28px;
  bottom: 28px;
  display: none;
  width: min(410px, calc(100vw - 56px));
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.detail.show { display: block; }
.detail-scroll { height: 100%; overflow: auto; }
.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--white);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .18);
  color: var(--navy);
}
.detail-close:hover { background: var(--cream); }
.detail-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #f1e9db, #e3d8c3); }
.detail-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--champagne); }
.cover-placeholder .icon { width: 56px; height: 56px; stroke-width: 1.2; }
.detail-content { padding: 22px 24px 28px; }
.detail-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--champagne-deep); }
.detail-content h2 { margin: 8px 0 6px; font-family: var(--font-serif); font-size: 30px; font-weight: 500; line-height: 1.15; letter-spacing: -.01em; }
.detail-meta { font-size: 13px; line-height: 1.7; color: var(--muted); }
.detail-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 16px 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  background: #f1ebe0;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  color: #6e5a43;
}
.chip .icon { width: 13px; height: 13px; fill: var(--gold); stroke: var(--gold); }
.chip-own { background: #f6e9d3; color: #80592a; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { font-size: 12px; color: var(--muted); }
.stat strong { display: block; margin-top: 4px; font-family: var(--font-serif); font-size: 22px; font-weight: 600; color: var(--navy); }
.detail-note { margin-top: 18px; font-size: 14px; line-height: 1.7; }
.note-label { margin-bottom: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--champagne-deep); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  transition: border-color .15s, box-shadow .15s;
}
.action:hover { border-color: var(--champagne); box-shadow: var(--shadow-md); }
.action .icon { width: 15px; height: 15px; }
.action.primary { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* 8. Weergavemodi ------------------------------------------------------- */
body.list-mode .app,
body.saved-only .app { grid-template-columns: minmax(0, 1fr); }
body.list-mode .mapwrap,
body.saved-only .mapwrap { display: none; }
body.list-mode .results,
body.saved-only .results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  align-content: start;
  gap: var(--space-3);
}

/* 9. Responsive --------------------------------------------------------- */
/* Smalle lijstkolom naast de kaart: kleinere miniatuur, zodat "stad · categorie" op één regel past */
@media (min-width: 921px) and (max-width: 1199px) {
  body:not(.list-mode):not(.saved-only) .place { grid-template-columns: 112px minmax(0, 1fr) auto; gap: 6px 12px; }
  body:not(.list-mode):not(.saved-only) .thumb { width: 112px; }
  /* Smallere kaart: legenda compacter zodat hij op één regel blijft */
  .map-legend { left: 12px; bottom: 12px; gap: 6px 10px; padding: 6px 12px 6px 6px; font-size: 11.5px; }
  .map-legend li { gap: 5px; }
  .lg { width: 22px; height: 22px; }
  .lg .icon { width: 12px; height: 12px; }
}

@media (max-width: 1399px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .filters { grid-column: 1 / -1; grid-row: 2; }
  .app { grid-template-columns: minmax(440px, 38%) minmax(0, 1fr); }
  .select-field select { font-size: 13px; }
}

@media (max-width: 920px) {
  /* Header: compact merk + stedenknop; navigatie wordt tabbalk */
  .site-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 0; padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .eyebrow, .byline-tag { display: none; }
  .site-title { margin: 0 0 3px; font-size: 30px; }
  .byline-sign { font-size: 9.5px; }
  .olive-photo { top: -26px; right: -42px; width: 210px; opacity: .92; }
  .site-side { padding: 0; }
  .city-btn { height: 40px; padding: 0 12px; gap: 8px; font-size: 13px; }
  #quickCityLabel { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .city-list { right: 0; left: auto; min-width: 230px; }

  .site-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0 8px env(safe-area-inset-bottom);
    background: rgba(251, 248, 242, .97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(31, 51, 56, .06);
    backdrop-filter: blur(10px);
  }
  .nav-button { min-width: 0; height: var(--tabbar-h); gap: 4px; padding: 9px 4px 8px; font-size: 11.5px; }
  .nav-button .icon { width: 22px; height: 22px; }
  .nav-button.selected::after { top: 0; bottom: auto; width: 32px; margin-left: -16px; }

  /* Inhoud: filterbalk bovenaan, daarna Kaart of Lijst op volle breedte */
  .app { display: flex; flex-direction: column; gap: 0; padding: 0 0 calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .toolbar { flex: none; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 14px 12px; background: var(--cream); border-bottom: 1px solid var(--border); }
  .field { height: 48px; border-radius: 13px; }
  .search-field input { font-size: 16px; }
  .filters {
    display: flex;
    gap: var(--space-2);
    margin: 0 -14px;
    padding: 0 14px 2px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .select-field { flex: none; width: 204px; height: 44px; scroll-snap-align: start; }
  .select-field select { font-size: 16px; }
  .reset { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 13px; text-decoration: none; }
  .reset-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .reset .icon { width: 22px; height: 22px; }

  .results-pane { flex: 1; }
  body:not(.list-mode):not(.saved-only) .results-pane { display: none; }
  .counts { padding: 12px 16px 8px; }
  .results { margin: 0; padding: 0 14px 18px; }
  body.list-mode .results,
  body.saved-only .results { display: flex; }
  .place { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 10px 8px 8px; }
  .thumb { width: 96px; }
  .place-title { font-size: 17px; }
  .status { height: 28px; padding: 0 12px; font-size: 12px; }

  .mapwrap { flex: 1; border: 0; border-radius: 0; box-shadow: none; }
  .map-legend { top: 12px; bottom: auto; left: 12px; gap: 4px 6px; padding: 6px 8px; }
  .lg-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .leaflet-top.leaflet-right .leaflet-control-zoom { margin: 12px 12px 0 0; }
  .map-fab {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 600;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 46px;
    padding: 0 20px;
    background: var(--navy);
    border: 0;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-lg);
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    transform: translateX(-50%);
  }

  /* Details als bottom sheet */
  .detail {
    top: auto !important;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 80dvh;
    border-bottom: 0;
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .detail-scroll { max-height: 80dvh; }
  .detail-content { padding: 18px 20px 28px; }
  .detail-content h2 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
