/* Gemeinsame Mobil-Ansicht (≤ 600 px) für Sauna-Radar (index.html) und FKK-Radar (fkk.html) */

/* 1. Suchkarte: Startort · Mein Standort | Auf Karte (je halbe Breite) · Umkreis-Zeile · Suche */
@media (max-width: 600px) {
  html .sc {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center;
    width: 100%; max-width: none; padding: 14px; border-radius: 20px;
  }
  html .sc > .sc-place { grid-column: 1 / -1; min-width: 0; width: 100%; margin: 0; flex: none; }
  html .sc > .sc-loc { width: 100%; min-width: 0; margin: 0; justify-content: center; text-align: center; flex: none; white-space: nowrap; }
  html .sc > .sc-div { display: none; }
  html .sc > .sc-radius {
    grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
    gap: 8px 10px; width: 100%; min-width: 0; padding: 0; margin: 0; flex: none;
  }
  html .sc-radius > input[type="range"], html .sc-radius > .umkreis-skala { width: 100%; min-width: 0; }
  html .sc > .sc-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
  html .sc-row > .mode-toggle { flex: none; width: auto; margin: 0; }
  html .sc-row > .mode-toggle button { padding-inline: 10px; font-size: 13px; }
  html .sc-row > .sc-go { flex: 1 1 auto; min-width: 0; width: auto; margin: 0; padding-inline: 12px; justify-content: center; white-space: nowrap; font-size: 14px; }
}
@media (max-width: 420px) {
  html .sc-go .sc-long { display: none; }
  html .sc-go .sc-short { display: inline; }
}

/* Umkreis-Regler beider Seiten (umkreis-regler.js?v=791c680528): gleiche Höhe und Griffläche; touch-action: none,
   damit ein leicht schräges Ziehen auf dem Handy den Regler bewegt statt die Seite zu scrollen */
/* Feste Stufen 10–50–100–200–300 km mit Skalenmarken; Wert in Akzentfarbe der Seite (--mt-on), gleiche Breite auf beiden Seiten */
html .umkreis-skala { position: relative; display: inline-flex; align-items: center; flex: none; width: 104px; padding-bottom: 7px; }
html .umkreis-skala > input[type="range"] { width: 100%; height: 24px; margin: 0; padding: 0; cursor: pointer; touch-action: none; accent-color: var(--mt-on); opacity: 1; }
html .umkreis-marken { position: absolute; left: 8px; right: 8px; bottom: 0; height: 6px; display: flex; justify-content: space-between; pointer-events: none; }
html .umkreis-marken i { width: 1.5px; height: 6px; border-radius: 1px; background: var(--mt-on); opacity: .45; }
html .umkreis-wert { flex: none; min-width: 4.4em; text-align: right; color: var(--mt-on); font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 2. Suchknopf mit kleinem Icon; Zeile Fahrstrecke/Luftlinie + Suchknopf (Desktop: Elemente fließen wie bisher) */
.sc-row { display: contents; }
.sc-go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.sc-go .sc-ico { font-size: .95em; line-height: 1; }
.sc-go .sc-short { display: none; }

/* 6. Kategorien mobil kompakt: 2-spaltiges Raster, Zähler rechtsbündig, „18+“ und „Weitere Filter“ als letzte Zeile */
@media (max-width: 600px) {
  .filter-wrapper.is-mobile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; }
  .filter-wrapper.is-mobile > .filter-bar:not([hidden]) { display: contents; }
  .filter-wrapper.is-mobile .pill {
    display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; margin: 0; padding: 7px 10px;
    font-size: .78rem; line-height: 1.2; text-align: left; white-space: normal; justify-content: flex-start;
  }
  .filter-wrapper.is-mobile .pill .n { margin-left: auto; padding-left: 4px; }
  .filter-wrapper.is-mobile #subBar .pill { order: 1; }
  .filter-wrapper.is-mobile #adultToggle { order: 2; grid-column: 1; justify-content: center; }
  .filter-wrapper.is-mobile #moreBtn { order: 2; grid-column: 2; justify-content: center; }
  .filter-wrapper.is-mobile #extFilters { order: 3; grid-column: 1 / -1; }

  html .type-filters:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  html .type-filters > button { width: 100%; min-width: 0; min-height: 36px; margin: 0; padding: 6px 10px; font-size: 12px; justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.2; }
  html .type-filters > button .region-count, html .type-filters > button .count { margin-left: auto; }
  html .type-filters > .sexy-toggle { order: 9; grid-column: 1 / -1; justify-content: center; }
}

/* 7. FKK-Karte mobil: eigene Ebene und Malbereich, damit Hinweis und Zoom-Knöpfe beim Scrollen nicht doppelt nachgezeichnet werden */
@media (max-width: 600px) {
  .map-panel { isolation: isolate; contain: paint; }
  .map-panel .map-wrap { contain: paint; transform: translateZ(0); }
}

@media (max-width: 600px) {
  html .type-filters > button.favorite-chip { justify-content: center; padding: 0; text-align: center; }
}

/* Desktop (≥ 900 px): Suchleiste beider Seiten einzeilig wie im FKK-Radar */
@media (min-width: 900px) {
  html .sc { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; width: 100%; max-width: 1240px; margin-inline: auto; padding: 8px 10px 8px 20px; border-radius: 999px; }
  html .sc > .sc-place { flex: 1 1 auto; min-width: 200px; width: auto; margin: 0; }
  html .sc > .sc-place input, html[data-theme] .sc > .sc-place input[type] { min-width: 0; width: 100%; font-size: 1rem; text-overflow: ellipsis; }
  html .sc > .sc-place input::placeholder { font-size: .88rem; }
  html .sc > .sc-loc { flex: none; width: auto; margin: 0; white-space: nowrap; }
  html .sc > .sc-radius { display: flex; align-items: center; gap: 8px; flex: none; margin: 0; padding: 0; }
  html .sc-radius > .umkreis-skala { width: 104px; }
  html .sc > .sc-row { display: contents; }
  html .sc-row > .mode-toggle { flex: none; margin: 0; }
  html .sc-row > .sc-go { flex: none; width: auto; margin: 0; white-space: nowrap; }
}
/* 900–1279 px: Standort-Knöpfe nur mit Symbol, Suchknopf kurz – Leiste bleibt einzeilig */
@media (min-width: 900px) and (max-width: 1279px) {
  html .sc-radius > .umkreis-skala { width: 84px; }
  html .sc-go .sc-long { display: none; }
  html .sc-go .sc-short { display: inline; }
}
/* 900–1439 px: Standort-Knöpfe nur mit Symbol (Leiste ohne Überlauf, unabhängig von der Schriftbreite) */
@media (min-width: 900px) and (max-width: 1439px) {
  html .sc > .sc-loc { width: 40px; height: 40px; min-height: 40px; padding: 0; justify-content: center; }
  html .sc-loc .sc-loc-text { display: none; }
}
/* ab 1440 px: breitere Leiste (beide Seiten gleich), Standort-Knöpfe mit Text */
@media (min-width: 1440px) {
  html .sc { max-width: 1360px; }
  html .hero-content:has(> .sc), html .hero-content:has(.sc) { max-width: 1400px; }
}

/* Entfernung in den Kacheln (entfernung.js, beide Radare): Symbol + „xx km · yy min“ bzw. „xx km Luftlinie“ */
.distance-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: .8rem; line-height: 1.4; white-space: nowrap; vertical-align: middle; color: var(--dist-ink); background: var(--dist-bg); }
.distance-badge svg { flex: none; }
.distance-badge[data-art="ca"] { font-weight: 600; opacity: .85; }

/* Textsuche (textsuche.js, beide Radare): Eingabe mit ✕ zum Löschen */
.textsuche { position: relative; display: flex; align-items: center; }
.textsuche input[type="search"] { width: 100%; padding-right: 36px; }
.textsuche input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.textsuche-leeren { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .65; font-size: .9rem; cursor: pointer; }
.textsuche-leeren:hover, .textsuche-leeren:focus-visible { opacity: 1; background: rgba(0, 0, 0, .06); }
.textsuche-leeren[hidden] { display: none; }
.fkk-suche .textsuche-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.fkk-suche input[type="search"] { padding: 0 40px 0 40px; border: 1px solid var(--border, #E2E8F0); background: var(--surface, #fff); color: var(--text, inherit); }
.fkk-suche input[type="search"]:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Listenkopf (Thermensuche und FKK-Liste): Suchfeld (flex:1) links, Sortierung kompakt rechts in einer Zeile;
   unter 360 px darf die Sortierung umbrechen */
html .listenkopf { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 12px; margin: 15px 0 14px; }
html .listenkopf > .listenkopf-suche { flex: 1 1 auto; min-width: 0; }
html .listenkopf > .listenkopf-sort { flex: 0 1 220px; min-width: 0; }
html .listenkopf label { display: block; margin: 0 0 5px; font-size: .875rem; font-weight: 700; }
html .listenkopf input[type="search"], html .listenkopf select { width: 100%; height: 44px; border-radius: 8px; font-size: 16px; }
html .listenkopf .select-wrap { width: 100%; }
html .listenkopf select { padding: 0 30px 0 12px; text-overflow: ellipsis; }
@media (max-width: 600px) {
  html .listenkopf { gap: 8px; }
  html .listenkopf > .listenkopf-sort { flex-basis: 132px; }
  html .listenkopf select { font-size: 14px; padding: 0 22px 0 8px; }
}
@media (max-width: 359px) {
  html .listenkopf { flex-wrap: wrap; }
  html .listenkopf > .listenkopf-suche, html .listenkopf > .listenkopf-sort { flex: 1 1 100%; }
}
/* gleicher Auswahlpfeil auf beiden Seiten (statt nativem Pfeil bzw. Sprite-Symbol) */
html .listenkopf select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; padding-right: 30px; }
html .listenkopf .select-wrap > .icon { display: none; }
@media (max-width: 600px) {
  html .listenkopf > .listenkopf-sort { flex: 0 0 118px; }
  html .listenkopf select { padding: 0 26px 0 9px; background-position: right 7px center; }
}
@media (max-width: 359px) {
  html .listenkopf > .listenkopf-suche, html .listenkopf > .listenkopf-sort { flex: 1 1 100%; }
}

/* Kontrast Listenköpfe (28.11.2026): auf dem Desktop liegt das Hintergrundfoto direkt hinter Titel, Zählerzeile und
   Feldbeschriftungen. Halbdeckende Fläche in Themenfarbe, damit Text (normal/gedämpft) >= 4,5:1 erreicht. */
:root { --kopf-flaeche: rgba(250, 247, 242, .93); }
:root[data-theme="dark"] { --kopf-flaeche: rgba(23, 19, 16, .9); }
html .directory-heading, html .results-header { background: var(--kopf-flaeche); border-radius: 12px; padding: 6px 12px; }
html .listenkopf label { width: fit-content; background: var(--kopf-flaeche); border-radius: 6px; padding: 1px 8px; margin-left: -8px; }
html:not([data-theme="dark"]) .explorer h2 { color: #9a4a26; }
