/* =============================================
   CAR DETAIL — DARK THEME
   ============================================= */
:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-card2: #1a1a1a;
    --gold: #D4AF37;
    --gold-light: #e8c84a;
    --border: #242424;
    --text: #e0e0e0;
    --text-muted: #888;
    --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.dark-detail {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

/* ---- NAVBAR (same as home) ---- */
.dh-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px;
    background: rgba(10,10,10,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: height .3s, background .3s;
}
.dh-nav .nav-logo img { height: 38px; }
.dh-nav .nav-links { list-style: none; display: flex; gap: 28px; }
.dh-nav .nav-links a { color: #ccc; text-decoration: none; font-size: .9rem; transition: color .2s; }
.dh-nav .nav-links a:hover { color: var(--gold); }
.dh-nav .has-sub { position: relative; }
.dh-nav .has-sub .sub-menu {
    display: none; position: absolute; top: 100%; left: 0;
    background: #111; border: 1px solid var(--border);
    border-radius: 8px; min-width: 160px; padding: 8px 0; list-style: none;
}
.dh-nav .has-sub:hover .sub-menu { display: block; }
.dh-nav .sub-menu a { display: block; padding: 8px 18px; color: #ccc; font-size: .85rem; }
.dh-nav .sub-menu a:hover { color: var(--gold); background: #1a1a1a; }
.dh-nav .nav-actions { display: flex; gap: 10px; }
.btn-login { color: #ccc; text-decoration: none; padding: 7px 18px; border: 1px solid var(--border); border-radius: 6px; font-size: .85rem; transition: .2s; }
.btn-login:hover { color: var(--gold); border-color: var(--gold); }
.btn-register { background: var(--gold); color: #000; text-decoration: none; padding: 7px 18px; border-radius: 6px; font-size: .85rem; font-weight: 600; transition: .2s; }
.btn-register:hover { background: var(--gold-light); }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger span { width: 24px; height: 2px; background: #ccc; border-radius: 2px; transition: .3s; }

/* ---- BREADCRUMB ---- */
.cd-breadcrumb {
    padding: calc(var(--nav-h) + 20px) 32px 0;
    display: flex; align-items: center; gap: 8px;
    font-size: .82rem; color: var(--text-muted);
}
.cd-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.cd-breadcrumb a:hover { color: var(--gold); }
.cd-breadcrumb .sep { color: #444; }
.cd-breadcrumb .current { color: var(--text); }

/* ---- PAGE WRAPPER ---- */
.cd-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px 60px;
}

/* ---- CAR TITLE ROW ---- */
.cd-title-row {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.cd-title-row h1 {
    font-size: 1.7rem; font-weight: 700; color: #fff; line-height: 1.3;
}
.cd-title-row h1 span.gold { color: var(--gold); }
.cd-inv-badge {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 16px;
    font-size: .82rem; color: var(--text-muted); white-space: nowrap;
}
.cd-inv-badge strong { color: var(--text); }

/* ---- MAIN GRID (gallery | specs) ---- */
.cd-main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    align-items: start;
}

/* ---- GALLERY ---- */
.cd-gallery {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.cd-main-swiper {
    width: 100%;
    height: 480px;
    --swiper-navigation-color: rgba(255,255,255,.8);
    --swiper-pagination-color: var(--gold);
}
.cd-main-swiper swiper-slide img,
.cd-main-swiper .swiper-slide img {
    width: 100%; height: 100%; object-fit: cover;
}
.cd-thumb-wrap {
    padding: 12px;
    background: var(--bg-card2);
    border-top: 1px solid var(--border);
}
.cd-thumb-swiper {
    width: 100%;
    --swiper-navigation-color: rgba(255,255,255,.7);
}
.cd-thumb-swiper swiper-slide,
.cd-thumb-swiper .swiper-slide {
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color .2s;
    height: 64px !important;
}
.cd-thumb-swiper swiper-slide.swiper-slide-thumb-active,
.cd-thumb-swiper .swiper-slide-thumb-active {
    border-color: var(--gold);
}
.cd-thumb-swiper img { width: 100%; height: 100%; object-fit: cover; }

.cd-gallery-loader {
    display: flex; align-items: center; justify-content: center;
    height: 480px; background: var(--bg-card);
}

/* ---- SPECS PANEL ---- */
.cd-specs-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    position: sticky;
    top: calc(var(--nav-h) + 16px);
}
.cd-specs-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.cd-badge-source {
    font-size: .72rem; font-weight: 700; letter-spacing: .08em;
    padding: 3px 10px; border-radius: 20px;
    background: rgba(212,175,55,.15); color: var(--gold);
    border: 1px solid rgba(212,175,55,.3);
    text-transform: uppercase;
}
.cd-specs-header .car-title-sm {
    font-size: 1.1rem; font-weight: 700; color: #fff;
}
.cd-price-row {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.cd-price-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.cd-price-val { font-size: 1.5rem; font-weight: 800; color: var(--gold); margin-left: auto; }

/* Specs table */
.cd-specs-tbl {
    width: 100%; border-collapse: collapse;
}
.cd-specs-tbl tr { border-bottom: 1px solid var(--border); }
.cd-specs-tbl tr:last-child { border-bottom: none; }
.cd-specs-tbl td {
    padding: 10px 24px;
    font-size: .84rem;
    vertical-align: middle;
}
.cd-specs-tbl td:first-child {
    color: var(--text-muted);
    width: 42%;
    white-space: nowrap;
}
.cd-specs-tbl td:last-child {
    color: var(--text);
    font-weight: 500;
}
.cd-location-flag { display: inline-flex; align-items: center; gap: 6px; }
.cd-location-flag img { width: 20px; border-radius: 2px; }

/* CTA */
.cd-cta-wrap {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}
.cd-btn-quote {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 14px;
    background: var(--gold); color: #000;
    border: none; border-radius: 10px;
    font-size: 1rem; font-weight: 700; letter-spacing: .04em;
    cursor: pointer; transition: background .2s, transform .15s;
    text-transform: uppercase;
}
.cd-btn-quote:hover { background: var(--gold-light); transform: translateY(-1px); }
.cd-btn-quote svg { width: 18px; height: 18px; }

/* ---- WHAT TO KNOW SECTION ---- */
.cd-know {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.cd-know-head {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 28px;
}
.cd-know-head .bar { width: 4px; height: 28px; background: var(--gold); border-radius: 3px; }
.cd-know-head h2 { font-size: 1.3rem; font-weight: 700; color: #fff; }
.cd-know-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.cd-know-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 22px;
    transition: border-color .2s;
}
.cd-know-card:hover { border-color: rgba(212,175,55,.35); }
.cd-know-card .icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: rgba(212,175,55,.12); color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 14px;
}
.cd-know-card h5 {
    font-size: .93rem; font-weight: 700; color: #fff; margin-bottom: 8px;
}
.cd-know-card p { font-size: .82rem; color: var(--text-muted); line-height: 1.6; }

/* ---- MODAL (dark) ---- */
.cd-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.75);
    align-items: center; justify-content: center;
}
.cd-modal-overlay.active { display: flex; }
.cd-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%; max-width: 520px;
    margin: 16px;
    overflow: hidden;
    animation: slideUp .25s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.cd-modal-head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.cd-modal-head h3 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.cd-modal-tabs { display: flex; gap: 4px; }
.cd-modal-tab {
    padding: 6px 16px; border-radius: 6px; cursor: pointer;
    font-size: .82rem; font-weight: 600;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); transition: .2s;
}
.cd-modal-tab.active { background: var(--gold); color: #000; border-color: var(--gold); }
.cd-modal-close {
    background: none; border: none; color: var(--text-muted);
    font-size: 1.4rem; cursor: pointer; line-height: 1;
    transition: color .2s;
}
.cd-modal-close:hover { color: #fff; }
.cd-modal-body { padding: 24px; }
.cd-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.cd-form-group { display: flex; flex-direction: column; gap: 6px; }
.cd-form-group.full { grid-column: 1 / -1; }
.cd-form-group label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.cd-form-group label span { color: #e55; }
.cd-form-group input,
.cd-form-group select,
.cd-form-group textarea {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: .88rem;
    outline: none;
    transition: border-color .2s;
    width: 100%;
}
.cd-form-group select option { background: #1a1a1a; }
.cd-form-group input:focus,
.cd-form-group select:focus,
.cd-form-group textarea:focus { border-color: var(--gold); }
.cd-form-group textarea { resize: vertical; min-height: 90px; }
.cd-btn-send {
    width: 100%; padding: 13px;
    background: var(--gold); color: #000;
    border: none; border-radius: 10px;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    text-transform: uppercase; letter-spacing: .05em;
    transition: background .2s; margin-top: 8px;
}
.cd-btn-send:hover { background: var(--gold-light); }
.cd-login-panel { text-align: center; }
.cd-login-panel .form-control {
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 8px; padding: 11px 14px; color: #fff; font-size: .9rem;
    width: 100%; margin-bottom: 12px; outline: none;
}
.cd-login-panel .form-control:focus { border-color: var(--gold); }
.cd-login-btn {
    width: 100%; padding: 13px;
    background: var(--gold); color: #000;
    border: none; border-radius: 10px;
    font-size: .95rem; font-weight: 700; cursor: pointer;
    text-transform: uppercase; margin-bottom: 14px;
}
.cd-modal-tab-content { display: none; }
.cd-modal-tab-content.active { display: block; }

/* ---- SUCCESS MODAL ---- */
.cd-success-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,.75);
    align-items: center; justify-content: center;
}
.cd-success-modal.active { display: flex; }
.cd-success-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px; padding: 40px 32px;
    text-align: center; max-width: 400px; width: 100%; margin: 16px;
}
.cd-success-icon { font-size: 3rem; margin-bottom: 16px; }
.cd-success-box h3 { font-size: 1.3rem; color: var(--gold); font-weight: 700; margin-bottom: 10px; }
.cd-success-box p { color: var(--text-muted); font-size: .9rem; line-height: 1.6; margin-bottom: 24px; }
.cd-btn-close-success {
    background: var(--gold); color: #000;
    border: none; border-radius: 10px;
    padding: 11px 32px; font-weight: 700; cursor: pointer; font-size: .95rem;
}

/* ---- FOOTER ---- */
.dh-footer { background: #0d0d0d !important; border-top: 1px solid var(--border); padding: 60px 32px 32px; }
.footer-top { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand .logo { height: 36px; margin-bottom: 16px; display: block; }
.footer-brand p { color: var(--text-muted); font-size: .85rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: 16px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); text-decoration: none; font-size: .85rem; transition: color .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { max-width: 1280px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; background: transparent !important; }
.footer-bottom p { color: var(--text-muted); font-size: .82rem; }
.footer-bottom .gold-text { color: var(--gold); font-weight: 600; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .cd-main-grid { grid-template-columns: 1fr; }
    .cd-specs-panel { position: static; }
    .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .cd-wrapper { padding: 16px 16px 48px; }
    .cd-breadcrumb { padding: calc(var(--nav-h) + 12px) 16px 0; }
    .dh-nav { padding: 0 16px; }
    .dh-nav .nav-links, .dh-nav .nav-actions { display: none; }
    .hamburger { display: flex; }
    .dh-nav.menu-open .nav-links {
        display: flex; flex-direction: column;
        position: fixed; top: var(--nav-h); left: 0; right: 0;
        background: #0d0d0d; padding: 20px 24px; gap: 16px;
        border-bottom: 1px solid var(--border);
    }
    .dh-nav.menu-open .nav-actions {
        display: flex; position: fixed;
        top: calc(var(--nav-h) + 180px); left: 0; right: 0;
        background: #0d0d0d; padding: 16px 24px;
        border-bottom: 1px solid var(--border);
    }
    .cd-main-swiper { height: 280px; }
    .cd-gallery-loader { height: 280px; }
    .cd-title-row h1 { font-size: 1.2rem; }
    .cd-know-grid { grid-template-columns: 1fr; }
    .cd-form-row { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
