/* KFZ-Transporte Saar — Layout-Basis + Komponenten fuer Preisrechner und Formular.
   Die Sektionslayouts stehen bewusst weiterhin inline im HTML (1:1 aus dem Design uebernommen).
   Hier steht nur, was Inline-Styles nicht koennen: Hover, Fokus, Media Queries, Widgets. */

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFFFFF;
  color: #24272A;
  font-family: Barlow, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
/* Muss vor allen Komponenten stehen: sonst gewinnt ein eigenes display gegen [hidden]. */
[hidden] { display: none !important; }
a { color: #C25411; text-decoration: none; }
a:hover { color: #24272A; }
input, select, textarea, button { font-family: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid #E8722A;
  outline-offset: 1px;
}
::placeholder { color: #9AA0A4; }

@media (min-width: 761px) {
  [data-price-row] { grid-template-columns: 1fr auto; align-items: baseline; gap: 20px; }
  [data-price-row] > span:last-child { text-align: right; }
}
@media (max-width: 760px) {
  header > div, header nav { justify-content: center; }
  header > div > a:first-child { width: 100%; justify-content: center; }
  footer > div { text-align: center; justify-items: center; }
  footer > div > div > div { justify-items: center; }
  footer img { margin-left: auto; margin-right: auto; }
  footer p { margin-left: auto; margin-right: auto; }
}

/* --- Hover-Zustaende (ersetzen die style-hover-Attribute des Design-Runtimes) --- */
.btn-primary:hover { background: #C25411 !important; color: #fff !important; }
.btn-ghost:hover { background: #fff !important; color: #2B2E30 !important; }
.card-hover:hover { border-color: #33373A !important; }
.link-accent:hover { color: #E8722A !important; }

/* --- Formularbeschriftungen --- */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #5C6367;
  margin-bottom: 6px;
}

/* --- Ortssuche mit Vorschlagsliste --- */
.ac-field { position: relative; display: block; }
.ac-input {
  width: 100%;
  border: 1px solid #D3D7DA;
  border-radius: 2px;
  padding: 13px;
  font-size: 16px;
}
.ac-input.is-resolved { border-color: #9BBE9B; background-image: linear-gradient(transparent, transparent); }
.ac-input.is-unresolved { border-color: #E0B48F; }

.ac-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid #D3D7DA;
  border-radius: 2px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
  max-height: 268px;
  overflow-y: auto;
}
.ac-list[hidden] { display: none; }
.ac-item {
  padding: 9px 11px;
  font-size: 15px;
  line-height: 1.3;
  cursor: pointer;
  border-radius: 2px;
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.ac-item:hover, .ac-item.is-active { background: #F1F2F3; }
.ac-item[aria-selected="true"] { background: #33373A; color: #fff; }
.ac-plz { font-variant-numeric: tabular-nums; font-weight: 700; color: #33373A; flex: none; }
.ac-item[aria-selected="true"] .ac-plz { color: #fff; }
.ac-ort { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-meta { font-size: 12px; color: #8A9095; flex: none; }
.ac-item[aria-selected="true"] .ac-meta { color: #C9CDD0; }
.ac-status { padding: 9px 11px; font-size: 14px; color: #8A9095; }

/* --- Startort ein-/ausklappen --- */
.start-toggle-wrap { display: grid; gap: 10px; }
.start-toggle {
  justify-self: start;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: #5C6367;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  border-bottom: 1px dotted #A9AEB2;
}
.start-toggle:hover { color: #C25411; }
.start-toggle strong { font-weight: 700; color: #24272A; }

/* --- Streckenaufstellung --- */
.route-breakdown {
  margin-top: 10px;
  display: grid;
  gap: 5px;
  font-size: 13px;
  line-height: 1.4;
  color: #5C6367;
}
.route-breakdown[hidden] { display: none; }
.route-row { display: flex; justify-content: space-between; gap: 12px; }
.route-row span:last-child { font-variant-numeric: tabular-nums; flex: none; }
.route-row.is-total {
  border-top: 1px solid #DCDFE1;
  margin-top: 3px;
  padding-top: 6px;
  font-weight: 700;
  color: #24272A;
}
.route-note { color: #8A9095; font-size: 12px; }
.route-breakdown--light { background: #fff; border: 1px solid #E2E5E7; padding: 14px 16px; margin-top: 0; }

/* --- Auswahl-Chips (Fahrzeugart, Anzahl) --- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid #D3D7DA;
  background: #FFFFFF;
  color: #24272A;
  padding: 11px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
}
.chip:hover { border-color: #33373A; }
.chip.is-on { background: #33373A; border-color: #33373A; color: #FFFFFF; }

/* --- Beispielstrecken im Einsatzgebiet ---
   Die Trennlinien sitzen bewusst an den Karten selbst, nicht als 1px-Raster hinter
   dem Grid: sonst scheint der graue Hintergrund durch, sobald die letzte Reihe
   nicht voll besetzt ist (bei 3 Spalten und 8 Karten etwa). */
.beispiel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  border-top: 1px solid #DCDFE1;
  border-left: 1px solid #DCDFE1;
}
.beispiel {
  background: #fff;
  padding: 22px 24px;
  display: grid;
  gap: 5px;
  align-content: start;
  border-right: 1px solid #DCDFE1;
  border-bottom: 1px solid #DCDFE1;
}
.beispiel:hover { background: #FAFAFB; }
.beispiel-strecke { font-weight: 700; font-size: 16px; line-height: 1.35; color: #24272A; }
.beispiel-km { font-size: 14px; color: #7A8085; }
.beispiel-preis {
  font-family: Oswald, sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  color: #24272A;
  margin-top: 4px;
}

/* --- Gewichtsvorbehalt beim Doppeltransport --- */
.gewicht-hinweis {
  margin-top: 12px;
  background: #FBE9DF;
  border-left: 4px solid #C25411;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  color: #6E3208;
}
.gewicht-hinweis strong { color: #24272A; }

/* --- Karte --- */
.map-card { border: 1px solid #E2E5E7; background: #fff; padding: 16px; }
.map-card[hidden] { display: none; }
.map-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.map-total { font-family: Oswald, sans-serif; font-size: 20px; font-weight: 600; color: #24272A; }
.map-canvas { height: 260px; width: 100%; background: #EDEFF0; }
.map-hint { margin: 8px 0 0; font-size: 11px; line-height: 1.45; color: #8A9095; }
.leaflet-container { font: inherit; }

/* --- Honeypot: fuer Menschen unsichtbar, aber nicht display:none (Bots pruefen darauf) --- */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Ladezustand des Absende-Buttons --- */
button[data-submit].is-busy { opacity: .72; cursor: progress; }

/* --- Statuszeile am Preisfeld --- */
.price-busy { opacity: .55; }

/* --- Ersatzeingabe, wenn die Kartendienste abgelehnt sind --- */
.manual-km {
  background: #FBE9DF;
  border-left: 4px solid #C25411;
  padding: 14px 16px;
  display: grid;
}
.manual-km--light { background: #FBE9DF; }
.manual-km-hint { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: #6E3208; }
.manual-km-btn {
  justify-self: start;
  background: #C25411;
  color: #fff;
  border: none;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
}
.manual-km-btn:hover { background: #24272A; }
.manual-km .field-label { color: #6E3208; }

/* --- Einwilligung zu externen Diensten --- */
.consent {
  position: fixed;
  z-index: 2000;
  left: 0;
  right: 0;
  bottom: 0;
  background: #24272A;
  color: #E6E8EA;
  border-top: 4px solid #E8722A;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .35);
}
.consent-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 32px;
  justify-content: space-between;
}
.consent-text { flex: 1 1 420px; min-width: 0; }
.consent-title {
  font-family: Oswald, sans-serif;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  margin-bottom: 7px;
}
.consent-text p { margin: 0 0 7px; font-size: 15px; line-height: 1.55; }
.consent-meta { color: #A9AEB2; font-size: 13.5px !important; }
.consent-meta a { color: #E8722A; text-decoration: underline; }
.consent-meta a:hover { color: #fff; }
.consent-buttons { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }
/* Beide Schaltflaechen bewusst gleich gross und gleich erreichbar — Ablehnen darf
   nicht schwerer zu treffen sein als Erlauben. */
.consent-btn {
  min-width: 168px;
  padding: 15px 26px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-radius: 2px;
  cursor: pointer;
  border: 2px solid transparent;
}
.consent-btn--yes { background: #E8722A; color: #fff; border-color: #E8722A; }
.consent-btn--yes:hover { background: #C25411; border-color: #C25411; }
.consent-btn--no { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.consent-btn--no:hover { background: #fff; color: #24272A; border-color: #fff; }

.consent-fab {
  position: fixed;
  z-index: 1900;
  left: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #33373A;
  color: #E6E8EA;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
}
.consent-fab:hover { background: #E8722A; color: #fff; border-color: #E8722A; }

@media (max-width: 620px) {
  .consent-inner { padding: 18px; gap: 16px; }
  .consent-buttons { width: 100%; }
  .consent-btn { flex: 1 1 140px; min-width: 0; }
}

/* --- Rechtstexte (Impressum, Datenschutz) --- */
.legal { max-width: 820px; margin: 0 auto; padding: clamp(40px, 6vw, 68px) 24px 80px; }
.legal h1 {
  font-family: Oswald, sans-serif;
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 10px;
  line-height: 1.1;
}
.legal h2 {
  font-family: Oswald, sans-serif;
  font-size: 21px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 40px 0 12px;
  padding-top: 18px;
  border-top: 1px solid #E2E5E7;
  line-height: 1.2;
}
.legal p, .legal li { font-size: 16px; line-height: 1.65; color: #3E4448; margin: 0 0 14px; }
.legal ul { margin: 0 0 14px; padding-left: 22px; }
.legal li { margin-bottom: 7px; }
.legal code { font-size: 14px; background: #F4F5F6; padding: 1px 5px; border-radius: 2px; }
.legal em { color: #8A3A0B; font-style: normal; font-weight: 600; }
.legal-lead { font-size: 17px !important; color: #5C6367 !important; margin-bottom: 30px !important; }
.legal-todo {
  background: #FBE9DF;
  border-left: 4px solid #C25411;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.55;
  color: #6E3208;
  margin-bottom: 8px;
}
.legal-todo em { color: inherit; }
.legal-back { margin-top: 46px !important; padding-top: 22px; border-top: 1px solid #E2E5E7; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
