:root {
  --ah: #0096db;
  --ah-dark: #007ab8;
  --ink: #1f3d38;
  --muted: #6b7a76;
  --bozu: #f25a0e;
  --black: #0b0b0b;
  --yellow: #ffc93f;
  --bg: #f4f6f8;
  --line: #e3e7ec;
  --shadow: 0 2px 12px rgba(31,61,56,.14);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
#topbar {
  background: #fff;
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 1100;
}
.brand { display: flex; align-items: center; gap: 9px; font-family: "Helvetica Neue", "Arial Black", system-ui, sans-serif; }
.logo {
  color: var(--bozu);
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.logo svg {
  height: 28px;
  width: auto;
  display: block;
}
.x { font-size: 18px; color: #9aa3ad; font-weight: 700; }
.ah { font-weight: 900; font-size: 24px; color: var(--ah); letter-spacing: -.5px; }
.actie {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 16px auto 4px;
  padding: 5px 11px 4px;
  background: var(--black);
  color: #fff;
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transform: rotate(-2.5deg);
  transform-origin: center center;
  font-family: "Helvetica Neue", "Arial Black", system-ui, sans-serif;
}
.tagline { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* Search */
#searchbar {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 1100;
}
.search-input-wrap { position: relative; flex: 1; }
#search {
  width: 100%;
  height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 38px 0 14px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}
#search:focus { border-color: var(--ah); }
#clearbtn {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  border: none; background: #eef1f4;
  border-radius: 50%;
  font-size: 18px; line-height: 1;
  color: #6b7480; cursor: pointer;
  display: none;
}
#clearbtn.show { display: block; }
#geobtn {
  width: 44px; height: 44px;
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: var(--ah);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#geobtn:active { background: #f0f4f7; }

/* Suggestions */
#suggestions {
  position: absolute;
  top: 48px; left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1200;
  display: none;
}
#suggestions.show { display: block; }
#suggestions li {
  padding: 11px 14px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f5;
}
#suggestions li:last-child { border-bottom: none; }
#suggestions li:active, #suggestions li.active { background: #eef7fc; }
#suggestions li .type { font-size: 11px; color: #97a0ab; margin-left: 6px; }

/* Map */
main { flex: 1; position: relative; overflow: hidden; }
#map { position: absolute; inset: 0; }

/* Results panel — bottom sheet */
#panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(20,33,61,.18);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  max-height: 62%;
  transition: transform .25s ease;
}
#panel.collapsed { transform: translateY(calc(100% - 92px)); }
#panel-handle {
  padding: 9px 0 4px;
  display: flex; justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.grip { width: 38px; height: 4px; background: #d4d9df; border-radius: 3px; }
#panel-head {
  padding: 4px 18px 10px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
#result-count { font-size: 14px; font-weight: 700; display: block; }
.panel-sub {
  display: block;
  font-size: 11.5px;
  color: #97a0ab;
  text-decoration: none;
  margin-top: 3px;
}
.panel-sub:hover { color: var(--bozu); }
#results {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.store {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f3f5;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.store:active { background: #f6f8fa; }
.store .rank {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  background: var(--ah);
  color: #fff;
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.store.nearest .rank { background: var(--bozu); }
.store-body { flex: 1; min-width: 0; }
.store-name { font-size: 14.5px; font-weight: 700; }
.store-addr { font-size: 13px; color: #5b6573; margin-top: 1px; }
.store-meta {
  margin-top: 6px;
  display: flex; align-items: center; gap: 10px;
}
.store-dist {
  font-size: 13px; font-weight: 700;
  color: var(--ink);
}
.store.nearest .store-dist { color: var(--bozu); }
.route-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ah);
  text-decoration: none;
  border: 1px solid var(--ah);
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
}
.route-link:active { background: #eef7fc; }
.pop-route {
  display: inline-block;
  margin-top: 6px;
  color: var(--ah);
  font-weight: 600;
  text-decoration: none;
}

/* Marker pin */
.pin {
  width: 26px; height: 26px;
  background: var(--ah);
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
}
.pin.hl { background: var(--bozu); width: 32px; height: 32px; z-index: 999; }
.leaflet-popup-content { font-size: 13px; line-height: 1.45; }
.leaflet-popup-content b { font-size: 14px; }
.pop-meta { color: #97a0ab; font-size: 12px; }

/* desktop */
@media (min-width: 760px) {
  .actie {
    margin-left: 0;
    margin-right: auto;
  }
  #panel {
    left: auto; right: 16px; bottom: 16px;
    width: 360px;
    max-height: calc(100% - 32px);
    border-radius: 14px;
  }
  #panel.collapsed { transform: translateY(calc(100% - 52px)); }
  #panel-handle { display: none; }
  #panel-head { border-radius: 14px 14px 0 0; padding: 14px 18px; cursor: pointer; }
  .tagline { font-size: 13px; }
}
