/* ==========================================================
   Geländer-Konfigurator – nur für konfigurator.html
   Farben kommen aus style.css (:root)
   ========================================================== */

/* Dunkler Werkstatt-Hintergrund: Stahlverlauf, feines CAD-Raster, rote Lichtkante */
.konf-abschnitt {
  padding-top: 80px; position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 40% at 8% 0%, rgba(207,42,31,.22), transparent 70%),
    radial-gradient(ellipse 50% 35% at 100% 30%, rgba(120,150,190,.14), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(165deg, #1b1f25 0%, #14171b 55%, #1a1e24 100%);
}
.konf-abschnitt::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--rot), transparent);
}
.konf-abschnitt .container { position: relative; }
.konf-abschnitt .ueberschrift p { color: #aab0b8; }
.konf-hinweis a { color: inherit; }
.konf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 40px; align-items: start; }

/* ---------- Auswahl ---------- */
.konf-gruppe {
  border: 0; margin: 0 0 18px; padding: 26px 28px; background: var(--weiss);
  border-radius: var(--radius); box-shadow: var(--schatten);
}
.konf-gruppe[hidden] { display: none; }
.konf-gruppe legend {
  float: left; width: 100%; display: flex; align-items: center; gap: 12px;
  font-weight: 600; font-size: 1.08rem; color: #15171a; margin-bottom: 16px; padding: 0;
}
.konf-gruppe legend + * { clear: both; }
.konf-nr {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--rot); color: #fff; font-size: .82rem; font-weight: 700; flex: none;
}
.konf-optionen { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.konf-option { position: relative; cursor: pointer; }
.konf-option input { position: absolute; opacity: 0; pointer-events: none; }
.konf-option span {
  display: block; height: 100%; padding: 12px 14px; border: 1.5px solid var(--linie); border-radius: var(--radius-klein);
  transition: border-color .2s, background .2s, box-shadow .2s; line-height: 1.35;
}
.konf-option b { display: block; font-weight: 600; font-size: .93rem; color: #15171a; }
.konf-option small { display: block; color: var(--text-leise); font-size: .78rem; margin-top: 3px; }
.konf-option[hidden] { display: none; }
.konf-option:hover span { border-color: #c9c9c4; }

/* Farbfeld bei der Pulverbeschichtung */
.konf-farbe { display: block; width: 100%; height: 26px; border-radius: 5px; margin-bottom: 9px; border: 1px solid rgba(0,0,0,.18); }

/* Optionen mit Vorschaubild (Beispiele aus unserer Planung) */
.konf-option.mit-bild span { padding: 0 0 12px; overflow: hidden; }
.konf-option.mit-bild img { display: block; width: 100%; aspect-ratio: 936 / 280; object-fit: cover; background: #f0f1ee; margin-bottom: 10px; }
.konf-option.mit-bild b, .konf-option.mit-bild small { padding: 0 14px; }
.konf-optionen:has(.mit-bild) { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.konf-option input:checked + span { border-color: var(--rot); background: #fdf3f2; box-shadow: 0 0 0 3px rgba(207,42,31,.12); }
.konf-option input:focus-visible + span { outline: 2px solid var(--rot); outline-offset: 2px; }

.konf-felder { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.konf-felder label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: .9rem; color: #15171a; }
.konf-felder label.breit { grid-column: 1 / -1; }
.konf-felder label[hidden] { display: none; }
.konf-felder input, .konf-felder textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; border: 1.5px solid var(--linie); border-radius: var(--radius-klein);
  background: #fff; color: var(--text); width: 100%;
}
.konf-felder input:focus, .konf-felder textarea:focus { outline: none; border-color: var(--rot); }
.konf-einheit { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text-leise); }
.konf-einheit input { max-width: 140px; }
.konf-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.konf-check[hidden] { display: none; }
.konf-check input { width: 18px; height: 18px; accent-color: var(--rot); }
.konf-hinweis { font-size: .82rem; color: var(--text-leise); margin: 12px 0 0; line-height: 1.55; }

/* ---------- Ergebnis ---------- */
.konf-ergebnis {
  position: sticky; top: 90px; background: var(--dunkel); color: #c9ccd1; border-radius: var(--radius);
  padding: 22px; box-shadow: var(--schatten-gross);
}
.konf-vorschau { background: #f7f7f5; border-radius: var(--radius-klein); overflow: hidden; }
.konf-vorschau svg { display: block; width: 100%; height: auto; }
.konf-foto { display: block; width: 100%; height: auto; margin-top: 14px; border-radius: var(--radius-klein); }
.konf-preis { margin: 20px 0 6px; }
.konf-preis small { display: block; font-size: .84rem; color: #d3d8de; }
.konf-preis strong { display: block; font-size: 1.9rem; font-weight: 700; color: #fff; letter-spacing: -.02em; line-height: 1.25; }
.konf-preis span { font-size: .86rem; color: #d3d8de; }
.konf-angebot {
  margin: 14px 0 0; padding: 12px 14px; font-size: .9rem; line-height: 1.55; color: #fff3d6;
  background: rgba(255, 190, 80, .12); border-left: 3px solid #ffb84d; border-radius: 0 var(--radius-klein) var(--radius-klein) 0;
}
.konf-angebot b { color: #ffd27a; font-weight: 600; }
.konf-preis[hidden] { display: none; }
.konf-zusammenfassung { list-style: none; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px solid rgba(255,255,255,.1); font-size: .86rem; line-height: 1.5; }
.konf-zusammenfassung li { display: flex; justify-content: space-between; gap: 14px; padding: 3px 0; }
.konf-zusammenfassung li span:first-child { color: #b9bec6; }
.konf-zusammenfassung li span:last-child { color: #fff; text-align: right; }
.konf-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.konf-knoepfe .knopf { justify-content: center; flex: 1 1 auto; cursor: pointer; font-family: inherit; }
.konf-ergebnis .knopf:not(.voll) { border-color: rgba(255,255,255,.45); color: #fff; }
.konf-ergebnis .knopf:not(.voll):hover { background: #fff; color: var(--dunkel); }
.konf-ergebnis .konf-hinweis { color: #b9bec6; }

@media (max-width: 960px) {
  .konf { grid-template-columns: 1fr; gap: 24px; }
  .konf-ergebnis { position: static; order: -1; }
}
@media (max-width: 560px) {
  .konf-gruppe { padding: 20px 16px; }
  .konf-felder { grid-template-columns: 1fr; }
  .konf-optionen { grid-template-columns: 1fr 1fr; }
  .konf-ergebnis { padding: 14px; }
  .konf-preis strong { font-size: 1.55rem; }
}
