/* ============================================================
   RU JAPAN — Dark Homepage Theme (v2 – compact & clean)
   ============================================================ */

:root {
    --bg:       #0d0d0d;
    --bg-card:  #161616;
    --bg-card2: #1e1e1e;
    --gold:     #D4AF37;
    --gold-lt:  #e8c84a;
    --white:    #f0f0f0;
    --muted:    #7a7a7a;
    --border:   #252525;
    --radius:   10px;
    --nav-h:    58px;
    --wrap:     1320px;
}

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

/* Hide the old shared header/navbar from headers_new.php */
header { display: none !important; }

html, body {
    background: var(--bg) !important;
    color: var(--white) !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Segoe UI', system-ui, sans-serif !important;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.dh-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(10,10,10,.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    z-index: 25000;
    transition: height .25s, background .25s;
}
.dh-nav .nav-logo img { height: 32px; }
.dh-nav .nav-links { display: flex; gap: 26px; list-style: none; }
.dh-nav .nav-links a { font-size: 13px; color: #bbb; letter-spacing: .3px; transition: color .2s; }
.dh-nav .nav-links a:hover { color: var(--gold); }
.dh-nav .nav-links .has-sub { position: relative; }
.dh-nav .nav-links .has-sub .sub-menu {
    display: none; position: absolute; top: calc(100% + 10px); left: 50%;
    transform: translateX(-50%); background: #1c1c1c; border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 0; min-width: 165px; white-space: nowrap;
}
.dh-nav .nav-links .has-sub .sub-menu::before {
    content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px;
}
.dh-nav .nav-links .has-sub:hover .sub-menu,
.dh-nav .nav-links .has-sub.sub-open .sub-menu { display: block; }
.dh-nav .nav-links .has-sub .sub-menu a { display: block; padding: 8px 18px; font-size: 12.5px; color: #aaa; }
.dh-nav .nav-links .has-sub .sub-menu a:hover { color: var(--gold); background: rgba(212,175,55,.05); }
.dh-nav .nav-actions { display: flex; align-items: center; gap: 10px; }
.dh-nav .btn-login  { padding: 6px 16px; border: 1px solid var(--border); border-radius: 6px; font-size: 12.5px; color: #bbb; transition: .2s; }
.dh-nav .btn-login:hover { border-color: var(--gold); color: var(--gold); }
.dh-nav .btn-register { padding: 6px 16px; background: var(--gold); border-radius: 6px; font-size: 12.5px; color: #000; font-weight: 700; transition: .2s; }
.dh-nav .btn-register:hover { background: var(--gold-lt); }
.dh-nav .hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.dh-nav .hamburger span { display: block; width: 22px; height: 2px; background: #ccc; border-radius: 2px; }

/* ============================================================
   HERO — with search integrated
   ============================================================ */
.dh-hero {
    position: relative !important;
    height: 82vh;
    min-height: 520px;
    overflow: hidden;
    width: 100% !important;
    /* Fallback gradient when slide images don't load */
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1204 40%, #0d0d0d 100%);
}

.dh-hero .swiper,
.dh-hero .swiper-wrapper,
.dh-hero .swiper-slide {
    position: absolute !important; inset: 0; width: 100% !important; height: 100% !important;
}
.dh-hero .swiper-slide {
    overflow: hidden;
}
/* Slide images fill the full slide */
.hero-slide-img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block !important;
    max-width: none !important;
}

.dh-hero .hero-overlay {
    position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.5)  0%,
        rgba(0,0,0,.55) 45%,
        rgba(13,13,13,1) 100%
    );
    pointer-events: none;
}

/* Centered content — absolute so flex conflicts can't break it */
.dh-hero .hero-center {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    width: 100%;
    max-width: 820px;
    padding: 0 24px;
}

.dh-hero h1 {
    font-size: clamp(28px, 4.2vw, 52px) !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    margin-bottom: 10px !important;
    letter-spacing: -.5px;
    color: #fff !important;
    text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.dh-hero h1 .gold { color: var(--gold) !important; }
.dh-hero .hero-sub {
    font-size: 15px; color: #ccc; margin-bottom: 28px; letter-spacing: .2px;
    text-shadow: 0 1px 8px rgba(0,0,0,.7);
}

/* Stats — absolute bottom left */
.dh-hero .hero-stats {
    position: absolute !important;
    bottom: 36px; left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex; gap: 44px;
}
.dh-hero .stat-item { text-align: center; }
.dh-hero .stat-link {
    text-decoration: none;
    transition: transform .2s;
    display: flex; flex-direction: column; align-items: center;
}
.dh-hero .stat-link:hover { transform: translateY(-3px); }
.dh-hero .stat-link:hover .stat-num { color: #f0cc55; }
.dh-hero .stat-num  { font-size: 24px; font-weight: 700; color: var(--gold); line-height: 1; text-shadow: 0 2px 8px rgba(0,0,0,.6); transition: color .2s; }
.dh-hero .stat-label { font-size: 10px; color: #aaa; margin-top: 3px; letter-spacing: .7px; text-transform: uppercase; }

.dh-hero .swiper-pagination { z-index: 4 !important; bottom: 14px !important; }
.dh-hero .swiper-pagination-bullet { background: rgba(255,255,255,.35); opacity: 1; width: 6px; height: 6px; }
.dh-hero .swiper-pagination-bullet-active { background: var(--gold); width: 20px; border-radius: 3px; }

/* ── Hero text search ─────────────────────────────────── */
.hero-search-wrap {
    max-width: 680px;
    margin: 0 auto;
}

/* Stock type tabs */
.hs-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}
.hs-tab {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
    padding: 5px 18px;
    font-size: 12px;
    color: #aaa;
    cursor: pointer;
    transition: .2s;
    font-family: inherit;
}
.hs-tab:hover { border-color: var(--gold); color: var(--gold); }
.hs-tab.active {
    background: var(--gold);
    border-color: var(--gold);
    color: #000;
    font-weight: 700;
}

/* Search row */
.hero-search {
    background: rgba(255,255,255,.07) !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 14px;
    padding: 10px 10px 10px 10px;
    display: flex !important;
    gap: 10px;
    align-items: center;
}

/* Input wrapper with icon */
.hs-input-wrap {
    position: relative;
    flex: 1;
}
.hs-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 18px;
    pointer-events: none;
}
.hero-search input[type="text"] {
    width: 100% !important;
    background: rgba(20,20,20,.85) !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    border-radius: 10px !important;
    padding: 13px 14px 13px 42px !important;
    color: #f0f0f0 !important;
    font-size: 14px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .2s;
}
.hero-search input[type="text"]::placeholder { color: #666 !important; }
.hero-search input[type="text"]:focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(212,175,55,.12) !important;
}

/* Search button */
.hero-search .search-btn {
    padding: 13px 28px !important;
    background: var(--gold) !important;
    color: #000 !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
    letter-spacing: .3px;
    box-shadow: none !important;
    flex-shrink: 0;
}
.hero-search .search-btn:hover { background: var(--gold-lt) !important; }


.dh-hero .swiper-pagination { z-index: 2; bottom: 14px !important; }
.dh-hero .swiper-pagination-bullet { background: rgba(255,255,255,.35); opacity: 1; width: 6px; height: 6px; }
.dh-hero .swiper-pagination-bullet-active { background: var(--gold); width: 20px; border-radius: 3px; }

/* ============================================================
   BROWSE BY TYPE
   ============================================================ */
.dh-types {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 18px 0;
}
.dh-types .inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.dh-types .inner::-webkit-scrollbar { display: none; }
.dh-types .type-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; margin-right: 10px; }
.type-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 12px; color: #bbb;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
    text-decoration: none;
}
.type-pill:hover,
.type-pill.active { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.07); }
.type-pill .tp-icon { font-size: 15px; line-height: 1; }

/* ============================================================
   SECTION WRAPPER
   ============================================================ */
.dh-section {
    padding: 36px 0 28px;
}
.dh-section + .dh-section { padding-top: 0; }
.dh-section .inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 28px;
}

.dh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.dh-section-head .left { display: flex; align-items: center; gap: 10px; }
.dh-gold-bar { width: 3px; height: 22px; background: var(--gold); border-radius: 2px; flex-shrink: 0; }
.dh-section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.dh-section-head .source-tag {
    font-size: 10px; color: var(--gold); border: 1px solid var(--gold);
    padding: 2px 9px; border-radius: 20px; letter-spacing: .4px; text-transform: uppercase;
}
.dh-see-all {
    font-size: 12px; color: var(--muted);
    display: flex; align-items: center; gap: 5px; transition: color .2s;
}
.dh-see-all:hover { color: var(--gold); }
.dh-see-all .arrow {
    width: 24px; height: 24px; border: 1px solid var(--border);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: border-color .2s, background .2s;
}
.dh-see-all:hover .arrow { border-color: var(--gold); background: var(--gold); color: #000; }

/* ============================================================
   CAR GRID & CARDS
   ============================================================ */
.dh-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 12px;
}

.dh-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    text-decoration: none;
}
.dh-card:hover {
    border-color: rgba(212,175,55,.45);
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0,0,0,.45);
}

.dh-card .card-img {
    position: relative;
    height: 135px;
    overflow: hidden;
    background: #111;
}
.dh-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.dh-card:hover .card-img img { transform: scale(1.05); }

.dh-card .card-badge {
    position: absolute; top: 8px; left: 8px;
    padding: 2px 9px; border-radius: 20px;
    font-size: 9.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.card-badge.japan { background: rgba(212,175,55,.2); color: var(--gold); border: 1px solid rgba(212,175,55,.35); }
.card-badge.korea { background: rgba(70,130,255,.18); color: #7ab2ff; border: 1px solid rgba(70,130,255,.3); }
.card-badge.uae   { background: rgba(255,140,0,.18); color: #ffaa40; border: 1px solid rgba(255,140,0,.3); }

.dh-card .card-negotiation {
    position: absolute; top: 8px; right: 8px;
    background: rgba(212,175,55,.9); color: #000;
    font-size: 9px; font-weight: 700; padding: 2px 7px;
    border-radius: 4px; letter-spacing: .3px;
}

.dh-card .card-body {
    padding: 11px 12px 12px;
    flex: 1; display: flex; flex-direction: column; gap: 7px;
}
.dh-card .car-name {
    font-size: 13px; font-weight: 600; color: var(--white);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dh-card .car-specs {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.dh-card .spec-chip {
    display: flex; align-items: center; gap: 3px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 10px; color: var(--muted); white-space: nowrap;
}
.dh-card .spec-chip .spec-icon { font-size: 10px; opacity: .65; }

/* ============================================================
   MARKET DESTINATIONS
   ============================================================ */
.dh-markets {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 36px 0;
}
.dh-markets .inner {
    max-width: var(--wrap); margin: 0 auto; padding: 0 28px;
}
.dh-markets .flags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.dh-flag-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 6px;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 8px; transition: border-color .2s, transform .2s; cursor: pointer;
}
.dh-flag-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.dh-flag-card img  { width: 40px; height: 27px; object-fit: cover; border-radius: 3px; }
.dh-flag-card span { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.3; }
.dh-flag-card:hover span { color: var(--white); }

/* ============================================================
   FOOTER
   ============================================================ */
.dh-footer {
    background: #080808;
    border-top: 1px solid var(--border);
    padding: 40px 0 22px;
}
.dh-footer .inner { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.dh-footer .footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 32px; margin-bottom: 32px;
}
.dh-footer .footer-brand .logo { height: 30px; margin-bottom: 12px; }
.dh-footer .footer-brand p { font-size: 12.5px; color: var(--muted); line-height: 1.7; max-width: 230px; }
.dh-footer .footer-col h4 { font-size: 11.5px; font-weight: 600; color: var(--white); margin-bottom: 14px; letter-spacing: .5px; text-transform: uppercase; }
.dh-footer .footer-col ul { list-style: none; }
.dh-footer .footer-col ul li { margin-bottom: 8px; }
.dh-footer .footer-col ul li a { font-size: 12.5px; color: var(--muted); transition: color .2s; }
.dh-footer .footer-col ul li a:hover { color: var(--gold); }
.dh-footer .footer-bottom {
    border-top: 1px solid var(--border); padding-top: 18px;
    display: flex; align-items: center; justify-content: space-between;
}
.dh-footer .footer-bottom p { font-size: 11.5px; color: #444; }
.dh-footer .footer-bottom .gold-text { color: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .dh-nav { padding: 0 18px; }
    .dh-nav .nav-links, .dh-nav .nav-actions { display: none; }
    .dh-nav .hamburger { display: flex; }
    .hero-search-wrap { max-width: 100%; padding: 0 16px; }
    .dh-footer .footer-top { grid-template-columns: 1fr 1fr; gap: 24px; }

    /* Mobile menu open state — handled by dark_nav.css */
}
@media (max-width: 640px) {
    .dh-hero { height: 78vh; }
    .dh-hero h1 { font-size: 24px; }
    .dh-hero .hero-stats { gap: 24px; }
    .dh-hero .stat-num { font-size: 18px; }
    .hero-search { flex-direction: column; padding: 12px; }
    .hero-search .search-btn { width: 100% !important; }
    .hs-input-wrap { width: 100%; }
    .dh-cars-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dh-markets .flags-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .dh-footer .footer-top { grid-template-columns: 1fr; gap: 20px; }
    .dh-footer .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }
    .dh-section .inner,
    .dh-types .inner,
    .dh-markets .inner,
    .dh-footer .inner { padding: 0 14px; }
}

/* lazy placeholder */
.dh-card .card-img img[data-src] { background: #161616; }
