/**
 * Single Vehicle Template CSS - Hybrid Layout
 * Desktop: 2-Spalten mit Sticky Kontakt
 * Mobile: Mobile.de App Style
 */

/* ==================== CSS VARIABLEN (Fallback) ==================== */

:root {
    --caradag-primary: #4eb25c;
    --caradag-secondary: #2c5aa0;
    --caradag-accent: #4eb25c;
    --caradag-dark: #1A1A1A;
    --caradag-gray: #767676;
    --caradag-light-gray: #F5F5F5;
    --caradag-border: #E0E0E0;
    --caradag-text: #1a1a1a;
    --caradag-border-radius: 8px;
    --caradag-button-radius: 8px;
    --caradag-sticky-top-offset: 96px;
}

/* ==================== BASE ==================== */

.caradag-single-vehicle.hybrid-layout {
    background: #000000;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Retina Display Optimierung */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .caradag-single-vehicle.hybrid-layout {
        -webkit-font-smoothing: subpixel-antialiased;
    }

    .gallery-main-image,
    .gallery-thumb img,
    .vehicle-card-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ==================== H1-TITEL GANZ OBEN ==================== */

.vehicle-page-title {
    color: #eef4fc;
    font-size: clamp(28px, 2.2vw, 42px);
    font-weight: 700;
    text-align: center;
    margin: calc(6px + 0.3vw) auto calc(6px + 0.3vw);
    padding: 0 5%;
    max-width: 1400px;
    line-height: 1.18;
    letter-spacing: -0.01em;
}

.vehicle-sold-notice {
    width: min(1400px, calc(100% - 32px));
    margin: 0 auto 16px;
}

.vehicle-sold-notice-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(138, 39, 26, 0.95) 0%, rgba(191, 76, 52, 0.95) 100%);
    color: #fff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.vehicle-sold-notice-inner strong {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vehicle-sold-notice-inner span {
    font-size: 14px;
    opacity: 0.95;
}

.vehicle-sold-notice-inner a {
    margin-left: auto;
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

@media (max-width: 768px) {
    .vehicle-sold-notice {
        width: calc(100% - 16px) !important;
        margin-bottom: 12px;
    }

    .vehicle-sold-notice-inner {
        padding: 10px 12px;
        gap: 8px;
    }

    .vehicle-sold-notice-inner a {
        margin-left: 0;
    }
}

/* ==================== CONTAINER MIT STABILER BREITE ==================== */
/* Nur direkte Container der Single-View begrenzen, niemals globale Theme-Container */

.caradag-single-vehicle .vehicle-back-header>.container,
.caradag-single-vehicle .vehicle-main-content>.container {
    width: min(1320px, calc(100% - 32px));
    max-width: 1320px;
    min-width: 0;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
}

@media (min-width: 769px) {

    .caradag-single-vehicle .vehicle-back-header>.container,
    .caradag-single-vehicle .vehicle-main-content>.container {
        width: min(1360px, calc(100% - 48px));
        max-width: 1360px;
    }
}

/* Mobile: 95% für Content */
@media (max-width: 768px) {
    .vehicle-page-title {
        font-size: calc(20px + 1vw);
        padding: 0 3%;
        margin: calc(6px + 0.4vw) auto calc(6px + 0.4vw);
    }

    .caradag-single-vehicle .vehicle-back-header>.container,
    .caradag-single-vehicle .vehicle-main-content>.container {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .vehicle-gallery {
        width: 100% !important;
        /* Keep gallery full width relative to container */
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Alle Content-Blöcke auf 100% (relative to 95% container) */
    .section-block,
    .quick-facts-section,
    .mobile-price-section,
    .vehicle-title-section,
    .price-section,
    .technical-data-section,
    .features-section,
    .description-section,
    .contact-section {
        width: 100% !important;
        /* CHANGED: 95% -> 100% (since container is already 95%) */
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }

    /* Preis-Buttons und andere Elemente innerhalb der Blöcke */
    .contact-buttons-mobile {
        width: 100% !important;
    }

    /* Stelle sicher, dass interne Paddings bleiben */
    .mobile-price-section {
        padding: 15px !important;
    }

    .section-block {
        padding: 20px 15px !important;
    }
}

/* Mobile Landscape Force - ensure they also get 95% width even if pixel width > 768px */
@media (max-width: 950px) and (orientation: landscape) and (max-height: 500px) {

    .caradag-single-vehicle .vehicle-back-header>.container,
    .caradag-single-vehicle .vehicle-main-content>.container {
        width: calc(100% - 16px) !important;
        max-width: calc(100% - 16px) !important;
        min-width: 0 !important;
    }
}

/* Mobile Landscape (Querformat) */
@media (max-width: 926px) and (orientation: landscape) {
    .gallery-main-image {
        max-height: 50vh !important;
    }

    .mobile-header {
        padding: 10px 15px;
    }

    .quick-facts-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
    }

    .section-block {
        padding: 15px 10px !important;
    }

    .mobile-price-section {
        padding: 10px !important;
    }
}

/* ==================== VISIBILITY HELPERS ==================== */

.desktop-only {
    display: none !important;
}

.mobile-only {
    display: block !important;
}

@media (min-width: 769px) {
    .desktop-only {
        display: block !important;
    }

    .mobile-only {
        display: none !important;
    }
}

/* ==================== MOBILE HEADER ==================== */

.mobile-header {
    background: var(--caradag-dark);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ==================== MOBILE STICKY HEADER (on scroll) ==================== */

.mobile-sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(10, 15, 23, 0.94);
    border-bottom: 1px solid rgba(164, 184, 208, 0.2);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    z-index: 9999;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.mobile-sticky-header.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-sticky-header.is-hidden {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.sticky-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 15px;
}

.sticky-price {
    font-size: 20px;
    font-weight: 800;
    color: #f3f8ff;
    flex: 1;
}

.sticky-buttons {
    display: flex;
    gap: 10px;
}

.sticky-btn {
    width: calc(40px + 0.3vw);
    height: calc(40px + 0.3vw);
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--caradag-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s;
}

.sticky-btn svg {
    width: calc(18px + 0.2vw);
    height: calc(18px + 0.2vw);
    min-width: 18px;
    min-height: 18px;
}

.sticky-btn:hover {
    transform: scale(1.1);
}

.sticky-btn-call {
    background: var(--caradag-primary);
}

.sticky-btn-message {
    background: var(--caradag-primary);
}

@media (min-width: 769px) {
    .mobile-sticky-header {
        display: none !important;
    }
}

.back-button {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.mobile-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== ZURÜCK-BUTTON (DESKTOP & MOBILE) ==================== */

.vehicle-back-header {
    background: transparent;
    padding: calc(6px + 0.2vw) 0;
    margin-bottom: calc(3px + 0.1vw);
}

.vehicle-back-header .container {
    max-width: 100%;
    padding: 0;
}

.back-button {
    display: inline-flex;
    align-items: center;
    color: #6cd27b;
    text-decoration: none;
    font-size: calc(16px + 0.2vw);
    font-weight: 700;
    padding: calc(9px + 0.2vw) calc(16px + 0.3vw);
    border-radius: 12px;
    transition: all 0.3s;
    background: rgba(78, 178, 92, 0.14);
    border: 1px solid rgba(78, 178, 92, 0.45);
}

.back-button:hover {
    background: rgba(78, 178, 92, 0.22);
    color: #8de09a;
    transform: translateX(-3px);
}

/* ==================== LAYOUT ==================== */

.vehicle-main-content {
    padding: 0 0 30px;
    overflow: visible;
    /* Wichtig für sticky positioning */
}

.vehicle-layout {
    display: block;
    overflow: visible;
    /* Wichtig für sticky positioning */
}

@media (min-width: 769px) {
    .vehicle-layout {
        display: grid;
        grid-template-columns: minmax(0, 980px) minmax(280px, 320px);
        gap: 24px;
        align-items: start;
        justify-content: center;
    }
}

/* ==================== LINKE SPALTE ==================== */

.vehicle-left-column {
    background: linear-gradient(180deg, rgba(15, 22, 33, 0.96) 0%, rgba(10, 15, 24, 0.98) 100%);
    border-radius: 18px;
    border: 1px solid rgba(163, 183, 208, 0.22);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.46);
    overflow: hidden;
}

/* Titel (Desktop) */
.vehicle-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    padding: 25px 30px;
    color: #eef5ff;
    line-height: 1.3;
}

/* ==================== BILDERGALERIE ==================== */

.vehicle-gallery {
    padding: 0;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
}

.gallery-main {
    position: relative;
    background: transparent;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    display: block;
    min-height: 0;
}

.gallery-main-image {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    display: block;
    max-height: none;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

/* Desktop: Noch größeres Hauptbild */
@media (min-width: 769px) {
    .gallery-main {
        min-height: 0;
    }

    .gallery-main-image {
        max-height: none;
    }
}

/* ALLE Galerie-Elemente in Übersicht AUSBLENDEN - NUR IM VOLLBILDMODUS SICHTBAR */
.gallery-main .gallery-close,
.gallery-main .gallery-counter,
.gallery-main .gallery-nav,
.gallery-main .gallery-all-images,
.gallery-main .gallery-mobile-nav,
.gallery-main .gallery-prev,
.gallery-main .gallery-next,
.gallery-main .gallery-prev-mobile,
.gallery-main .gallery-next-mobile,
.gallery-main .gallery-counter-mobile {
    display: none !important;
    /* KOMPLETT AUSBLENDEN in Übersicht */
}

.gallery-all-images.desktop-only svg {
    width: 20px;
    height: 20px;
}

/* Mobile: Navigation unten mittig - NUR IM VOLLBILDMODUS */
.gallery-mobile-nav.mobile-only {
    display: none !important;
    /* In Übersicht ausblenden */
}

.gallery-nav.mobile-only {
    display: none !important;
    /* In Übersicht ausblenden */
}

.gallery-counter-mobile {
    display: none !important;
    /* In Übersicht ausblenden */
}

/* Baureihe unter Thumbnails */
.caradag-single-vehicle .vehicle-model-range {
    margin-top: 15px;
    margin-bottom: 20px;
    padding: 0 calc(15px + 0.5vw);
    width: 100%;
    max-width: 100%;
    clear: both;
}

.caradag-single-vehicle .vehicle-model-range .model-range-value {
    font-size: calc(16px + 0.5vw);
    font-weight: 700;
    margin: 0 0 calc(15px + 0.5vw);
    padding: 0;
    color: #eef5ff;
    text-align: left;
    word-wrap: normal;
    overflow-wrap: normal;
    word-break: normal;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.45;
    display: block;
    white-space: normal;
}

.caradag-single-vehicle .gallery-thumbnails {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 10px;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    -webkit-overflow-scrolling: touch;
}

.caradag-single-vehicle .gallery-thumb {
    flex: 0 0 80px;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.gallery-thumb.active {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.18);
}

.gallery-thumb:hover {
    transform: scale(1.05);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==================== MOBILE PRICE SECTION ==================== */

.mobile-price-section {
    padding: 20px;
    border-bottom: 1px solid rgba(162, 183, 209, 0.18);
    background: linear-gradient(180deg, rgba(16, 24, 35, 0.95) 0%, rgba(11, 17, 27, 0.98) 100%);
}

.mobile-price-section .price-main {
    font-size: calc(24px + 1.2vw);
    font-weight: 800;
    color: #f2f7ff;
    margin-bottom: calc(6px + 0.2vw);
}

.price-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #00aa00;
    color: white;
    padding: calc(3px + 0.1vw) calc(10px + 0.3vw);
    border-radius: calc(3px + 0.1vw);
    font-size: calc(12px + 0.3vw);
    font-weight: 600;
    margin-bottom: calc(6px + 0.2vw);
}

.status-inline-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    flex-shrink: 0;
}

.financing-info,
.financing-info-desktop,
.special-price-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.price-details {
    font-size: calc(12px + 0.3vw);
    color: #aebfd5;
    margin-bottom: calc(12px + 0.3vw);
}

.contact-buttons-mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.btn-mobile {
    padding: calc(12px + 0.2vw) calc(16px + 0.3vw);
    border-radius: calc(6px + 0.15vw);
    font-size: calc(14px + 0.15vw);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(6px + 0.2vw);
    cursor: pointer;
    border: none;
    transition: all 0.3s;
}

.btn-mobile svg {
    width: calc(16px + 0.2vw);
    height: calc(16px + 0.2vw);
    min-width: 16px;
    min-height: 16px;
    flex-shrink: 0;
}

.btn-call,
.btn-message {
    background: var(--caradag-primary, #4eb25c);
    color: white;
}

.btn-call:hover,
.btn-message:hover {
    background: #3d9249;
    opacity: 0.9;
}

/* ==================== QUICK FACTS (PROPORTIONAL SKALIEREND) ==================== */

.quick-facts-section {
    padding: calc(20px + 0.5vw) calc(15px + 0.5vw);
    border-bottom: 1px solid rgba(162, 183, 209, 0.18);
    background: linear-gradient(180deg, rgba(16, 24, 35, 0.95) 0%, rgba(11, 17, 27, 0.98) 100%);
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 769px) {
    .quick-facts-section {
        padding: calc(20px + 1vw) calc(20px + 1vw);
        border-bottom: 1px solid rgba(162, 183, 209, 0.18);
        /* Proportional mit Container */
        max-width: 100%;
    }
}

.section-title {
    font-size: calc(19px + 0.45vw);
    font-weight: 700;
    margin: 0 0 calc(15px + 0.5vw);
    color: #f0f6ff;
    text-align: left;
    letter-spacing: -0.01em;
}

.quick-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: calc(10px + 0.3vw);
    width: 100%;
    box-sizing: border-box;
}

/* Desktop: 2 Spalten (2x3 Layout) - SCHMALER & SICHERER */
@media (min-width: 769px) {
    .quick-facts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        /* 2 Spalten statt 3 */
        gap: calc(12px + 0.4vw);
    }
}

/* Nur bei sehr breiten Bildschirmen: 3 Spalten */
@media (min-width: 1200px) {
    .quick-facts-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: calc(15px + 0.5vw);
    }
}

.quick-fact {
    display: flex;
    gap: calc(8px + 0.2vw);
    padding: calc(12px + 0.3vw) calc(10px + 0.2vw);
    background: rgba(9, 14, 22, 0.82);
    border-radius: 12px;
    border: 1px solid rgba(165, 183, 206, 0.2);
    min-width: 0;
    /* Verhindert Overflow */
    box-sizing: border-box;
    align-items: flex-start;
    overflow: hidden;
    /* Verhindert Text-Overflow */
}

.fact-icon {
    color: var(--caradag-primary, #4eb25c);
    width: calc(20px + 0.5vw);
    height: calc(20px + 0.5vw);
    min-width: 20px;
    min-height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    /* Ausrichtung mit Label */
}

.fact-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: calc(4px + 0.1vw);
    min-width: 0;
    /* Wichtig für Text-Overflow */
    overflow: hidden;
}

.fact-label {
    font-size: calc(11px + 0.1vw);
    color: #adc0d8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.fact-value {
    font-size: calc(14px + 0.2vw);
    font-weight: 600;
    color: #f2f7ff;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ==================== SECTION BLOCKS ==================== */

.section-block {
    padding: 25px 20px;
    margin-bottom: 20px;
    background: linear-gradient(180deg, rgba(16, 24, 35, 0.96) 0%, rgba(11, 17, 27, 0.98) 100%);
    border-radius: 14px;
    border: 1px solid rgba(164, 184, 208, 0.2);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

@media (min-width: 769px) {
    .section-block {
        padding: 30px;
        margin-bottom: 25px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
}

.section-block[data-vehicle-section="technical"],
.section-block[data-vehicle-section="features"] {
    background: linear-gradient(180deg, #171c27 0%, #121723 100%);
    border: 1px solid rgba(166, 181, 205, 0.22);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
}

.section-block[data-vehicle-section="technical"] .section-title,
.section-block[data-vehicle-section="features"] .section-title {
    color: #f2f6ff;
}

/* ==================== TECHNISCHE DATEN ==================== */

.technical-data-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-block[data-vehicle-section="technical"] .data-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(9, 14, 22, 0.8);
}

.section-block[data-vehicle-section="technical"] .data-row:nth-child(even) {
    background: rgba(18, 24, 36, 0.88);
}

.section-block[data-vehicle-section="technical"] .data-row:last-child {
    border-bottom: none;
}

.section-block[data-vehicle-section="technical"] .data-label {
    font-size: calc(14px + 0.4vw);
    color: #d8e2f3;
    font-weight: 700;
    flex: 1;
    max-width: 48%;
}

.section-block[data-vehicle-section="technical"] .data-value {
    font-size: calc(15px + 0.4vw);
    font-weight: 600;
    color: #f3f7ff;
    text-align: right;
    max-width: 52%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.data-row-highlight {
    background: rgba(78, 178, 92, 0.18);
    margin: 0 -20px;
    padding: 15px 20px;
    border-radius: 6px;
}

@media (min-width: 769px) {
    .data-row-highlight {
        margin: 0 -30px;
        padding: 15px 30px;
    }
}

.data-row-highlight .data-value {
    color: #00aa00;
}

/* ==================== AUSSTATTUNG (GENAU WIE BESCHREIBUNG) ==================== */

.features-list {
    width: 100%;
}

.features-visible,
.features-hidden {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 24px;
    width: 100%;
    align-items: start;
}

.features-visible {
    margin-bottom: 0;
}

.features-hidden {
    margin-top: 0;
}

.features-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* Mobile: 1 Spalte */
@media (max-width: 768px) {

    .features-visible,
    .features-hidden {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(10px + 0.2vw);
    margin-bottom: 0;
    padding: 11px 14px;
    font-size: calc(13px + 0.3vw);
    line-height: 1.5;
    color: #f1f6ff;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    background: rgba(9, 14, 22, 0.8);
}

.features-column .feature-item:nth-child(even) {
    background: rgba(18, 24, 36, 0.88);
}

.feature-check {
    order: 2;
    color: #eef4ff;
    font-size: calc(15px + 0.3vw);
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}

.feature-name {
    order: 1;
    font-size: calc(13px + 0.3vw);
    color: #f3f7ff;
    font-weight: 600;
    flex: 1;
    line-height: 1.5;
}

/* ==================== BESCHREIBUNG ==================== */

.vehicle-description {
    font-size: calc(14px + 0.2vw);
    line-height: 1.7;
    color: #dbe7f6;
}

.vehicle-description p {
    margin-bottom: calc(12px + 0.3vw);
}

/* ==================== MEHR ANZEIGEN BUTTON ==================== */

/* Versteckte Elemente - jQuery slideUp/slideDown */
.features-hidden,
.description-hidden,
.technical-hidden,
.feature-hidden-dynamic {
    display: none;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--caradag-primary, #4eb25c);
    font-size: calc(14px + 0.3vw);
    font-weight: 700;
    cursor: pointer;
    padding: calc(8px + 0.2vw) 0;
    text-decoration: underline;
    display: inline-block;
    margin-top: calc(8px + 0.2vw);
    transition: all 0.2s ease;
}

.show-more-btn:hover {
    text-decoration: underline;
    color: #7dd389;
}

.section-expand {
    text-align: center;
    margin-top: 8px;
}

/* ==================== RECHTE SPALTE (DESKTOP) ==================== */

.vehicle-right-column {
    position: relative;
}

.contact-box.sticky {
    position: relative;
    top: 0;
    background: linear-gradient(180deg, rgba(12, 19, 30, 0.94) 0%, rgba(8, 13, 21, 0.98) 100%);
    border-radius: 14px;
    border: 1px solid rgba(165, 184, 208, 0.24);
    padding: calc(15px + 0.5vw);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(14px) saturate(122%);
    -webkit-backdrop-filter: blur(14px) saturate(122%);
    align-self: start;
    /* Wichtig für Grid-Alignment! */
    max-height: none;
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 10;
    /* Sicherstellen dass es über anderen Elementen liegt */
    will-change: transform;
    /* Optimierung für sticky */
}

/* Desktop Grid Layout mit Sticky Sidebar - RESPONSIVE & SCHMALER */
@media (min-width: 769px) {
    .vehicle-layout {
        display: grid;
        grid-template-columns: minmax(0, 980px) minmax(280px, 320px);
        gap: 24px;
        align-items: start;
        justify-content: center;
        position: relative;
        /* Wichtig für sticky positioning */
        overflow: visible;
        /* Wichtig für sticky positioning */
    }

    .vehicle-left-column {
        width: 100%;
        min-width: 0;
        /* Wichtig für Grid-Overflow */
        max-width: 980px;
        margin: 0 auto;
        overflow: visible;
        /* Wichtig für sticky positioning */
    }

    .vehicle-right-column {
        position: sticky;
        top: max(24px, calc(env(safe-area-inset-top, 0px) + var(--caradag-sticky-top-offset)));
        align-self: start;
        max-width: 100%;
        min-width: 0;
        height: fit-content;
        /* Wichtig für sticky */
        overflow: visible;
        /* Wichtig für sticky positioning */
    }

    /* Kontakt-Box schmaler & responsive */
    .contact-box.sticky {
        width: 100%;
        max-width: 100%;
        padding: calc(15px + 0.5vw);
        box-sizing: border-box;
        position: relative;
        top: 0;
    }
}

/* WordPress Admin-Bar: Sticky-Box zusätzlich nach unten versetzen */
@media (min-width: 769px) {
    body.admin-bar .vehicle-right-column {
        top: max(24px, calc(env(safe-area-inset-top, 0px) + var(--caradag-sticky-top-offset) + 32px));
    }
}

/* Mittlere Bildschirmgrößen: Noch schmalere rechte Spalte */
@media (min-width: 769px) and (max-width: 1024px) {
    .vehicle-layout {
        grid-template-columns: 1fr calc(260px + 1.5vw);
        gap: calc(15px + 0.8vw);
    }
}

/* Kleine Desktop-Bildschirme: Rechte Spalte noch schmaler */
@media (min-width: 769px) and (max-width: 900px) {
    .vehicle-layout {
        grid-template-columns: 1fr calc(240px + 1vw);
        gap: calc(12px + 0.5vw);
    }
}

/* Preis-Box (Desktop) */
.price-box {
    text-align: center;
    padding: 20px;
    background: linear-gradient(160deg, rgba(17, 27, 40, 0.88) 0%, rgba(10, 16, 25, 0.95) 100%);
    border: 1px solid rgba(163, 183, 208, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-radius: var(--caradag-border-radius);
    margin-bottom: 25px;
}

.price-amount {
    font-size: calc(24px + 1.2vw);
    font-weight: 700;
    color: white;
    margin-bottom: calc(4px + 0.1vw);
}

.price-label {
    font-size: calc(12px + 0.3vw);
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: calc(0.5px + 0.1vw);
}

.price-details-desktop {
    font-size: calc(11px + 0.3vw);
    color: rgba(255, 255, 255, 0.85);
    margin-top: calc(6px + 0.2vw);
}

.special-price-label {
    justify-content: center;
    margin-bottom: 6px;
    font-size: calc(12px + 0.2vw);
    font-weight: 600;
    color: #ffffff;
}

/* Händler-Info */
.dealer-info {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(164, 184, 208, 0.2);
}

.dealer-info h3 {
    font-size: calc(16px + 0.4vw);
    font-weight: 700;
    margin: 0 0 calc(8px + 0.2vw);
    color: #eef5ff;
}

.dealer-address,
.dealer-phone,
.dealer-email {
    font-size: calc(13px + 0.2vw);
    color: #b2c5dc;
    margin: calc(6px + 0.2vw) 0;
    line-height: 1.6;
}

.dealer-phone a,
.dealer-email a {
    color: #8fd99b;
    text-decoration: none;
    font-weight: 600;
}

.dealer-phone a:hover {
    text-decoration: underline;
}

/* Kontakt-Buttons (Desktop) - RESPONSIVE */
.contact-buttons {
    display: flex;
    flex-direction: column;
    gap: calc(10px + 0.2vw);
    margin-bottom: calc(15px + 0.3vw);
    width: 100%;
}

.contact-buttons .btn,
.contact-buttons .contact-button {
    padding: calc(12px + 0.3vw) calc(12px + 0.3vw);
    font-size: calc(13px + 0.1vw);
    box-sizing: border-box;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

/* E-Mail und Anrufen nebeneinander */
.contact-buttons-top {
    display: flex;
    gap: 10px;
    width: 100%;
}

.contact-buttons .btn-email,
.contact-buttons .btn-call {
    flex: 1;
    width: auto;
}

/* WhatsApp darunter, volle Breite */
.contact-buttons .btn-whatsapp {
    width: 100%;
}

/* Mobile Ansicht: E-Mail und Anrufen nebeneinander, WhatsApp darunter */
@media (max-width: 768px) {
    .contact-buttons-top {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .contact-buttons .btn-email,
    .contact-buttons .btn-call {
        flex: 1;
        width: auto;
    }

    .contact-buttons .btn-whatsapp {
        width: 100%;
    }
}

.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none !important;
    display: block;
}

.btn-primary,
.btn-secondary {
    background: var(--caradag-primary, #4eb25c);
    color: white;
    border: none;
    border-radius: var(--caradag-button-radius);
}

.btn-primary:hover,
.btn-secondary:hover {
    background: #3d9249;
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    background: rgba(78, 178, 92, 0.12);
    color: #e9f6ec;
    border: 2px solid rgba(78, 178, 92, 0.7);
    border-radius: var(--caradag-button-radius);
}

.btn-outline:hover {
    background: rgba(78, 178, 92, 0.2);
    border-color: var(--caradag-primary, #4eb25c);
    color: #ffffff;
}

/* Rechte Kontaktbox: alle Buttons gleich grün */
.contact-box .btn-email,
.contact-box .btn-call,
.contact-box .btn-whatsapp,
.contact-box .btn-outline {
    background: var(--caradag-primary, #4eb25c) !important;
    color: #ffffff !important;
    border: 2px solid var(--caradag-primary, #4eb25c) !important;
}

.contact-box .btn-email:hover,
.contact-box .btn-call:hover,
.contact-box .btn-whatsapp:hover,
.contact-box .btn-outline:hover {
    background: #3d9249 !important;
    border-color: #3d9249 !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 146, 73, 0.3);
}

.btn-block {
    width: 100%;
}

/* Fahrzeug-ID */
.vehicle-id {
    text-align: center;
    padding-top: calc(12px + 0.3vw);
    border-top: 1px solid rgba(164, 184, 208, 0.2);
}

.vehicle-id small {
    color: #a9bfd8;
    font-size: calc(11px + 0.2vw);
}

/* ==================== LIGHTBOX ==================== */

.caradag-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

.lightbox-content {
    position: relative;
    z-index: 2;
    width: 95%;
    max-width: 1400px;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Rechts oben */
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
    line-height: 1;
    padding: 0;
    z-index: 10;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    font-size: 24px;
    font-weight: 600;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
    padding: 0;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
    /* Rechts neben dem Bild */
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 100px;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    animation: lightboxZoomIn 0.3s ease-out;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
    transition: transform 0.3s ease;
}

@keyframes lightboxZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    /* Links oben */
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10;
}

.lightbox-current {
    color: #2c5aa0;
    font-weight: 700;
    font-size: 18px;
}

/* Lightbox Thumbnails (unten) */
.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    max-width: 90%;
    overflow-x: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    z-index: 10;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
    height: 4px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.lightbox-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.3s;
}

.lightbox-thumb:hover {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-thumb.active {
    opacity: 1;
    border-color: var(--caradag-primary, #4eb25c);
    border-width: 3px;
}

.lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.lightbox-open,
body.modal-open {
    overflow: hidden;
}

/* ==================== MODAL (KONTAKTFORMULAR) ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #333;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

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

@media (max-width: 768px) {
    .caradag-single-vehicle .container {
        padding: 0;
    }

    .vehicle-left-column {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .contact-buttons-mobile {
        grid-template-columns: 1fr 1fr !important;
        /* Immer 2-spaltig auch auf Mobile */
        gap: calc(10px + 0.5vw) !important;
    }

    .lightbox-image-container {
        padding: 0 20px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 80px !important;
        /* Unten positioniert */
        top: auto !important;
        transform: none !important;
    }

    .lightbox-prev {
        left: 10px !important;
        right: auto !important;
    }

    .lightbox-next {
        right: 10px !important;
        /* Ganz rechts am Bildschirmrand */
        left: auto !important;
    }

    .lightbox-counter {
        display: none !important;
        /* In mobiler Ansicht ausblenden */
    }

    .lightbox-thumbnails {
        bottom: 10px !important;
        max-width: 95% !important;
    }
}

/* ==================== FORMULAR-MELDUNGEN ==================== */

.form-message {
    padding: calc(12px + 0.5vw);
    border-radius: var(--caradag-border-radius);
    font-size: calc(14px + 0.2vw);
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
