/**
 * Kfz-Markt SU – Einzelansicht (Single Page)
 * Wird nur auf der kfz_markt Single-Page geladen.
 * Farben und Abstände werden über CSS-Variablen (:root) aus den Backend-Einstellungen gesteuert.
 */

/* ==========================================================================
   WRAPPER & LAYOUT
   ========================================================================== */

.kfz-single-wrap {
    width: 100%;
    height: 100vh;
    font-family: sans-serif;
    padding: var(--kfz-s-padding, 30px) 0 calc(var(--kfz-s-padding, 30px) * 2);
    background: var(--kfz-s-bg, #111111);
    color: var(--kfz-s-text, #ffffff);
}

.kfz-single-inner {
    max-width: 100em;
    margin: 0 auto;
    padding: 0 24px;
}

/* Zurück-Link */
.kfz-single-back {
    margin-bottom: 20px;
}

.kfz-single-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--kfz-s-text-muted, #9aa3b2);
    text-decoration: none;
    font-size: 0.88em;
    transition: color 0.2s;
}

.kfz-single-back-link:hover {
    color: var(--kfz-s-primary, #23c415);
}

/* Zweispaltiges Layout: Galerie | Info */
.kfz-single-layout {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--kfz-s-gap, 40px);
    align-items: start;
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.kfz-single-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.kfz-badge-inline {
    position: static !important;
    box-shadow: none !important;
}

/* ==========================================================================
   GALERIE (linke Spalte)
   ========================================================================== */

.kfz-single-gallery {
    position: sticky;
    top: 40px;
    width: 100%;
    max-width: 44em;
}

/* Hauptbild-Container */
.kfz-single-main-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    line-height: 0;
}

.kfz-single-main-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: opacity 0.2s;
}

/* Thumbnail-Leiste */
.kfz-single-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.kfz-single-thumbs::-webkit-scrollbar       { height: 5px; }
.kfz-single-thumbs::-webkit-scrollbar-track  { background: var(--kfz-s-card-bg, #1a1a1a); }
.kfz-single-thumbs::-webkit-scrollbar-thumb  { background: #555; border-radius: 10px; }

.kfz-single-thumb {
    flex: 0 0 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.55;
    border: 2px solid transparent;
    transition: opacity 0.2s, border-color 0.2s;
}

.kfz-single-thumb:hover  { opacity: 0.85; }

.kfz-single-thumb.active {
    opacity: 1;
    border-color: var(--kfz-s-primary, #23c415);
}

/* ==========================================================================
   INFO (rechte Spalte)
   ========================================================================== */

.kfz-single-info {
    width: 100%;
    max-width: 35em;
    color: var(--kfz-s-text, #ffffff);
}

.kfz-single-title {
    margin: 0 0 6px;
    font-size: 1.9em;
    font-weight: 800;
    color: var(--kfz-s-text, #ffffff);
    line-height: 1.2;
}

/* Technische Daten */
.kfz-single-specs {
    margin: 16px 0 20px;
    background: var(--kfz-s-card-bg, #1a1a1a);
    border-radius: 10px;
    padding: 6px 0;
    border: 1px solid var(--kfz-s-border, #2a2a2a);
}

.kfz-single-specs .kfz-spec-item {
    padding: 9px 16px;
    border-bottom: 1px solid var(--kfz-s-border, #2a2a2a);
    color: var(--kfz-s-text, #fff);
}

.kfz-single-specs .kfz-spec-item:last-child {
    border-bottom: none;
}

.kfz-single-specs .kfz-spec-label {
    color: var(--kfz-s-text-muted, #9aa3b2);
}

/* Beschreibung */
.kfz-single-desc {
    background: var(--kfz-s-card-bg, #1a1a1a);
    border: 1px solid var(--kfz-s-border, #2a2a2a);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 24px;
}

.kfz-single-desc-title {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--kfz-s-text-muted, #9aa3b2);
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--kfz-s-border, #2a2a2a);
}

.kfz-single-desc-text {
    color: var(--kfz-s-text-muted, #9aa3b2);
    font-size: 0.95em;
    line-height: 1.75;
}

/* ==========================================================================
   AKTIONS-BUTTONS
   ========================================================================== */

.kfz-single-park-btn {
    font-size: 1.05em;
    padding: 15px 20px;
    border-radius: 10px;
}

.kfz-single-btn-disabled {
    background: #444 !important;
    cursor: not-allowed !important;
}

/* Teilen-Zeile */
.kfz-single-share {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.kfz-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid var(--kfz-s-border, #2a2a2a);
    background: var(--kfz-s-card-bg, #1a1a1a);
    color: var(--kfz-s-text-muted, #9aa3b2);
    transition: background 0.2s, color 0.2s;
}

.kfz-share-btn:hover {
    background: #2a2a2a;
    color: var(--kfz-s-text, #fff);
}

.kfz-share-wa {
    color: #25d366;
    border-color: rgba(37,211,102,.3);
}

.kfz-share-wa:hover {
    background: rgba(37,211,102,.12);
    color: #25d366;
}

/* ==========================================================================
   Beschreibung
   ========================================================================== */
#desc-modal-text{
  max-height: 50vh;
  overflow: auto;
  box-shadow: inset 1px -19px 25px -29px #000;
  padding: 5px 15px;
  border-bottom: 0.5px solid #636363;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet → 1 Spalte */
@media (max-width: 1293px) {
    .kfz-single-layout {
        flex-direction: column;
        align-items: center;
    }

    .kfz-single-gallery,
    .kfz-single-info {
        max-width: 100%;
        width: 100%;
        position: static;
    }
}

/* Mobil */
@media (max-width: 520px) {
    .kfz-single-wrap          { padding: 16px 0 40px; }
    .kfz-single-title         { font-size: 1.45em; }
    .kfz-single-main-img      { max-height: 260px; }
    .kfz-single-share         { flex-direction: column; }
    .kfz-share-btn            { justify-content: center; }
}
