/* search.css – Suchseite (ergänzt style.css; Farben, Karten-Kacheln, Kalender, Karte kommen von dort)
   Die Suchleiste Wo · Wann · Wer steht in search-bar.css (auch im Reiseblog genutzt). */

/* Seite: Hintergrund (Himmelblau → Sand) kommt wie auf der Hausseite vom body in style.css */
.search-top { padding: 18px 0 14px; position: sticky; top: var(--hdr, 69px); z-index: 9; transition: top .25s ease, padding .25s ease, background .2s, box-shadow .2s; }
/* Suchmenü steht: weiß wie die Sprungleiste der Hausseite (.jumpnav.stuck) */
.search-top.stuck { background: var(--surface); box-shadow: 0 1px 0 var(--border), 0 4px 10px rgba(58,51,48,.06); }
.search-form { display: flex; flex-direction: column; align-items: center; gap: 16px; transition: gap .25s ease; }

/* ---------- Filter-Chips ---------- */
.chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
/* Aussehen eines einzelnen Filters (.chip): style.css – gleich in Suche und Blog */
.chips-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
/* Pfeile zum Blättern in der Filterleiste: allgemein in style.css ("Waagerecht scrollbare Listen") */
.chips-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.chips-reset { font-size: 14px; font-weight: 600; color: var(--sea); text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; white-space: nowrap; }

/* ---------- Ergebnisse + Karte ---------- */
.search-container { max-width: 1760px; }
.search-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 40%); gap: 28px; align-items: start; padding: 22px 0 48px; }
.results-crumbs { margin-bottom: 6px; }
/* Überschrift mit "Teilen" rechts daneben */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.results-head .share-btn { flex: none; margin: 0 -8px 0 0; }
.results-title { font-size: 26px; font-weight: 700; line-height: 1.25; }
.results-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }   /* Überschrift mit ⓘ „Wie wir sortieren“ */
.results-title-wrap .tooltip { position: static; }
.results-head { position: relative; }   /* Bezug für den Hinweis: unter der Überschrift, volle Breite bis 340 px */
.results-head .results-ranking-tip { left: 0; bottom: auto; top: calc(100% + 8px); width: min(340px, 100%); font-weight: 400; line-height: 1.5; }
.results-head .results-ranking-tip::after { display: none; }
.results-sub { color: var(--muted); margin-top: 2px; }
.results-price-note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.results-notice { margin: 14px 0 0; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 22px; margin-top: 22px; }   /* immer 2 Kacheln, unter 560 px eine */

/* Kachel: nutzt .similar-card aus style.css, ergänzt Fotos zum Durchblättern */
.result-card { position: relative; }
.result-card .similar-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-rating { flex-shrink: 0; white-space: nowrap; }
.result-card .similar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-slides-wrap { position: relative; }
.card-slides { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.card-slides::-webkit-scrollbar { display: none; }
.card-slides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.result-card:hover .card-slides img { transform: none; }
.card-noimg { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; }
.card-noimg svg { width: 64px; height: 64px; opacity: .5; }
/* Badges oben links auf dem Foto: .card-badges / .card-badge stehen in style.css (auch Startseite, similar_card()) */
.card-arrow { position: absolute; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; box-shadow: 0 2px 6px rgba(58,51,48,.18); cursor: pointer; }
.card-arrow svg { width: 16px; height: 16px; fill: none; stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.card-prev { left: 10px; }
.card-next { right: 10px; }
.result-card:hover .card-arrow, .card-arrow:focus-visible { opacity: 1; }
.card-arrow.is-hidden { visibility: hidden; }
.card-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.card-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.6); }
.card-dots i.on { background: #fff; }
.card-tag { align-self: flex-start; margin-top: 6px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--border) 55%, var(--surface)); color: var(--text); }
.card-tag.tag-free { background: color-mix(in srgb, #3f8f5a 14%, var(--surface)); color: #2f6e44; }
.result-card.is-hot .similar-img { box-shadow: 0 0 0 3px var(--accent); }

/* Keine Treffer */
.results-empty { margin-top: 32px; padding: 40px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.results-empty svg { width: 56px; height: 56px; }
.results-empty h2 { font-size: 20px; margin: 12px 0 6px; }
.results-empty p { color: var(--muted); margin-bottom: 18px; }
.results-empty .map-load { display: inline-block; text-decoration: none; }

/* Orts-Links unter den Ergebnissen: Pillen mit Anzahl */
.place-links { margin-top: 48px; }
.place-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.place-list a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; text-decoration: none; transition: border-color .15s; }
.place-list a:hover { border-color: var(--text); }

/* SEO-Text: Aufbau wie die Hausbeschreibung, etwas zurückhaltender, damit er die Suche nicht übertönt */
.seo-text { margin-top: 48px; margin-bottom: 48px; }
.seo-text .desc-lead { font-size: 18px; font-weight: 500; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.seo-text .desc-quote { font-size: 17px; }

/* Blättern */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 500; }
.pager a:hover { background: color-mix(in srgb, var(--border) 60%, var(--surface)); }
.pager .is-current { background: var(--text); color: #fff; }
.pager-step { font-weight: 600; }
.pager-gap { color: var(--muted); }

/* Karte rechts: klebt beim Scrollen */
.map-close { display: none; }   /* nur in der Vollbild-Karte am Handy sichtbar */
.search-map-col { position: sticky; top: calc(var(--hdr, 69px) + var(--stop, 0px) + 16px); transition: top .25s ease; }
/* Karte passt immer genau in den sichtbaren Bereich: Bildschirmhöhe minus Header (--hdr, 0 wenn ausgeblendet),
   Suchmenü (--stop, beide setzt search.js) und Abstände oben (22px) und unten (16px). */
.map.search-map { height: calc(100vh - var(--hdr, 69px) - var(--stop, 0px) - 38px); min-height: 420px; }
/* Button „In diesem Bereich suchen“ oben mittig auf der Karte (search.js, mapAreaButtonInit) – über den Kartenebenen von Leaflet (z-index 400) */
.map-area-btn { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 9px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); cursor: pointer; white-space: nowrap; }
.map-area-btn:hover { background: var(--sand); }
.map-area-btn[hidden] { display: none; }

/* Preis-Pins (Leaflet divIcon) */
.price-pin-wrap { background: none; border: none; }
.price-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); padding: 5px 10px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 8px rgba(58,51,48,.28), 0 0 0 1px rgba(58,51,48,.08); transition: transform .15s, background .15s; cursor: pointer; }
.price-pin.is-hot, .price-pin:hover { background: var(--text); color: #fff; transform: translate(-50%, -50%) scale(1.08); }
.price-pin.no-price { padding: 6px; }
.price-pin.no-price::before { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }

/* Popup im Stil einer Mini-Kachel */
.map .leaflet-popup-content-wrapper { padding: 0; border-radius: 14px; overflow: hidden; }
.map .leaflet-popup-content { margin: 0; width: 240px !important; }
.pin-card { display: block; color: var(--text); text-decoration: none; font-size: 14px; }
.pin-card img { display: block; width: 100%; height: 150px; object-fit: cover; }
.pin-card-body { display: block; padding: 10px 12px 12px; }
.pin-card-body strong { display: block; }
.pin-card-body span { display: block; color: var(--muted); }

/* Umschalter Liste/Karte (nur Handy) */
.map-toggle { display: none; }

/* ---------- Responsiv ---------- */
/* ---------- Kompakte Suchleiste ----------
   Sobald von ganz oben weggescrollt wird (Klasse is-compact, setzt search.js), wird die stehende
   Suchleiste etwas kleiner – sie "zoomt raus". Nur ab 901 px; darunter scrollt sie ohnehin mit. */
@media (min-width: 901px) {
    .search-top.is-compact { padding: 10px 0 8px; }
    .search-top.is-compact .search-form { gap: 10px; }
    .search-top.is-compact .sbar { height: 52px; }
    .search-top.is-compact .sbar-where { padding-left: 26px; }
    .search-top.is-compact .sbar-btn { padding: 0 20px; }
    .search-top.is-compact .sbar-sep { height: 26px; }
    .search-top.is-compact .sbar-label { font-size: 11px; }
    .search-top.is-compact .sbar .sbar-input,
    .search-top.is-compact .sbar-value { font-size: 13px; }
    .search-top.is-compact .sbar-go { width: 40px; height: 40px; }
    .search-top.is-compact .sbar-go svg { width: 17px; height: 17px; }
    .search-top.is-compact .chip span { padding: 6px 12px; font-size: 13px; }
    .search-top.is-compact .chip svg { width: 13px; height: 13px; }
    .search-top.is-compact .chips-sep { height: 22px; }
}
/* Browser soll beim Verkleinern nicht selbst die Scrollposition "nachkorrigieren"
   (sonst springt die Seite zurück nach oben und die Leiste wird wieder groß) */
html { overflow-anchor: none; }

@media (max-width: 1100px) {
    .search-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 36%); }
}

@media (max-width: 900px) {
    .search-layout { grid-template-columns: 1fr; padding-bottom: 96px; }
    .search-top { position: relative; top: auto; }   /* Handy/Tablet: Suchblock ist zu hoch zum Stehenbleiben */
    .search-top.stuck { background: none; box-shadow: none; }
    .search-map-col { display: none; }
    /* Karte als Vollbild über der Liste */
    body.show-map .search-map-col { display: block; position: fixed; inset: var(--hdr, 69px) 0 0 0; top: var(--hdr, 69px); z-index: 30; padding: 0; }
    body.show-map .map.search-map { height: 100%; border-radius: 0; border: none; min-height: 0; }
    /* Schließen-X oben rechts: Form wie .lightbox-close (style.css), aber hell auf der Karte */
    body.show-map .map-close { display: flex; top: 16px; right: 16px; z-index: 1001; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 3px 12px rgba(58,51,48,.25); backdrop-filter: none; -webkit-backdrop-filter: none; }
    body.show-map .map-close:active { background: color-mix(in srgb, var(--border) 55%, var(--surface)); }
    body.show-map { overflow: hidden; }
    .map-toggle { display: inline-flex; position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 45; align-items: center; gap: 8px; padding: 12px 20px; border: none; border-radius: 999px; background: var(--text); color: #fff; font: inherit; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(58,51,48,.35); cursor: pointer; }
    .map-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
}

@media (max-width: 760px) {
    /* Chips: eine Zeile, seitlich wischbar */
    .chips-wrap { width: calc(100% + 48px); margin: 0 -24px; }
    .chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; width: 100%; padding: 2px 24px 4px; scroll-behavior: smooth; }
    .chips::-webkit-scrollbar { display: none; }
    .chip span { padding: 7px 14px; }

    .results-title { font-size: 21px; }
    .results-grid { gap: 28px 16px; }
    .seo-text .desc-lead { font-size: 17px; }
    .seo-text .desc-grid { grid-template-columns: 1fr; }
    .card-arrow { display: none; }
}

/* Schmale Handys: eine Kachel pro Reihe */
@media (max-width: 560px) {
    .results-grid { grid-template-columns: 1fr; gap: 28px; }
}
