/* ============================================================
   Nautische Nomade — Zoeken (veld + chips + resultaten + pins)
   Zit bovenin het kaartpaneel en in de mobiele sheet.
   ============================================================ */

.nn-zoek {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* In het paneel staat het zoeken altijd bovenaan — ook als er een plek is
   gekozen en .kaart-detail met order:-1 naar boven springt. */
#zoekDesktop {
  order: -2;
  margin-bottom: 22px;
}

/* In de mobiele sheet zit het zoeken bovenin het intro-blok */
.kaart-sheet__pad .nn-zoek { margin-bottom: 20px; }
.kaart-sheet__pad .nn-zoek__lijst { max-height: 40svh; }

/* ---- Het invoerveld ---- */

.nn-zoek__veld {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid rgba(239, 230, 214, 0.18);
  background: rgba(239, 230, 214, 0.06);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nn-zoek__veld:focus-within {
  border-color: var(--terracotta-500);
  background: rgba(239, 230, 214, 0.09);
}
.nn-zoek__veld > svg {
  flex: none;
  color: rgba(239, 230, 214, 0.45);
}
.nn-zoek__veld:focus-within > svg { color: var(--terracotta-400); }

.nn-zoek__veld input {
  flex: 1;
  min-width: 0;
  padding: 11px 0;
  border: none;
  background: transparent;
  color: #F4EEE2;
  font: inherit;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}
.nn-zoek__veld input::placeholder { color: rgba(239, 230, 214, 0.4); }
.nn-zoek__veld input:focus { outline: none; }
/* Het kruisje van de browser zelf weg — we hebben er zelf één */
.nn-zoek__veld input::-webkit-search-cancel-button { -webkit-appearance: none; }

.nn-zoek__veld button {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 230, 214, 0.12);
  color: rgba(239, 230, 214, 0.75);
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.nn-zoek__veld button:hover { background: var(--terracotta-500); color: #FBF3EC; }

/* ---- Categorie-chips ---- */

.nn-zoek__chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin: 0 -2px;
  padding-left: 2px;
  padding-right: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nn-zoek__chips::-webkit-scrollbar { display: none; }

.nn-zoek__chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(239, 230, 214, 0.16);
  background: transparent;
  color: rgba(239, 230, 214, 0.7);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nn-zoek__chip i {
  font-style: normal;
  display: inline-flex;
  align-items: center;
  line-height: 0;
  color: var(--chip);
}
/* Actieve chip: de knop kleurt vol, de glyph moet dan juist contrasteren. */
.nn-zoek__chip.is-active i { color: inherit; }
.nn-zoek__chip:hover {
  border-color: rgba(239, 230, 214, 0.35);
  color: #F4EEE2;
}
/* De actieve chip neemt de kleur van zijn eigen categorie aan (--chip staat
   op de knop) — zo zie je in één oogopslag waar de pins op de kaart bij horen. */
.nn-zoek__chip.is-active {
  background: var(--chip, var(--terracotta-500));
  border-color: transparent;
  color: #FBF3EC;
}

/* ---- Resultaten ---- */

.nn-zoek__res:empty { display: none; }

.nn-zoek__hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(239, 230, 214, 0.45);
  padding: 2px 2px 0;
}

.nn-zoek__kop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 7px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(239, 230, 214, 0.5);
}

.nn-zoek__lijst {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 230, 214, 0.16) transparent;
  /* ruimte voor de scrollbar zodat hij niet over de afstand valt */
  padding-right: 2px;
}

.nn-zoek__hit {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: rgba(239, 230, 214, 0.04);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.nn-zoek__hit:hover {
  background: rgba(239, 230, 214, 0.09);
  border-color: rgba(239, 230, 214, 0.16);
}
.nn-zoek__hit.is-active {
  background: rgba(194, 90, 61, 0.16);
  border-color: rgba(194, 90, 61, 0.55);
}

.nn-zoek__hit-glyph {
  flex: none;
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  color: var(--chip);
  background: color-mix(in srgb, var(--chip) 26%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip) 55%, transparent);
}

.nn-zoek__hit-tekst {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.nn-zoek__hit-tekst strong {
  font-size: 13px;
  font-weight: 600;
  color: #F4EEE2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nn-zoek__hit-tekst small {
  font-size: 11px;
  color: rgba(239, 230, 214, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nn-zoek__hit-afst {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(239, 230, 214, 0.6);
}
.nn-zoek__hit.is-active .nn-zoek__hit-afst { color: var(--terracotta-200); }

.nn-zoek__leeg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 12px;
  border-radius: var(--r-md);
  border: 1px dashed rgba(239, 230, 214, 0.18);
  text-align: center;
}
.nn-zoek__leeg strong { font-size: 13px; color: #F4EEE2; }
.nn-zoek__leeg span { font-size: 12px; color: rgba(239, 230, 214, 0.5); }

/* ---- Pins op de kaart ---- */


.nn-vtip.leaflet-tooltip,
.mm-tip.leaflet-tooltip {
  background: #211C15;
  border: 1px solid rgba(239, 230, 214, 0.2);
  border-radius: var(--r-sm);
  color: #F4EEE2;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  box-shadow: var(--shadow-md);
}
.nn-vtip.leaflet-tooltip::before,
.mm-tip.leaflet-tooltip::before { border-top-color: rgba(239, 230, 214, 0.2); }

/* ---- Licht thema ---- */

body.nn-kaart.is-licht .nn-vtip.leaflet-tooltip,
.mm-tip.leaflet-tooltip {
  background: var(--card);
  border-color: var(--border);
  color: var(--ink-900);
}
body.nn-kaart.is-licht .nn-vtip.leaflet-tooltip::before,
body.nn-kaart.is-licht .mm-tip.leaflet-tooltip::before { border-top-color: var(--border); }
