/* =====================================================================
   Konfiguratoren (section.hd-konf) der Heidelberger Leistungsseiten.
   Aufbau (Quelle tools/eigene-seiten/heidelberg/*.html):
     .hd-konf__wrap--neu
       .hd-konf__titel   Überschrift + Lead über der Karte (ganze Breite)
       .hd-konf__kopf    linke Kartenseite, dunkel: Bild (füllt die Höhe), Einleitung, Fragen als Liste (.hd-konf__fragen)
       .hd-konf__box     rechte Kartenseite, hell: Formular mit Schrittleiste
       .lx-konf__mehr    optionaler Text unter der Karte (ganze Breite, an der Kartenteilung ausgerichtet)
   Kopf und Formular bilden zusammen eine Karte (Fläche/Schatten über ::before). Die Schritte liegen übereinander
   und haben dieselbe Mindesthöhe --q-h (seiten-heidelberg.js) – so springt beim Schrittwechsel nichts.
   Auswahl als Pillen bzw. Kacheln (assets/js/konfigurator.js), Schrittleiste mit Namen.
   ===================================================================== */
.hd-konf {
  --kq-rand: rgba(42, 32, 28, .13); --kq-fehler: #B5503F;
  --kq-rad: 28px; --kq-pad: clamp(1.5rem, 1rem + 1.6vw, 2.5rem);
  --kq-schatten: 0 1px 2px rgba(42, 32, 28, .05), 0 48px 90px -56px rgba(42, 32, 28, .55), 0 18px 36px -26px rgba(42, 32, 28, .22);
}
main[data-komposition] > section.hd-konf.kx-frei.kx-text,
main[data-komposition] > section.hd-konf.kx-frei { padding-block: clamp(3.5rem, 2rem + 4vw, 6rem); }

/* ---------- Raster ---------- */
.hd-konf .hd-konf__wrap--neu {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
  gap: 0; align-items: stretch; margin-top: 0;
}
.hd-konf .hd-konf__wrap--neu::before {
  content: ""; grid-row: 2; grid-column: 1 / -1; z-index: 0;
  border-radius: var(--kq-rad); background: #fff; box-shadow: var(--kq-schatten); pointer-events: none;
}
.hd-konf .hd-konf__wrap--neu > .hd-konf__titel { grid-row: 1; grid-column: 1 / -1; }
.hd-konf .hd-konf__wrap--neu > .hd-konf__kopf { grid-row: 2; grid-column: 1; }
.hd-konf .hd-konf__wrap--neu > .hd-konf__box { grid-row: 2; grid-column: 2; }
.hd-konf .hd-konf__wrap--neu > .lx-konf__mehr { grid-row: 3; grid-column: 1 / -1; }
.hd-konf .hd-konf__wrap--neu > :not(.hd-konf__titel) { position: relative; z-index: 1; }

/* ---------- Überschrift über der Karte ---------- */
.hd-konf .hd-konf__wrap--neu > .hd-konf__titel.lg-text__head { position: static; top: auto; margin: 0 0 clamp(2rem, 1.2rem + 2vw, 3rem); }
main[data-komposition] > section.hd-konf .hd-konf__titel h2:not(.sr-only),
.hd-konf .hd-konf__titel h2 { margin: 0; max-width: 22ch; color: var(--espresso); text-wrap: balance; }
main[data-komposition] > section.hd-konf .hd-konf__titel h2.hd-lang:not(.sr-only),
.hd-konf .hd-konf__titel h2.hd-lang { max-width: 26ch; }
.hd-konf .hd-konf__titel h2 strong { font-weight: inherit; }
main.lx > section.hd-konf .hd-konf__titel .lead,
.hd-konf .hd-konf__titel .lead { margin: 1rem 0 0; max-width: 46ch; font-size: var(--t-l); font-weight: 300; line-height: 1.45; color: var(--mokka); }
.hd-konf .hd-konf__titel .lead strong { font-weight: inherit; }

/* ---------- Kopf: linke, dunkle Kartenseite ---------- */
.hd-konf .hd-konf__wrap--neu .hd-konf__kopf {
  display: flex; flex-direction: column; gap: 0; min-width: 0; overflow: hidden;
  border-radius: var(--kq-rad) 0 0 var(--kq-rad); background: var(--espresso); color: var(--on-dark);
}
/* Bild füllt den Platz über dem Text (Gesicht im Ausschnitt), ohne Bewegung */
.hd-konf .hd-konf__kopf .hd-konf__bild {
  position: relative; flex: 1 0 13rem; width: auto; height: auto; min-height: 13rem; margin: 0;
  border-radius: 0; overflow: hidden; background: #3A2D27; box-shadow: none;
}
.spage--heidelberg .hd-konf .hd-konf__kopf .hd-konf__bild img,
.hd-konf .hd-konf__kopf .hd-konf__bild img {
  position: absolute; inset: 0; left: 0; top: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto;
  object-fit: cover; object-position: var(--kq-fokus, 50% 30%); border-radius: 0; transform: none;
}
/* Ausschnitt je Bild: Gesicht sichtbar halten */
.hd-konf__bild img[src*="fettabsaugung-gruende"] { --kq-fokus: 50% 8%; }
.hd-konf__bild img[src*="teaser-brustvergroesserung-mit-eigenfett"] { --kq-fokus: 50% 22%; }
.hd-konf__bild img[src*="brustvergroesserung-mit-eigenfett-hero"] { --kq-fokus: 62% 25%; }
.hd-konf__bild img[src*="haarbehandlungen"] { --kq-fokus: 55% 12%; }
.hd-konf__bild img[src*="lippen-konfigurator"] { --kq-fokus: 42% 40%; }
.hd-konf__bild img[src*="nasen-konfigurator"] { --kq-fokus: 38% 45%; }

.hd-konf .hd-konf__kopf .hd-konf__text { display: block; padding: var(--kq-pad); }
.hd-konf .hd-konf__kopf .lg-text__body { max-width: none; }
main.lx > section.hd-konf .hd-konf__kopf .lg-text__body p,
.hd-konf .hd-konf__kopf .lg-text__body p { margin: 0; max-width: 46ch; font-size: 1rem; line-height: 1.65; color: var(--on-dark); }
main.lx > section.hd-konf .hd-konf__kopf .lg-text__body p strong { font-weight: 500; color: var(--licht); }

/* Fragen der Einleitung als ruhige Liste */
main.lx > section.hd-konf .hd-konf__kopf .hd-konf__fragen,
.hd-konf .hd-konf__fragen { margin: 1.5rem 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line-dark); }
main.lx > section.hd-konf .hd-konf__fragen li,
.hd-konf .hd-konf__fragen li {
  position: relative; margin: 0; padding: .7rem 0 .7rem 1.6rem; border-top: 1px solid var(--line-dark);
  font-size: 1rem; font-weight: 400; line-height: 1.45; color: var(--licht);
}
.hd-konf .hd-konf__fragen li::before {
  content: ""; position: absolute; left: .1rem; top: calc(.7rem + .725em - 5px);
  width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--rose);
}

/* ---------- Formular: rechte, helle Kartenseite ---------- */
.hd-konf .hd-konf__wrap--neu .hd-konf__box--neu {
  display: flex; flex-direction: column; grid-template-columns: none; overflow: visible; min-width: 0;
  border-radius: 0 var(--kq-rad) var(--kq-rad) 0; background: #fff; box-shadow: none;
}
.hd-konf .hd-konf__box--neu .hd-konf__form { flex: 1; display: flex; flex-direction: column; padding: var(--kq-pad); }
.hd-konf .hd-konf__box--neu .hd-q--schritte { flex: 1; grid-template-rows: auto 1fr; scroll-margin-top: calc(var(--kq-pad) + .5rem); } /* beim Schrittwechsel: Kartenkante knapp unter der Ankerleiste */

/* Schrittleiste: Segmente mit Namen, rechts „Schritt 1/4“ */
.hd-konf .kq .hd-q__prog { display: flex; align-items: flex-start; gap: 1.5rem; margin: 0 0 clamp(1.5rem, 1rem + 1vw, 2rem); }
.hd-konf .kq .hd-q__stand { order: 2; flex: none; margin: -.15rem 0 0; font-size: var(--t-xs); font-variant-numeric: tabular-nums; color: var(--muted); }
.hd-konf .kq .hd-q__bar { display: none; }
.kq-leiste { flex: 1; display: flex; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.kq-leiste li { flex: 1; min-width: 0; display: grid; gap: .5rem; }
.kq-leiste li::before { content: ""; display: block; height: 3px; border-radius: 3px; background: var(--nude); transition: background-color .35s var(--ease, ease); }
.kq-leiste li.is-fertig::before { background: var(--rose); }
.kq-leiste li.is-jetzt::before { background: var(--espresso); }
.kq-leiste span { font-size: .8125rem; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kq-leiste li.is-fertig span { color: var(--mokka); }
.kq-leiste li.is-jetzt span { color: var(--espresso); font-weight: 500; }
.kq-leiste:not(.kq-leiste--namen) span { display: none; }

/* Fragen im 2er-Raster */
.hd-konf .kq .bfields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.4rem 1.75rem; }
.hd-konf .kq .kq-feld { position: relative; gap: .15rem; }
.hd-konf .kq :is(.bfield > label:not(.bconsent), .bfield__label) { font-size: var(--t-s); font-weight: 500; line-height: 1.35; color: var(--espresso); }
.hd-konf .kq .hd-q__req { color: var(--rose); }
.hd-konf .kq :is(.hd-q__tip, .hd-q__hint) { margin: 0 0 .1rem; font-size: .8125rem; line-height: 1.45; color: var(--muted); }
.kq-nativ {
  position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none;
}

/* Pillen (kurze Werte) und Kacheln */
.kq-wahl { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.kq-opt {
  position: relative; display: inline-flex; align-items: center; gap: .6rem;
  min-height: 42px; padding: .45rem .95rem .45rem .8rem;
  border: 0; border-radius: 999px; background: var(--porzellan);
  box-shadow: inset 0 0 0 1px var(--kq-rand);
  font: inherit; font-size: var(--t-s); line-height: 1.25; text-align: left; color: var(--espresso);
  cursor: pointer; transition: background-color .2s, box-shadow .2s, color .2s;
}
.kq-opt i { flex: none; position: relative; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(42, 32, 28, .28); transition: box-shadow .2s, background-color .2s; }
.kq-opt[aria-checked="true"] { background: var(--espresso); color: var(--licht); box-shadow: inset 0 0 0 1px var(--espresso); }
.kq-opt[aria-checked="true"] i { background: var(--rose); box-shadow: inset 0 0 0 1.5px var(--rose); }
/* Häkchen im gewählten Punkt */
.kq-opt[aria-checked="true"] i::after {
  content: ""; position: absolute; left: 5px; top: 2.5px; width: 4px; height: 8px;
  border: solid var(--licht); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.kq-opt:focus-visible { outline: 2px solid var(--mokka); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .kq-opt:not([aria-checked="true"]):hover { box-shadow: inset 0 0 0 1px rgba(123, 86, 72, .6); background: #fff; }
}
.kq-wahl--kurz .kq-opt { justify-content: center; min-width: 56px; padding-inline: 1.1rem; }
.kq-wahl--kurz .kq-opt i { display: none; }
.kq-wahl--kacheln { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bfield--full > .kq-wahl--kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kq-wahl--kacheln .kq-opt { border-radius: 14px; min-height: 46px; }

/* Schritte mit wenigen Fragen: große Kacheln über die ganze Breite, Inhalt mittig zwischen Leiste und Navigation */
.hd-konf .kq .kq-seite--luftig > .bfields { gap: 2rem; align-content: center; }
.hd-konf .kq .kq-seite--luftig .kq-feld { grid-column: 1 / -1; }
.kq-seite--luftig :is(.bfield > label:not(.bconsent), .bfield__label) { font-size: var(--t-m, 1.0625rem) !important; }
.kq-seite--luftig .kq-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .6rem; margin-top: .75rem; }
.kq-seite--luftig .kq-wahl--kacheln { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.kq-seite--luftig .kq-opt { min-height: 64px; border-radius: 16px; justify-content: flex-start; padding: .7rem 1.1rem; font-size: var(--t-s); }
.kq-seite--luftig .kq-wahl--kurz .kq-opt { justify-content: center; }
.kq-seite--luftig .kq-wahl--kurz .kq-opt i { display: block; position: absolute; opacity: 0; }

/* Bildauswahl (Brustform, Nasenform …) kompakt, gleiche Optik */
.hd-konf .kq .hd-q__bilder { gap: .55rem; margin-top: .5rem; }
.hd-konf .kq .hd-q__bilder[style*="--n:6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hd-konf .kq .hd-q__bild > span { border-radius: 16px; background: var(--porzellan); box-shadow: inset 0 0 0 1px var(--kq-rand); transition: box-shadow .2s; }
.hd-konf .kq .hd-q__bild img { max-height: 6.5rem; }
.spage--heidelberg .hd-konf .kq .hd-q__bild img[src$=".svg"] { max-height: 6.5rem; width: auto; margin: .35rem auto 0; background: none; }
.hd-konf .kq .hd-q__bild b { padding: .55rem .7rem; font-size: var(--t-xs); line-height: 1.3; }
.hd-konf .kq .hd-q__bild input:checked + span { box-shadow: inset 0 0 0 1.5px var(--espresso); }
.hd-konf .kq .ochip span { border-radius: 999px; }
.hd-konf .kq .hd-q__uebersicht { background: var(--porzellan); }

/* Kontaktdaten */
.hd-konf .kq .bfield input:not([type=checkbox]):not([type=radio]) { min-height: 46px; padding: .6rem .95rem; border-radius: 12px; background: var(--porzellan); font-size: var(--t-s); box-shadow: inset 0 0 0 1px var(--kq-rand); }
.hd-konf .kq .bfield input:not([type=checkbox]):not([type=radio]):focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--mokka), 0 0 0 4px rgba(176, 136, 121, .16); }
.hd-konf .kq .bfield.is-error input:not([type=checkbox]):not([type=radio]) { box-shadow: inset 0 0 0 1.5px var(--kq-fehler); }
.hd-konf .kq .hd-q__page:last-child .bfields { gap: .85rem 1.1rem; }
.hd-konf .kq .hd-q__page:last-child .bfield > label:not(.bconsent) { font-size: var(--t-xs); }
.hd-konf .kq .bconsent { font-size: var(--t-xs) !important; }

/* Fehler */
.hd-konf .kq .is-error :is(.bfield > label:not(.bconsent), .bfield__label) { color: #9A3F30; }
.hd-konf .kq .is-error .kq-opt { box-shadow: inset 0 0 0 1.5px var(--kq-fehler); }
.hd-konf .kq .is-error .bconsent { color: #9A3F30; }
.hd-konf .kq .is-error .bconsent input { outline: 2px solid var(--kq-fehler); outline-offset: 2px; }

/* Navigation unten in der Karte, überall an derselben Stelle */
.hd-konf .kq .hd-q__page .hd-q__nav { align-items: center; margin-top: auto; padding-top: 1.75rem; gap: .6rem; border: 0; }
.hd-konf .kq .hd-q__nav > * { margin-block: 0; }
.hd-konf .kq .hd-q__page > .bfields { flex: 1 0 auto; }
.hd-konf .kq .hd-q__nav .btn { min-height: 48px; padding: 0 1.9rem; font-size: var(--t-s); }
.hd-konf .kq .hd-q__nav .bnav__back {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.3rem;
  border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--kq-rand);
  font: inherit; font-size: var(--t-s); font-weight: 400; color: var(--espresso); text-decoration: none; cursor: pointer;
  transition: box-shadow .2s, background-color .2s;
}
@media (hover: hover) and (pointer: fine) { .hd-konf .kq .hd-q__nav .bnav__back:hover { box-shadow: inset 0 0 0 1px var(--espresso); } }
.hd-konf .kq .hd-q__nav .bnav__back:focus-visible { outline: 2px solid var(--mokka); outline-offset: 3px; }
.hd-konf .kq .hd-q__neu { margin-left: 0; }

/* ---------- Text unter der Karte (z. B. „Der Fettabsaugung-Konfigurator“) ---------- */
main.lx .hd-konf .lx-konf__mehr { display: block; margin: clamp(2.5rem, 1.5rem + 2.5vw, 3.75rem) 0 0; padding: 0; border: 0; }
/* Spalten wie die Karte: Titel bündig mit dem Text links, Absatz bündig mit dem Formular rechts */
main.lx .hd-konf .lx-konf__mehr p {
  --kq-teil: calc((100% + 2 * var(--kq-pad)) * 5 / 13);
  display: grid; grid-template-columns: var(--kq-teil) minmax(0, 1fr); align-items: start;
  margin: 0; max-width: none; padding: 1.75rem var(--kq-pad) 0; border-top: 1px solid var(--lx-linie, rgba(42, 32, 28, .12));
  font-size: 1.0625rem !important; line-height: 1.7 !important; color: var(--lx-text, #40322C);
}
main.lx .hd-konf .lx-konf__mehr p b {
  display: block; margin: 0; padding-right: var(--kq-pad); max-width: 18ch;
  font-size: var(--lx-h3, 1.375rem); font-weight: 300; font-stretch: 112%; line-height: 1.22; letter-spacing: -.005em; color: var(--espresso);
}

/* ---------- schmaler ---------- */
@container (max-width: 640px) { .hd-konf .kq .hd-q__bilder[style*="--n:6"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 520px) {
  .hd-konf .kq .bfields { grid-template-columns: minmax(0, 1fr); }
  .bfield--full > .kq-wahl--kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .hd-konf .hd-konf__wrap--neu { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
  main.lx .hd-konf .lx-konf__mehr p { --kq-teil: calc((100% + 2 * var(--kq-pad)) * 4 / 11); }
}
@media (max-width: 900px) {
  .hd-konf { --kq-rad: 24px; }
  .hd-konf .hd-konf__wrap--neu { grid-template-columns: minmax(0, 1fr); }
  .hd-konf .hd-konf__wrap--neu::before { grid-row: 2 / 4; grid-column: 1; }
  .hd-konf .hd-konf__wrap--neu > .hd-konf__kopf { grid-row: 2; grid-column: 1; border-radius: var(--kq-rad) var(--kq-rad) 0 0; }
  .hd-konf .hd-konf__wrap--neu > .hd-konf__box { grid-row: 3; grid-column: 1; border-radius: 0 0 var(--kq-rad) var(--kq-rad); }
  .hd-konf .hd-konf__wrap--neu > .lx-konf__mehr { grid-row: 4; }
  .hd-konf .hd-konf__kopf .hd-konf__bild { flex: none; min-height: 0; aspect-ratio: 21 / 9; }
  main.lx .hd-konf .lx-konf__mehr p { display: block; padding-inline: 0; }
  main.lx .hd-konf .lx-konf__mehr p b { max-width: none; margin-bottom: .6rem; padding: 0; }
}
@media (max-width: 760px) {
  .hd-konf { --kq-rad: 22px; --kq-pad: 1.25rem; }
  .hd-konf .hd-konf__kopf .hd-konf__bild { aspect-ratio: 16 / 10; }
  .kq-leiste--namen span { visibility: hidden; }
  .kq-leiste--namen li.is-jetzt span { visibility: visible; overflow: visible; }
  .hd-konf .kq .hd-q__prog { gap: 1rem; }
  .hd-konf .kq .hd-q__nav .btn { flex: 1; width: auto; margin-left: 0; padding-inline: 1.25rem; }
  .hd-konf .kq .hd-q__nav .bnav__back { order: 0; }
  .hd-konf .kq .hd-q__page:last-child .bfields { grid-template-columns: minmax(0, 1fr); }
  .kq-seite--luftig .kq-opt { min-height: 54px; }
  .kq-seite--luftig .kq-wahl--kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  /* schmale Kacheln: Text mittig ohne Punkt, damit lange Wörter („Asymmetrische“) in die Kachel passen */
  .kq-seite--luftig .kq-wahl--kacheln .kq-opt { justify-content: center; padding: .6rem .7rem; text-align: center; }
  .kq-seite--luftig .kq-wahl--kacheln .kq-opt i { display: none; }
  /* Handy: jeder Schritt so hoch wie sein Inhalt (keine leere Karte); beim Wechsel scrollt seiten-heidelberg.js zum Formularanfang */
  .hd-konf .hd-q--schritte > .hd-q__page { min-height: 0; }
  .hd-konf .hd-q--schritte > .hd-q__page[hidden] { display: none !important; }
  .hd-konf .kq .kq-seite--luftig > .bfields { align-content: start; }
}
@media (prefers-reduced-motion: reduce) { .kq-opt, .kq-opt i, .kq-leiste li::before, .hd-konf .kq .hd-q__bild > span { transition: none; } }
