/* =========================================================================
   KSAplate — Fahrzeug-Detailseite im mobile.de-Aufbau (2026-10-05)
   Vermessen an einer mobile.de-Inseratsseite bei 1512 px:
   graue Fläche, EINE Spalte 978 px = 648 px Inhalt + 16 px + 314 px Kasten,
   der Kasten läuft mit (sticky, top 16 px); weiße Karten, Radius 16 px,
   1-px-Ring statt Schatten; Kartentitel 24 px.
   Marke KSAplate: nur Grün, kein Gold, keine mobile.de-Assets.

   Regeln: Namensraum .kd-, reines CSS (Tailwind-Bundle eingefroren),
   nur helles Thema, logische Eigenschaften für /ar.
   Die Wurzel .kc-detail (ksa-cars.css) liefert weiter die randlose Fläche.
   ========================================================================= */

.kc-detail {
    --kd-green: var(--ksa-green, #006C35);
    --kd-green-dark: var(--ksa-green-dark, #004F26);
    --kd-green-soft: #eaf5ee;
    --kd-ink: #1a1a1a;
    --kd-ink-2: #4b4b4f;
    --kd-ink-3: #8a8a90;
    --kd-line: #d5dae0;
    --kd-soft: #f2f4f7;
    background-color: #e6eaf0;
    color: var(--kd-ink);
}
.kc-detail [x-cloak] { display: none !important; }
[dir="rtl"] .kd-flip { transform: scaleX(-1); }

.kd-wrap { width: 100%; max-width: 1010px; margin-inline: auto; padding: 16px 16px 48px; }

/* ---------------------------------------------------------------- Kopf */
.kd-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.kd-back { display: inline-flex; align-items: center; gap: 8px; color: var(--kd-ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.kd-back:hover { color: var(--kd-green-dark); }
.kd-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--kd-ink-3); }
.kd-crumbs a { color: var(--kd-ink-3); text-decoration: none; }
.kd-crumbs a:hover { color: var(--kd-green-dark); text-decoration: underline; }

/* --------------------------------------------------------------- Raster */
.kd-grid { display: grid; grid-template-columns: minmax(0, 648fr) minmax(280px, 314fr); gap: 16px; align-items: start; }
.kd-aside { grid-column: 2; grid-row: 1; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 10px; }
.kd-main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.kd-box { background: #fff; border-radius: 16px; box-shadow: 0 0 0 1px var(--kd-line); }
.kd-pad { padding: 16px 16px 20px; }
.kd-h { margin: 0 0 16px; font-size: 24px; line-height: 1.3; font-weight: 700; color: var(--kd-ink); }
.kd-p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: var(--kd-ink-2); }
.kd-note { margin: 4px 0 0; font-size: 13px; color: var(--kd-ink-3); }

/* -------------------------------------------------------------- Knöpfe */
.kd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px;
    padding: 0 16px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.kd-btn--main { background: var(--kd-green); color: #fff; min-height: 48px; font-size: 16px; }
.kd-btn--main:hover { background: var(--kd-green-dark); color: #fff; }
.kd-btn--main .fa-whatsapp { font-size: 20px; }
.kd-btn--line { background: #fff; color: var(--kd-green-dark); box-shadow: inset 0 0 0 1px var(--kd-green); }
.kd-btn--line:hover { background: var(--kd-green-soft); }
.kd-btn--danger { color: #c0342a; box-shadow: inset 0 0 0 1px #e3b4b0; }
.kd-btn--danger:hover { background: #fdf0ef; }
.kd-btn--auto { width: auto; }
.kd-btn--light { width: auto; background: #fff; color: var(--kd-green-dark); }
.kd-btn--light:hover { background: var(--kd-green-soft); }
.kd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

/* ------------------------------------------------------ Kontaktkasten */
.kd-cta { padding: 16px; }
.kd-title { margin: 0; font-size: 20px; line-height: 1.3; font-weight: 700; color: var(--kd-ink); overflow-wrap: anywhere; }
.kd-subline { margin: 4px 0 0; font-size: 14px; color: var(--kd-ink-2); }
.kd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.kd-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 4px; background: var(--kd-soft); color: var(--kd-ink-2); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.kd-tags .kd-tag-plate, .kd-tags .kd-tag-tier { background: var(--kd-green-soft); color: var(--kd-green-dark); }
.kd-price { margin: 12px 0 0; font-size: 28px; line-height: 1.15; font-weight: 800; color: var(--kd-ink); font-variant-numeric: tabular-nums; }
.kd-nego { margin: 4px 0 0; font-size: 13px; color: var(--kd-green-dark); font-weight: 600; }
.kd-rule { height: 1px; margin: 14px 0; background: #e6e8ec; }

.kd-seller { display: flex; align-items: center; gap: 10px; }
.kd-mono {
    display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 8px;
    background: var(--kd-green-soft); color: var(--kd-green-dark); font-weight: 800; font-size: 15px;
}
.kd-mono img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; }
.kd-seller-txt { display: flex; flex-direction: column; min-width: 0; }
.kd-seller-name { font-size: 15px; font-weight: 700; color: var(--kd-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.kd-seller-name:hover { color: var(--kd-green-dark); text-decoration: underline; }
.kd-seller-where { font-size: 13px; color: var(--kd-ink-2); }
.kd-seller--lg .kd-mono { width: 56px; height: 56px; font-size: 20px; }
.kd-seller--lg .kd-seller-name { font-size: 17px; }

.kd-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 10px; font-size: 15px; font-weight: 700; }
.kd-phone a { color: var(--kd-ink); text-decoration: none; }
.kd-reveal { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--kd-green-dark); font-size: 14px; font-weight: 600; cursor: pointer; }
.kd-reveal:hover { text-decoration: underline; }
.kd-cta > .kd-btn--main { margin-top: 10px; }
.kd-phone + .kd-btn--main { margin-top: 0; }

.kd-disclaim { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--kd-ink-3); }
.kd-disclaim a { color: var(--kd-green-dark); font-weight: 600; }
.kd-owner-h { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--kd-ink-2); text-transform: uppercase; letter-spacing: .04em; }
.kd-meta { margin: 0; padding-inline: 4px; font-size: 13px; color: var(--kd-ink-3); }
.kd-report { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--kd-ink-2); font-size: 13px; text-decoration: underline; cursor: pointer; }
.kd-report:hover { color: #c0342a; }

/* ------------------------------------------------------------- Galerie */
.kd-gallery { overflow: hidden; }
.kd-stage { position: relative; aspect-ratio: 648 / 470; background: #dfe3e8; cursor: zoom-in; }
.kd-slide { position: absolute; inset: 0; display: none; }
.kd-slide.is-on { display: block; }
.kd-slide img { width: 100%; height: 100%; object-fit: cover; }
.kd-noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; color: var(--kd-ink-3); font-size: 14px; }
.kd-noimg i { font-size: 40px; }
/* `left`, nicht logisch: ein Foto spiegelt nicht, also seine Marken auch nicht. */
.kd-count { position: absolute; top: 12px; left: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: rgba(26,26,26,.7); color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kd-nav { position: absolute; top: 50%; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--kd-ink); box-shadow: 0 2px 8px rgba(0,0,0,.25); transform: translateY(-50%); cursor: pointer; }
.kd-nav:hover { color: var(--kd-green); }
.kd-nav--prev { inset-inline-start: 12px; }
.kd-nav--next { inset-inline-end: 12px; }
.kd-stage-btns { position: absolute; bottom: 12px; left: 12px; z-index: 2; display: flex; gap: 6px; cursor: default; }
.kd-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: #fff; color: var(--kd-green-dark); font-size: 13px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.kd-chip:hover { background: var(--kd-green-soft); }

.kd-strip { display: flex; gap: 6px; padding: 8px; overflow-x: auto; scrollbar-width: none; justify-content: center; }
.kd-strip::-webkit-scrollbar { display: none; }
.kd-thumb { flex: none; width: 64px; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 4px; overflow: hidden; background: none; opacity: .55; cursor: pointer; transition: opacity .15s ease; }
.kd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kd-thumb:hover { opacity: .85; }
.kd-thumb.is-current { opacity: 1; outline: 2px solid var(--kd-green); outline-offset: -2px; }

.kd-grid-ov { position: fixed; inset: 0; z-index: 90; overflow-y: auto; background: #fff; }
.kd-grid-bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e6e8ec; font-size: 16px; }
.kd-grid-bar button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--kd-soft); font-size: 18px; cursor: pointer; }
.kd-grid-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 1010px; margin: 0 auto; padding: 16px; }
.kd-grid-imgs button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.kd-grid-imgs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }

/* -------------------------------------------------------- Kernfakten */
.kd-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 16px; list-style: none; }
.kd-keys li, .kd-sfacts li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kd-keys i, .kd-sfacts i { flex: none; width: 28px; color: var(--kd-green); font-size: 22px; text-align: center; }
.kd-keys-l { display: block; font-size: 13px; color: var(--kd-ink-2); }
.kd-keys-v { display: block; font-size: 16px; font-weight: 700; color: var(--kd-ink); overflow-wrap: anywhere; }

/* ----------------------------------------------------- Technische Daten */
.kd-tech { margin: 0; }
.kd-tech > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid #eceef1; font-size: 15px; }
.kd-tech > div:last-child { border-bottom: 0; }
.kd-tech dt { color: var(--kd-ink-2); }
.kd-tech dd { margin: 0; font-weight: 600; color: var(--kd-ink); }
.kd-flags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.kd-flags li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--kd-green-soft); color: var(--kd-green-dark); font-size: 13px; font-weight: 700; }

/* ----------------------------------------------------------- Ausstattung */
.kd-equip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.kd-equip li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 6px; background: var(--kd-soft); font-size: 14px; font-weight: 600; }
.kd-equip li i { flex: none; color: var(--kd-green); font-size: 13px; }
.kd-more { display: block; width: 100%; margin-top: 14px; padding-top: 14px; border: 0; border-top: 1px solid #eceef1; background: none; color: var(--kd-green-dark); font-size: 15px; font-weight: 700; cursor: pointer; }
.kd-more:hover { text-decoration: underline; }

/* ---------------------------------------------------------- Beschreibung */
.kd-desc { max-height: 9.6em; overflow: hidden; font-size: 15px; line-height: 1.6; color: var(--kd-ink-2); white-space: pre-line; }
.kd-desc.is-open { max-height: none; }

/* ------------------------------------------------------ Anbieter, Preis */
.kd-sfacts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid #eceef1; list-style: none; }
.kd-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 18px 0 0; }
.kd-links a, .kd-similar-head a { display: inline-flex; align-items: center; gap: 6px; color: var(--kd-green-dark); font-size: 15px; font-weight: 700; text-decoration: none; }
.kd-links a i, .kd-similar-head a i { font-size: 11px; }
.kd-links a:hover, .kd-similar-head a:hover { text-decoration: underline; }
.kd-pricerow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.kd-price--box { margin: 0; font-size: 32px; }
.kd-cur { height: 36px; padding: 0 8px; border: 1px solid #c9c9cf; border-radius: 6px; background: #fff; font-size: 14px; }
.kd-pricefacts { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; padding: 16px 0 0; border-top: 1px solid #eceef1; list-style: none; font-size: 15px; color: var(--kd-ink-2); }
.kd-pricefacts li { display: flex; align-items: baseline; gap: 10px; }
.kd-pricefacts i { flex: none; width: 18px; color: var(--kd-green); text-align: center; }
.kd-pricefacts a { color: var(--kd-green-dark); font-weight: 600; }

/* ------------------------------------------------------- Ähnliche Autos */
.kd-similar { margin-top: 16px; }
.kd-similar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.kd-railwrap { position: relative; }
.kd-rail { display: flex; gap: 16px; padding: 2px 2px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.kd-rail::-webkit-scrollbar { display: none; }
.kd-rail-item { flex: none; width: 232px; scroll-snap-align: start; }
.kd-rail-item > * { height: 100%; }
.kd-arrow { position: absolute; top: calc(50% - 24px); z-index: 3; width: 44px; height: 44px; border: 1px solid var(--kd-line); border-radius: 50%; background: #fff; color: var(--kd-ink); box-shadow: 0 2px 8px rgba(0,0,0,.15); cursor: pointer; }
.kd-arrow:hover { color: var(--kd-green); }
.kd-arrow--start { inset-inline-start: -10px; }
.kd-arrow--end { inset-inline-end: -10px; }

.kc-detail .kv-wrap { margin-top: 16px; }

/* ---------------------------------------------------------- Verkaufsband */
.kd-sell { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 16px; padding: 24px; border-radius: 16px; background: linear-gradient(100deg, var(--kd-green-dark), var(--kd-green)); color: #fff; }
.kd-sell h2 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: #fff; }
.kd-sell p { margin: 0; font-size: 15px; color: #e3f5ea; }
.kd-sell-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.kd-sell-link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* -------------------------------------------------------------- Telefon */
@media (max-width: 900px) {
    .kd-wrap { padding: 12px 12px 40px; }
    .kd-grid { grid-template-columns: minmax(0, 1fr); }
    /* Spalte auflösen, damit `order` den Kontaktkasten direkt unter die Galerie setzt. */
    .kd-main { display: contents; }
    .kd-main > * { order: 3; }
    .kd-main > .kd-gallery { order: 1; }
    .kd-aside { order: 2; grid-column: auto; grid-row: auto; position: static; }
    .kd-main > * { grid-column: auto; }
    .kd-gallery { margin-inline: -12px; border-radius: 0; box-shadow: none; }
    .kd-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 4px; }
    .kd-sfacts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .kd-equip { grid-template-columns: minmax(0, 1fr); }
    .kd-h { font-size: 20px; }
    .kd-arrow { display: none; }
    .kd-stage-btns .kd-chip { height: 28px; font-size: 12px; }
    .kd-grid-imgs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .kd-tech > div { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); font-size: 14px; }
    .kd-price--box { font-size: 26px; }
}
