/* ============================================================
   explorer.css — Realo-stijl Explorer (filterbar + kaart + lijst)
   Bouwt voort op main.css (kleuren, fonts, badges).
   ============================================================ */

html, body { overflow: hidden; height: 100%; }

.explorer-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 16px;
  background: var(--kleur-sidebar);
  color: var(--kleur-sidebar-tekst);
  flex: 0 0 auto;
}
.topbar .merk { display: flex; align-items: center; gap: 22px; min-width: 0; }
.topbar .logo { font-size: 19px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar nav { display: flex; gap: 16px; font-size: 14px; }
.topbar nav a { color: var(--kleur-sidebar-tekst); opacity: .75; }
.topbar nav a:hover, .topbar nav a.actief { opacity: 1; color: #fff; text-decoration: none; }

/* Weergave-toggle (3 modi) */
.weergave-toggle { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 7px; padding: 3px; gap: 2px; flex: 0 0 auto; }
.wt-knop {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: none; background: none; color: #cdd5e0;
  font-size: 13px; font-weight: 500; border-radius: 5px; white-space: nowrap;
}
.wt-knop.actief { background: #fff; color: var(--kleur-tekst); box-shadow: var(--schaduw); }

/* ---------- Filterbar ---------- */
.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--kleur-wit);
  border-bottom: 1px solid var(--kleur-border);
  flex: 0 0 auto;
  position: relative;
  z-index: 700;
}
.fb-zoek { position: relative; flex: 0 0 280px; max-width: 280px; }
.fb-zoek input { width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--kleur-border); border-radius: 7px; outline: none; }
.fb-zoek input:focus { border-color: var(--kleur-blauw); }
.fb-zoek .zoek-icoon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: .5; }
.zoek-suggesties {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 900;
  background: #fff; border: 1px solid var(--kleur-border); border-radius: 7px;
  box-shadow: var(--schaduw-zwaar); max-height: 260px; overflow-y: auto;
}
.zoek-suggesties div { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.zoek-suggesties div:hover { background: #f1f3f6; }

.fb-pills { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.fb-pills::-webkit-scrollbar { display: none; }

/* Segment (transactie) */
.segment { display: inline-flex; border: 1px solid var(--kleur-border); border-radius: 7px; overflow: hidden; flex: 0 0 auto; }
.segment button { padding: 8px 14px; border: none; background: var(--kleur-wit); color: var(--kleur-subtekst); font-weight: 500; font-size: 13px; }
.segment button + button { border-left: 1px solid var(--kleur-border); }
.segment button.actief { background: var(--kleur-blauw); color: #fff; }

/* Filter-pills met popover */
.pill-wrap { position: relative; flex: 0 0 auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border: 1px solid var(--kleur-border); border-radius: 7px;
  background: var(--kleur-wit); color: var(--kleur-tekst); font-size: 13px; font-weight: 500;
  white-space: nowrap;
}
.pill:hover { background: #f7f9fc; }
.pill .caret { opacity: .5; font-size: 10px; }
.pill.actief { border-color: var(--kleur-blauw); background: #eef3fe; color: var(--kleur-blauw); }
.pill .telbadge { background: var(--kleur-blauw); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; line-height: 16px; }

.pill-paneel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 950;
  background: #fff; border: 1px solid var(--kleur-border); border-radius: 9px;
  box-shadow: var(--schaduw-zwaar); padding: 14px; min-width: 240px;
}
.pill-paneel.rechts { left: auto; right: 0; }
.pill-paneel h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--kleur-subtekst); margin-bottom: 8px; }
.pp-rij { display: flex; gap: 10px; align-items: center; }
.pp-rij .invoer { flex: 1; }
.pp-types { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.pp-types label { display: flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; font-weight: 400; }
.pp-knoppen { display: flex; gap: 5px; }
.pp-knoppen button { flex: 1; padding: 7px 0; border: 1px solid var(--kleur-border); border-radius: 6px; background: #fff; font-size: 13px; font-weight: 500; }
.pp-knoppen button.actief { background: var(--kleur-blauw); border-color: var(--kleur-blauw); color: #fff; }
.pp-acties { display: flex; justify-content: space-between; margin-top: 12px; gap: 8px; }
.pp-acties .leeg { background: none; border: none; color: var(--kleur-subtekst); font-weight: 500; font-size: 13px; }

/* STAP 1 — Status checkboxes met gekleurde bolletjes */
.pp-status { grid-template-columns: 1fr; gap: 8px; }
.pp-status label { font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.dot-blauw { background: #2563eb; }
.dot-groen { background: #2d7d52; }
.dot-paars { background: #7c3aed; }
.dot-lichtgroen { background: #84cc16; }

/* STAP 2 — Periode-paneel + STAP 4 prijs-snelknoppen (wrappende knoppenrij) */
.periode-paneel { min-width: 300px; }
.periode-paneel h5 { margin-top: 12px; }
.periode-paneel h5:first-child { margin-top: 0; }
.veld-label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--kleur-subtekst); flex: 1; }
#periode-snel, #prijs-snel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#periode-snel button, #prijs-snel button { flex: 0 0 auto; padding: 6px 10px; border: 1px solid var(--kleur-border); border-radius: 14px; background: #fff; font-size: 12px; font-weight: 500; cursor: pointer; }
#periode-snel button.actief, #prijs-snel button.actief { background: var(--kleur-blauw); border-color: var(--kleur-blauw); color: #fff; }
#min-online { width: 100%; }

/* Type-paneel: categorieën onder elkaar, "Alle types" met scheidingslijn */
.pill-paneel[data-voor="type"] .pp-types { grid-template-columns: 1fr; gap: 8px; }
.type-alle { border-bottom: 1px solid var(--kleur-border); padding-bottom: 8px; margin-bottom: 4px; font-weight: 500 !important; }

/* STAP 7 — Verberg concurrenten toggle */
.concurrenten-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--kleur-tekst); white-space: nowrap; cursor: pointer; padding: 7px 11px; border: 1px solid var(--kleur-border); border-radius: 7px; background: #fff; }
.concurrenten-toggle input { cursor: pointer; }

.fb-rechts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.fb-rechts select.invoer { width: auto; padding: 8px 28px 8px 11px; border-radius: 7px; font-size: 13px; }
.ico-knop {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border: 1px solid var(--kleur-border); border-radius: 7px;
  background: #fff; font-size: 13px; font-weight: 500; color: var(--kleur-tekst);
}
.ico-knop:hover { background: #f7f9fc; }
.ico-knop.actief { border-color: var(--kleur-rood); background: #fdecea; color: var(--kleur-rood); }

/* ---------- Hoofd-layout (kaart + lijst) ---------- */
.explorer-body { flex: 1; display: flex; min-height: 0; position: relative; }

.kaart-paneel { position: relative; flex: 1 1 50%; min-width: 0; }
#map { width: 100%; height: 100%; }
.heat-toggle {
  position: absolute; top: 12px; right: 12px; z-index: 600;
  background: #fff; border: 1px solid var(--kleur-border); border-radius: 7px;
  box-shadow: var(--schaduw); padding: 8px 12px; display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
}

/* STAP 10 — Kaartlagen-control */
.lagen-control { position: absolute; top: 54px; right: 12px; z-index: 600; }
.lagen-knop {
  background: #fff; border: 1px solid var(--kleur-border); border-radius: 7px;
  box-shadow: var(--schaduw); padding: 8px 12px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.lagen-paneel {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--kleur-border); border-radius: 9px;
  box-shadow: var(--schaduw-zwaar); padding: 14px;
}
.lagen-paneel h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--kleur-subtekst); margin-bottom: 10px; }
.lagen-paneel label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 4px 0; }
.laag-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.lagen-hint { font-size: 11px; color: var(--kleur-subtekst); margin-top: 8px; line-height: 1.4; }
.lagen-status { font-size: 11px; color: var(--kleur-blauw); margin-top: 6px; min-height: 14px; }

/* POI-markers van de kaartlagen */
.poi-icoon { background: none; border: none; }
.poi-bol {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; font-size: 14px;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

.lijst-paneel { flex: 1 1 50%; min-width: 0; display: flex; flex-direction: column; background: var(--kleur-achtergrond); border-left: 1px solid var(--kleur-border); }
.lijst-kop { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--kleur-wit); border-bottom: 1px solid var(--kleur-border); flex: 0 0 auto; }
.lijst-kop .teller { font-size: 15px; font-weight: 600; }
.lijst-kop .teller small { font-weight: 400; color: var(--kleur-subtekst); }
.lijst-kop .sorteer { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--kleur-subtekst); flex: 0 0 auto; }
.lijst-kop .sorteer select.invoer { width: auto; padding: 7px 26px 7px 10px; border-radius: 7px; font-size: 13px; }
.resultaten-grid { flex: 1; overflow-y: auto; padding: 0; display: block; background: var(--kleur-wit); }

/* ---------- Weergavemodi ---------- */
.explorer-body[data-modus="kaart"] .lijst-paneel { display: none; }
.explorer-body[data-modus="kaart"] .kaart-paneel { flex-basis: 100%; }
.explorer-body[data-modus="lijst"] .kaart-paneel { display: none; }
.explorer-body[data-modus="lijst"] .lijst-paneel { flex-basis: 100%; border-left: none; }
.explorer-body[data-modus="lijst"] .resultaten-grid { max-width: 860px; margin: 0 auto; width: 100%; }

/* ---------- Pandrij (Realo-stijl compacte lijst) ---------- */
.pand-rij {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--kleur-border);
  background: var(--kleur-wit); cursor: pointer; transition: background .12s;
  content-visibility: auto; contain-intrinsic-size: auto 104px;
}
.pand-rij:hover { background: #f5f6f8; }
.pr-foto-wrap { position: relative; width: 80px; height: 80px; flex: 0 0 80px; border-radius: 8px; overflow: hidden; background: #eef1f5; }
.pr-foto { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .25s; }
.pr-foto.geladen { opacity: 1; }
.pr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pr-rij1 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pr-adres { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-prijs { font-weight: 700; font-size: 15px; white-space: nowrap; flex: 0 0 auto; }
.pr-prijs small { font-weight: 400; font-size: 12px; color: var(--kleur-subtekst); }
.pr-sinds { font-size: 12px; font-weight: 500; }
.pr-sinds.koop { color: var(--kleur-blauw); }
.pr-sinds.huur { color: var(--kleur-groen); }
.pr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--kleur-subtekst); }
.pr-meta span { display: inline-flex; align-items: center; gap: 3px; }
.pr-meta .pr-type { font-weight: 500; color: var(--kleur-tekst); }
.pr-meta .badge-epc { font-size: 11px; }
.pr-bronnen { color: var(--kleur-blauw); font-weight: 600; }

/* Favoriet-hartje op de kleine foto */
.pr-foto-wrap .pk-hart {
  position: absolute; top: 3px; right: 3px; z-index: 3;
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.9); box-shadow: var(--schaduw); display: flex;
  align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pr-foto-wrap .pk-hart svg { width: 14px; height: 14px; }
.pk-hart .hart-pad { fill: none; stroke: #6b7280; stroke-width: 2; }
.pk-hart.actief .hart-pad { fill: var(--kleur-rood); stroke: var(--kleur-rood); }

/* ---------- STAP 2 — adresgroep ---------- */
.pand-groep { border-bottom: 1px solid var(--kleur-border); background: var(--kleur-wit); }
.pg-kop { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background .12s; }
.pg-kop:hover { background: #f5f6f8; }
.pg-foto-wrap { position: relative; width: 80px; height: 80px; flex: 0 0 80px; border-radius: 8px; overflow: hidden; background: #eef1f5; }
.pg-telbadge { position: absolute; bottom: 4px; right: 4px; background: rgba(17,24,39,.82); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
.pg-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pg-samenstelling { font-size: 12.5px; color: var(--kleur-subtekst); }
.pg-toggle { flex: 0 0 auto; background: none; border: none; color: var(--kleur-blauw); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 6px; }
.pg-rijen { border-top: 1px solid var(--kleur-border); background: #fafbfc; }
.pg-rijen.verborgen { display: none; }
.pg-rijen .pand-rij { padding-left: 28px; background: transparent; }
.pg-rijen .pand-rij:hover { background: #f0f2f5; }

/* Investeringsscore-bol + vergelijk-checkbox rechts in de rij */
.pr-score { flex: 0 0 auto; align-self: center; }
.pr-cmp { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; cursor: pointer; opacity: .5; transition: opacity .12s; }
.pand-rij:hover .pr-cmp { opacity: 1; }
.pr-cmp input { cursor: pointer; width: 16px; height: 16px; }

/* Investeringsscore-bolletje */
.score-bol {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; color: #fff;
  font-size: 12px; font-weight: 600; flex: 0 0 auto;
}
.score-bol.groen { background: var(--kleur-groen); }
.score-bol.oranje { background: var(--kleur-oranje); }
.score-bol.rood { background: var(--kleur-rood); }
.score-bol.grijs { background: #9ca3af; }

/* ---------- Paginering ---------- */
.paginering { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; background: var(--kleur-wit); border-top: 1px solid var(--kleur-border); flex: 0 0 auto; }
.paginering .pg-info { font-size: 13px; color: var(--kleur-subtekst); }

/* ---------- Vergelijk-balk ---------- */
.vergelijk-balk {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1200;
  background: var(--kleur-sidebar); color: #fff;
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.18);
}
.vergelijk-balk .vb-tekst { font-weight: 600; }
.vergelijk-balk .vb-thumbs { display: flex; gap: 8px; flex: 1; }
.vergelijk-balk .vb-thumb { position: relative; width: 54px; height: 40px; border-radius: 5px; overflow: hidden; background: #2b3650; }
.vergelijk-balk .vb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vergelijk-balk .vb-thumb button { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 1; padding: 0; cursor: pointer; }
.vergelijk-balk .vb-leeg { width: 54px; height: 40px; border: 1px dashed #46506a; border-radius: 5px; }

/* ---------- Overlay (Meer filters) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.overlay-kaart { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; box-shadow: var(--schaduw-zwaar); }
.overlay-kop { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--kleur-border); }
.overlay-kop h3 { font-size: 18px; }
.overlay-kop .sluit { background: none; border: none; font-size: 26px; line-height: 1; color: var(--kleur-subtekst); cursor: pointer; }
.overlay-body { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.of-breed { grid-column: 1 / -1; }
@media (max-width: 600px) { .overlay-body { grid-template-columns: 1fr; } }
.overlay-voet { display: flex; gap: 12px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--kleur-border); }
.of-blok > label.kop { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--kleur-subtekst); margin-bottom: 9px; }

/* ---------- Kaart-popup ---------- */
.leaflet-popup-content { margin: 0; }
.popup { width: 230px; }
.popup > img { width: 100%; height: 130px; object-fit: cover; border-radius: 6px 6px 0 0; background: #eef1f5; }
.popup .body { padding: 9px 11px; }
.popup .prijs { font-weight: 600; font-size: 17px; }
.popup .prijs small { font-size: 12px; font-weight: 400; color: var(--kleur-subtekst); }
.popup .adres { font-weight: 500; font-size: 13px; margin-top: 2px; }
.popup .meta { font-size: 12px; color: var(--kleur-tekst); margin: 4px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Mobiele weergave-schakelaar ---------- */
.mobiel-schakel { display: none; }

@media (max-width: 980px) {
  .topbar nav { display: none; }
  .fb-zoek { flex-basis: 180px; }
}

@media (max-width: 768px) {
  .filterbar { flex-wrap: wrap; }
  .fb-zoek { flex-basis: 100%; max-width: none; order: -1; }
  .fb-rechts { margin-left: auto; }
  .weergave-toggle { display: none; }
  /* STAP 6 — kaart bovenaan (40vh), lijst eronder scrollbaar; beide zichtbaar
     ongeacht de gekozen weergavemodus (geen toggle-knop meer nodig). */
  .explorer-body { flex-direction: column; }
  .explorer-body .kaart-paneel { display: block !important; flex: 0 0 40vh; height: 40vh; min-width: 0; }
  .explorer-body .lijst-paneel { display: flex !important; flex: 1 1 auto; min-height: 0; border-left: none; flex-basis: auto; }
  .explorer-body[data-modus="lijst"] .resultaten-grid { max-width: none; }
  #map { height: 40vh; }
  .mobiel-schakel { display: none; }
  .vergelijk-balk { flex-wrap: wrap; gap: 10px; }
}
