/* Händlerkarte neben der Händlersuche (crawl/clean_hooks/karte.py, /karte/haendlerkarte.js), 2026-11-13.
   Desktop: Suchkasten links, Karte rechts in gleicher Höhe. Unter 900px: Karte unter dem Suchkasten, über der Liste.
   Ohne JavaScript (noscript) oder ohne WebGL (.tg-ohne-karte) bleibt es beim Suchkasten allein. */
html #body .tg-suche-karte { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 24px;
  align-items: stretch; margin: 20px 0 8px; }
html #body .tg-suche-karte > form { display: flex; flex-direction: column; margin: 0; min-width: 0; }
html #body .tg-suche-karte .retailer-search-box { flex: 1 1 auto; max-width: none; margin: 0; box-sizing: border-box; }
html #body .tg-suche-karte.tg-ohne-karte { display: block; }
html #body .tg-suche-karte.tg-ohne-karte .retailer-search-box { max-width: 480px; }
html #body .tg-karte { position: relative; min-height: 440px; background: #f5f4f0; overflow: hidden; }
html #body .tg-karte[hidden] { display: none; }
@media (max-width: 899px) {
  html #body .tg-suche-karte { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  html #body .tg-karte { min-height: 0; height: 380px; }
}
@media (max-width: 749px) {
  html #body .tg-karte { height: 360px; margin: 0 -15px; }
}

/* Nummer je Händler in der Liste, gleich wie auf der Karte; Klick zeigt ihn auf der Karte */
html #body button.tg-karte-nr { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  padding: 0 6px; margin: 0 10px 4px 0; border: 0; border-radius: 13px; background: #004e2d; color: #fff;
  font: 700 13px/1 inherit; vertical-align: 2px; cursor: pointer; box-sizing: border-box; }
html #body button.tg-karte-nr:hover { background: #00693c; }
html #body button.tg-karte-nr:focus-visible { outline: 3px solid #ee7f00; outline-offset: 2px; }
html #body .retailer-details .tg-karte-aktiv { background: #eef4f0; box-shadow: inset 4px 0 0 #c8102e; }
html #body .retailer-details .tg-karte-aktiv button.tg-karte-nr { background: #c8102e; }
html #body span.tg-karte-nr { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px;
  padding: 0 6px; border-radius: 13px; background: #004e2d; color: #fff; font: 700 13px/1 inherit; box-sizing: border-box; }

/* Popup, in der Schrift der Seite (MapLibre setzt sonst Helvetica) */
html #body .tg-karte.maplibregl-map { font-family: inherit; }
html #body .tg-karte .maplibregl-popup-content { padding: 14px 16px 6px; border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18); font-size: 18px; line-height: 1.3; color: #333; }
html #body .tg-karte .maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 22px; color: #4b4b4a; }
html #body .tg-karte-popup p { margin: 0 0 6px; padding-right: 18px; }
html #body .tg-karte-popup p.tg-karte-popup__name { font-weight: 700; font-size: 20px; line-height: 1.2; }
html #body .tg-karte-popup p.tg-karte-popup__km { color: #666; font-size: 17px; }
html #body .tg-karte-popup .tg-haendler-aktionen { margin: 10px 0 8px; gap: 6px; }
html #body .tg-karte-popup .tg-haendler-aktionen a.tg-aktion { min-height: 40px; padding: 6px 12px; font-size: 17px; gap: 6px;
  flex: 0 1 auto; }

/* Bedienelemente groß genug für Finger */
html #body .tg-karte .maplibregl-ctrl-group button { width: 36px; height: 36px; }
html #body .tg-karte .maplibregl-ctrl-attrib { font-size: 11px; }

/* Liste: der innere .container hat ab 1280px die feste Breite 1270px, ist aber in .retailer-details (1260px); die Zeilen
   ragten 6px über den Rand (waagerechtes Scrollen, gab es schon vor der Karte) */
html #body .retailer-details > .container { width: auto; margin-right: 0; }

/* Kleine Karte (Handy): Popup kompakter, damit es über dem Punkt Platz hat */
@media (max-width: 749px) {
  html #body .tg-karte .maplibregl-popup-content { padding: 10px 12px 2px; font-size: 16px; }
  html #body .tg-karte-popup p { margin-bottom: 3px; }
  html #body .tg-karte-popup p.tg-karte-popup__name { font-size: 17px; }
  html #body .tg-karte-popup p.tg-karte-popup__km { font-size: 15px; }
  html #body .tg-karte-popup .tg-haendler-aktionen { margin: 6px 0 8px; }
  html #body .tg-karte-popup .tg-haendler-aktionen a.tg-aktion { min-height: 38px; padding: 4px 10px; font-size: 15px; }
}

/* Liste der Händler (haendlersuche.js, 2026-11-17): je Zeile Nummer, Name mit Anschrift und Telefon, Entfernung, Buttons.
   Die alte Kopfzeile (Name / Anschrift / Kontakt / Entfernung) entfällt, jede Zeile beschriftet sich selbst. */
html #body .retailer-list { display: none; }
html #body .retailer-details ol.tg-hl { list-style: none; margin: 0; padding: 0; border-top: 1px solid #d6d6d6; }
html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag { display: grid; margin: 0; padding: 18px 12px 18px 8px;
  grid-template-columns: 34px minmax(0, 1fr) 96px 340px; grid-template-areas: "nr info km aktionen";
  column-gap: 20px; align-items: start; border-bottom: 1px solid #d6d6d6; list-style: none; }
html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag::before,
html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag::marker { content: none; }
html #body .retailer-details .tg-hl__nr { grid-area: nr; padding-top: 1px; }
html #body .retailer-details .tg-hl__nr .tg-karte-nr { margin: 0; vertical-align: top; }
html #body .retailer-details .tg-hl__info { grid-area: info; min-width: 0; }
/* fett wie Überschriften der Seite: der fette Schnitt ist eine eigene Schriftfamilie ("PT Sans Narrow Bold") */
html #body .retailer-details p.tg-hl__name { margin: 0 0 4px; font-size: 21px; line-height: 1.25; color: #2f3437;
  font-family: "Interstate Condensed", "PT Sans Narrow Bold", "Interstate Light Condensed", "PT Sans Narrow", sans-serif; font-weight: 700; }
html #body .retailer-details p.tg-hl__adresse { margin: 0; line-height: 1.4; color: #4b4b4a; }
html #body .retailer-details p.tg-hl__telefon { margin: 6px 0 0; line-height: 1.4; }
/* Entfernung in einer festen Spalte links vor den Buttons, in jeder Zeile an derselben Stelle (Buttons links bündig) */
html #body .retailer-details p.tg-hl__km { grid-area: km; margin: 0; padding-top: 1px; white-space: nowrap; text-align: left;
  color: #2f3437; }
html #body .retailer-details .tg-hl__aktionen { grid-area: aktionen; }
html #body .retailer-details .tg-hl__aktionen .tg-haendler-aktionen { margin: 0; justify-content: flex-start; flex-wrap: wrap; row-gap: 8px; }
html #body .retailer-details p.tg-hl-meldung { margin: 16px 0; max-width: 72ch; }
html #body .retailer-details p.tg-hl-quelle { margin: 14px 0 0; font-size: 12px; opacity: .65; }
/* Abstand zum Footer (vorher stand die Quellenzeile direkt auf der grauen Fläche) */
html #body .retailer-details { padding-bottom: 56px; }
/* "Suchen" und "In meiner Nähe" nebeneinander, gleich hoch; auf schmalen Kästen untereinander */
html #body .retailer-search__buttons-div { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; }
html #body .retailer-search__buttons-div > .retailer-search__button { margin: 0; min-height: 48px; }
html #body .retailer-search__buttons-div > a.retailer-search__button { justify-content: center; }
/* Übersicht eines Landes (ohne Ort): Hinweis statt Liste */
html #body .retailer-details .tg-hl-uebersicht { margin: 4px 0 8px; padding: 16px 20px; max-width: 76ch; background: #f2f2f2;
  border-left: 4px solid #004e2d; }
html #body .retailer-details .tg-hl-uebersicht p { margin: 0; line-height: 1.45; }
/* Buttons der Liste (Wunsch des Kunden 17.11.): jede Art an fester Stelle, rechtsbündig, damit "Route" und "Anrufen" in
   allen Zeilen genau untereinander stehen. Von rechts: Route (gibt es immer), Anrufen, Website (nur wenn ein Händler der
   Liste eine hat: ol.tg-hl--web). Alle Buttons gleich breit (124 px passt für den längsten Text: en "Directions"). */
@media (min-width: 1100px) {
  html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag { grid-template-columns: 34px minmax(0, 1fr) 96px 256px; }
  html #body .retailer-details ol.tg-hl.tg-hl--web > li.tg-hl__eintrag { grid-template-columns: 34px minmax(0, 1fr) 96px 388px; }
  html #body .retailer-details .tg-hl__aktionen .tg-haendler-aktionen { display: grid; grid-template-columns: repeat(2, 124px);
    justify-content: end; column-gap: 8px; }
  html #body .retailer-details ol.tg-hl--web .tg-hl__aktionen .tg-haendler-aktionen { grid-template-columns: repeat(3, 124px); }
  html #body .retailer-details .tg-hl__aktionen a.tg-aktion { grid-row: 1; width: 100%; justify-content: center; box-sizing: border-box; }
  html #body .retailer-details .tg-hl__aktionen a.tg-aktion[data-tg-aktion="route"] { grid-column: -2; }
  html #body .retailer-details .tg-hl__aktionen a.tg-aktion[data-tg-aktion="anrufen"] { grid-column: -3; }
  html #body .retailer-details .tg-hl__aktionen a.tg-aktion[data-tg-aktion="website"] { grid-column: 1; }
}
@media (max-width: 1099px) {
  html #body .retailer-details p.tg-hl__km { text-align: right; }
  html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag { grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-areas: "nr info km" ". aktionen aktionen"; row-gap: 12px; column-gap: 14px; padding: 16px 4px; }
  html #body .retailer-details .tg-hl__aktionen .tg-haendler-aktionen { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 749px) {
  html #body .retailer-details { padding-bottom: 40px; }
  html #body .retailer-details ol.tg-hl > li.tg-hl__eintrag { grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 10px; }
  html #body .retailer-details p.tg-hl__name { font-size: 18px; }
}

/* Suchkasten der Händlersuche (karte.py baut das Formular, 2026-11-17): Überschrift mit kurzem Satz, Felder untereinander, Umkreis und Land nebeneinander, die Buttons
   unten. Felder selbst: buttons.css "Eingabefelder". */
html #body .tg-suche-karte .retailer-search-box.tg-hs { display: flex; flex-direction: column; padding: 28px 28px 28px;
  background: #f4f4f2; box-sizing: border-box; }
html #body .tg-hs h1.tg-hs__titel { margin: 0 0 6px; padding: 0; font-size: 32px; line-height: 1.1; color: #2f3437; }
html #body .tg-hs p.tg-hs__intro { margin: 0 0 22px; font-size: 18px; line-height: 1.4; color: #555; max-width: 40ch; }
html #body .tg-hs .tg-hs__feld { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; min-width: 0; }
html #body .tg-hs .tg-hs__feld label { display: block; margin: 0; padding: 0; font-size: 17px; line-height: 1.2; color: #2f3437;
  font-family: "Interstate Condensed", "PT Sans Narrow Bold", "Interstate Light Condensed", "PT Sans Narrow", sans-serif; font-weight: 700; }
html #body .tg-hs .tg-hs__zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); column-gap: 14px; }
html #body .tg-hs .retailer-search__buttons-div { margin-top: auto; padding-top: 6px; }
html #body .tg-hs .retailer-search__buttons-div > .retailer-search__button { min-height: 50px; }
@media (max-width: 479px) {
  html #body .tg-suche-karte .retailer-search-box.tg-hs { padding: 22px 18px 22px; }
  html #body .tg-hs .tg-hs__zeile { grid-template-columns: minmax(0, 1fr); }
  html #body .tg-hs h1.tg-hs__titel { font-size: 28px; }
}
