:root {
    --bg: #f7f8fa;
    --surface: #ffffff;
    --border: #eceef2;
    --text: #0f1115;
    --text-muted: #6b7280;
    --primary: #ff4d3d;
    --primary-dark: #e6392f;
    --accent: #ff2d78;
    --green: #16a34a;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 6px rgba(17, 24, 39, .06), 0 16px 40px rgba(17, 24, 39, .10);
    --shadow-lg: 0 4px 12px rgba(17, 24, 39, .08), 0 32px 64px rgba(17, 24, 39, .16);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -.02em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
    background: #0b1220;
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; white-space: nowrap; }
.logo-text { font-family: 'Sora', var(--font); font-weight: 700; font-size: 1.4rem; letter-spacing: -0.02em; color: #fff; display: flex; align-items: center; }
.logo-text span { color: transparent; background: linear-gradient(135deg, #ff6a3d 0%, #ff2d78 100%); -webkit-background-clip: text; background-clip: text; }
.logo-be-box { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 28px; flex-shrink: 0; line-height: 1; border-radius: 8px; background: linear-gradient(135deg, #ff6a3d 0%, #ff2d78 100%); color: #fff !important; font-size: 0.8em; font-weight: 800; margin-right: 5px; -webkit-background-clip: unset !important; background-clip: unset !important; box-shadow: 0 3px 12px rgba(255,77,61,.35); transform: rotate(-8deg); transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.brand:hover .logo-be-box, .footer-brand:hover .logo-be-box { transform: rotate(0deg); }
.main-nav { display: flex; gap: 4px; }
.main-nav a { padding: 7px 13px; border-radius: 8px; font-weight: 600; color: #aab4c8; font-size: .92rem; }
.main-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.main-nav a.active { color: #fff; background: rgba(255,77,61,.2); }
.header-search { flex: 1; display: flex; max-width: 460px; }
.header-search input {
    flex: 1; border: 1px solid rgba(255,255,255,.14); border-right: 0; border-radius: 10px 0 0 10px;
    padding: 10px 14px; font-size: .92rem; font-family: var(--font); outline: none; background: #131c2e; color: #fff;
}
.header-search input::placeholder { color: #7c8798; }
.header-search input:focus { border-color: var(--primary); }
.header-search button {
    border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 0 10px 10px 0;
    padding: 0 16px; cursor: pointer;
}
.lang-switcher { display: flex; gap: 2px; }
.lang-switcher a { padding: 5px 8px; border-radius: 7px; font-size: .8rem; font-weight: 700; color: #aab4c8; }
.lang-switcher a.active { background: var(--primary); color: #fff; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #0b1220 0%, #1a1430 55%, #ff2d78 130%);
    color: #fff;
    padding: 72px 0 84px;
}
.hero .container { display: grid; gap: 22px; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; max-width: 720px; }
.hero p { color: #c7d2e8; font-size: 1.08rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 11px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; transition: .15s; }
.btn-primary { background: #fff; color: #0b1220; }
.btn-primary:hover { background: #eef2ff; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }
.btn-accent { background: linear-gradient(135deg, #ff6a3d, #ff2d78); color: #fff; border: 0; }
.btn-accent:hover { filter: brightness(1.06); }

/* Sections */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 12px; }
.section-head h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.section-head a { color: var(--primary); font-weight: 600; font-size: .9rem; }

/* Listing grid + card */
.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.listing-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.listing-card-img { position: relative; aspect-ratio: 4/3; background: #eef0f4; overflow: hidden; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #b6bcc8; font-size: 2rem; }
.listing-type-badge {
    position: absolute; top: 10px; left: 10px; background: rgba(11,18,32,.72); color: #fff;
    font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.listing-ad-badge {
    position: absolute; top: 10px; right: 10px; background: linear-gradient(135deg, #ff6a3d, #ff2d78); color: #fff;
    font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; box-shadow: 0 3px 10px rgba(255,45,120,.35);
}
.listing-card-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-card-title { font-size: .98rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.listing-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-muted); font-size: .82rem; }
.listing-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.listing-card-price { font-weight: 800; color: var(--primary-dark); font-size: .98rem; white-space: nowrap; }
.listing-card-seller { color: var(--text-muted); font-size: .78rem; display: inline-flex; align-items: center; gap: 4px; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Filter bar */
.filter-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 140px; flex: 1; }
.filter-group label { font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.form-control {
    border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: .9rem;
    font-family: var(--font); background: #fff; outline: none; width: 100%;
}
.form-control:focus { border-color: var(--primary); }
.filter-row .btn { align-self: flex-end; }
.filter-ranges-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; width: 100%; }
.filter-ranges-row .range-group { flex: 1 1 240px; min-width: 240px; }
.filter-ranges-row .btn { flex: 0 0 auto; align-self: flex-end; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.6rem; margin-bottom: 12px; opacity: .5; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: .9rem; font-weight: 600; color: var(--text-muted); background: #fff; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Detail page */
.detail-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.detail-gallery { position: relative; border-radius: var(--radius); overflow: hidden; background: #eef0f4; }
.detail-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-arrows { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; pointer-events: none; }
.gallery-arrows button { pointer-events: auto; background: rgba(11,18,32,.6); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.gallery-thumbs img { width: 74px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; opacity: .7; }
.gallery-thumbs img.active { border-color: var(--primary); opacity: 1; }

.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.detail-price { font-size: 1.7rem; font-weight: 800; color: var(--primary-dark); }
.detail-title { font-size: 1.35rem; font-weight: 800; margin: 6px 0 14px; line-height: 1.25; }
.spec-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table td { padding: 9px 0; font-size: .92rem; }
.spec-table td:first-child { color: var(--text-muted); width: 45%; }
.dealer-box { display: flex; align-items: center; gap: 12px; padding: 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 14px; }
.dealer-box .dealer-avatar { width: 42px; height: 42px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; }
.dealer-box .dealer-name { font-weight: 700; }
.dealer-box .dealer-loc { color: var(--text-muted); font-size: .82rem; }
.buy-cta { margin-top: 18px; width: 100%; justify-content: center; padding: 14px; font-size: 1rem; }

/* Dealer page */
.dealer-hero { display: flex; align-items: center; gap: 18px; padding: 26px 0; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.dealer-hero .dealer-avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.6rem; }

/* Footer */
.site-footer { background: #0b1220; color: #c7d2e8; padding: 56px 0 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 32px; padding-bottom: 44px; }
.footer-brand { display: inline-flex; align-items: center; }
.footer-desc { color: #8b97ab; font-size: .9rem; margin-top: 16px; max-width: 300px; line-height: 1.6; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { color: #fff; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.footer-col a { color: #8b97ab; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-col a i { width: 18px; color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: #8b97ab; }
.footer-operator a { color: #c7d2e8; font-weight: 600; }
.footer-operator a:hover { color: #fff; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* Responsive */
.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.mobile-toggle span { width: 22px; height: 2px; background: #fff; border-radius: 2px; transition: .2s; }
.mobile-menu { display: none; background: #0b1220; border-top: 1px solid rgba(255,255,255,.08); padding: 8px 20px 16px; }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 12px 0; color: #c7d2e8; font-weight: 600; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.mobile-menu a:hover { color: #fff; }

.mobile-lang { display: flex; gap: 8px; padding: 14px 0 4px; }
.mobile-lang a { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; padding: 7px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.16); color: #c7d2e8; font-weight: 700; font-size: .82rem; }
.mobile-lang a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.mobile-search { display: flex; margin: 4px 0 6px; }
.mobile-search input { flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.18); border-right: 0; border-radius: 10px 0 0 10px; padding: 11px 14px; font-size: .95rem; font-family: var(--font); background: rgba(255,255,255,.07); color: #fff; outline: none; }
.mobile-search input::placeholder { color: #9aa5bd; }
.mobile-search button { border: 0; background: linear-gradient(135deg, #ff6a3d, #ff2d78); color: #fff; border-radius: 0 10px 10px 0; padding: 0 18px; cursor: pointer; }

.carpass-link { display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; transition: border-color .2s, box-shadow .2s; }
.carpass-link:hover { border-color: var(--primary); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.carpass-link img { height: 42px; width: auto; flex-shrink: 0; }
.carpass-link > div { flex: 1 1 auto; min-width: 0; }
.carpass-link strong { font-size: .85rem; color: var(--text); display: block; }
.carpass-link p { font-size: .75rem; color: var(--text-muted); margin: 2px 0 0; }

@media (max-width: 900px) {
    .detail-layout { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 12px 20px; }
    .header-search { order: 5; flex-basis: 100%; max-width: none; }
}
@media (max-width: 768px) {
    .main-nav { display: none; }
    .lang-switcher { display: none; }
    .header-search { display: none; }
    .mobile-toggle { display: flex; margin-left: auto; }
}
@media (max-width: 560px) {
    .listings-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .filter-group { min-width: 120px; }
}

/* ===== Sticky footer ===== */
.site-main { flex: 1 0 auto; }

/* ===== Filter selects: match the search input + custom dropdown ===== */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}
.custom-select { position: relative; width: 100%; }
.custom-select-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 9px 12px 9px 14px;
    border: 1px solid var(--border); border-radius: 9px; background: #fff;
    font-size: .9rem; font-family: var(--font); color: var(--text); cursor: pointer;
    line-height: 1.55; text-align: left;
}
.custom-select-btn i { color: var(--text-muted); font-size: .72rem; transition: transform .15s; }
.custom-select-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.custom-select-dropdown {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 120;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(17,24,39,.14); display: none; overflow: hidden;
}
.custom-select-dropdown.show { display: block; }
.custom-select-search {
    width: 100%; border: 0; border-bottom: 1px solid var(--border);
    padding: 11px 13px; font-size: .9rem; font-family: var(--font); outline: none;
}
.custom-select-list { max-height: 220px; overflow-y: auto; padding: 6px; }
.custom-select-option { padding: 9px 11px; border-radius: 7px; font-size: .9rem; color: var(--text); cursor: pointer; }
.custom-select-option:hover, .custom-select-option.selected { background: #f3f4f6; }

/* Range sliders (price / mileage) */
.range-group { flex-basis: 100%; min-width: 100%; }
.range-hint { font-size: .72rem; font-weight: 600; color: var(--text-muted); text-transform: none; letter-spacing: 0; }
.range { position: relative; height: 26px; margin-top: 4px; }
.range input[type="range"] { position: absolute; top: 0; left: 0; width: 100%; height: 26px; -webkit-appearance: none; appearance: none; background: transparent; pointer-events: none; margin: 0; }
.range input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.range input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); cursor: pointer; pointer-events: auto; }
.range input[type="range"]::-moz-range-track { background: transparent; }
.range-track { position: absolute; top: 50%; left: 0; right: 0; height: 5px; transform: translateY(-50%); background: #e5e7eb; border-radius: 999px; }
.range-progress { position: absolute; top: 50%; height: 5px; transform: translateY(-50%); background: var(--primary); border-radius: 999px; }
.range-values { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 700; color: var(--text); margin-top: 2px; }

/* ===== Policy pages ===== */
.policy-updated { color: var(--text-muted); font-size: .85rem; margin-bottom: 24px; }
.policy-body h2 { font-size: 1.15rem; font-weight: 800; margin: 26px 0 10px; }
.policy-body p { color: var(--text-muted); margin-bottom: 12px; }
.policy-body ul { color: var(--text-muted); margin: 0 0 12px 20px; }
.policy-body li { margin-bottom: 6px; }
.policy-body a { color: var(--primary); font-weight: 600; }

/* ===================== Design upgrade ===================== */

/* Header — scrolled shadow */
.site-header { transition: box-shadow .25s ease, background .25s ease; }
.site-header.scrolled { box-shadow: 0 10px 30px rgba(11,18,32,.28); }

/* Buttons */
.btn { border-radius: 12px; font-weight: 600; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-accent { box-shadow: 0 10px 24px rgba(255,45,120,.35); }

/* Sections — more generous spacing */
.section { padding: 56px 0; }
.section-head h2 { font-size: 1.6rem; }
.section-head a { font-weight: 700; }

/* Hero */
.hero { padding: 88px 0 96px; }
.hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
.hero p { font-size: 1.15rem; }

/* Hero search */
.hero-search { max-width: 640px; margin-top: 8px; }
.hero-search-tabs { display: inline-flex; gap: 4px; padding: 4px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-bottom: 0; border-radius: 12px 12px 0 0; }
.hs-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; background: transparent; color: #c7d2e8; font-family: var(--font); font-size: .9rem; font-weight: 600; border-radius: 9px 9px 0 0; cursor: pointer; }
.hs-tab.active { background: var(--primary); color: #fff; }
.hs-tab i { font-size: .85rem; }
.hero-search-row { display: flex; }
.hero-search-row input {
    flex: 1; border: 1px solid rgba(255,255,255,.18); border-right: 0; border-radius: 0 0 0 14px;
    padding: 15px 18px; font-size: 1rem; font-family: var(--font); background: rgba(255,255,255,.07); color: #fff; outline: none;
}
.hero-search-row input::placeholder { color: #9aa5bd; }
.hero-search-row button { border: 0; background: linear-gradient(135deg, #ff6a3d, #ff2d78); color: #fff; border-radius: 0 0 14px 0; padding: 0 26px; cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.hero-search-wrap { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero-results { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-size: .9rem; white-space: nowrap; }
.hero-results strong { color: #fff; font-weight: 700; }
.hero-results i { color: var(--accent); }

/* Hero category tiles */
.hero-cats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-cat {
    display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
    color: #fff; font-weight: 600; font-size: .95rem; transition: background .15s, transform .15s;
}
.hero-cat:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.hero-cat i { color: var(--accent); }

/* Cards — image zoom + seller avatar */
.listing-card { transition: transform .22s cubic-bezier(.25,.46,.45,.94), box-shadow .22s; }
.listing-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.listing-card-img img { transition: transform .5s cubic-bezier(.25,.46,.45,.94); }
.listing-card:hover .listing-card-img img { transform: scale(1.06); }
.listing-card-seller { gap: 6px; }
.listing-card-seller .seller-avatar {
    width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, #ff6a3d, #ff2d78); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: .62rem; font-weight: 800;
}
.seller-avatar-img { object-fit: cover; }
.listing-card-price { color: var(--primary-dark); font-family: var(--font-display); font-size: 1.02rem; }

/* Detail — sticky sidebar */
@media (min-width: 901px) {
    .detail-card { position: sticky; top: 88px; }
}

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Empty state */
.empty-state i { font-size: 3rem; }

/* Discount */
.listing-discount-badge {
    position: absolute; bottom: 10px; left: 10px;
    background: #16a34a; color: #fff; font-size: .72rem; font-weight: 800; padding: 4px 9px; border-radius: 999px;
}
.card-old-price { position: relative; color: var(--text-muted); font-size: .78rem; font-weight: 500; margin-right: 6px; }
.card-old-price::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--primary); border-radius: 2px; transform: translateY(-50%); }

/* Detail discount + options */
.detail-discount { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.detail-old-price { position: relative; color: var(--text-muted); font-size: 1rem; }
.detail-old-price::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--primary); border-radius: 2px; transform: translateY(-50%); }
.detail-save { background: #dcfce7; color: #15803d; font-weight: 800; font-size: .8rem; padding: 3px 9px; border-radius: 999px; }
.detail-options { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-options h3 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.option-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip { background: #f1f3f7; border: 1px solid var(--border); color: var(--text); font-size: .82rem; font-weight: 500; padding: 5px 12px; border-radius: 999px; }
.options-block { margin-top: 24px; }
.options-title { font-size: 1rem; font-weight: 800; margin-bottom: 6px; }
.options-cat { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 18px 0 6px; }
.options-cat:first-of-type { margin-top: 12px; }
.options-grid { display: flex; flex-direction: column; gap: 1.1rem; }
.vehicle-options-section { margin-top: 1.8rem; }
.options-section-title { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.options-section-title i { color: var(--primary); }
.opt-block-title { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .6rem; }
.opt-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt-tag { padding: .4rem .8rem; background: #f7f8fa; border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; color: var(--text); max-width: 100%; overflow-wrap: break-word; }
.option-item { display: flex; align-items: flex-start; gap: 9px; padding: 4px 0; font-size: .92rem; color: var(--text); line-height: 1.35; }
.option-item i { color: var(--green); font-size: .78rem; margin-top: 3px; flex-shrink: 0; }

/* Show more / view all */
.grid-more { display: none; }
.section-more { display: flex; justify-content: center; margin-top: 22px; }
.show-more-btn { display: inline-flex; }
.view-all-link { display: none; }

/* ===== Product detail (dealer-site-style layout) ===== */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: .85rem; font-weight: 600; margin-bottom: 20px; }
.crumb a { color: var(--text-muted); }
.crumb a:hover { color: var(--primary); }
.crumb i { font-size: .65rem; opacity: .6; }
.crumb span { color: var(--text); }

.product-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.product-gallery { position: sticky; top: 90px; min-width: 0; }

.carousel { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.carousel-inner { position: relative; width: 100%; aspect-ratio: 16 / 10.5; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(11,18,32,.55); border: 1px solid rgba(255,255,255,.25); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: .9rem; transition: .15s; z-index: 5; }
.carousel-arrow:hover { background: var(--primary); border-color: var(--primary); }
.carousel-prev { left: 14px; }
.carousel-next { right: 14px; }
.carousel-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: .45rem; z-index: 5; }
.carousel-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; transition: .15s; }
.carousel-dot.active { background: var(--primary); width: 22px; }
.carousel-expand { position: absolute; bottom: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: rgba(11,18,32,.55); border: 1px solid rgba(255,255,255,.25); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: .9rem; transition: .15s; z-index: 5; }
.carousel-expand:hover { background: var(--primary); border-color: var(--primary); }

.thumb-strip { display: flex; gap: .7rem; margin-top: .9rem; overflow-x: auto; padding-bottom: .3rem; }
.thumb-strip-item { flex: 0 0 auto; width: 92px; height: 62px; border-radius: 9px; overflow: hidden; cursor: pointer; border: 2px solid transparent; opacity: .55; transition: .15s; }
.thumb-strip-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-strip-item.active { border-color: var(--primary); opacity: 1; }
.thumb-strip-item:hover { opacity: 1; }

.product-details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.9rem; }
.product-brand { font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--primary); margin-bottom: .5rem; }
.product-title { font-family: var(--font-display); font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.12; color: var(--text); margin-bottom: 1rem; overflow-wrap: break-word; word-break: break-word; }
.product-price { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--text); }
.product-discount { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: .75rem 0 1.1rem; }
.product-price-wrap { display: flex; align-items: baseline; gap: .7rem; }
.price-original { font-size: 1.05rem; color: var(--text-muted); text-decoration: line-through; }
.price-sale { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; color: var(--text); }
.discount-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; background: var(--primary); color: #fff; border-radius: 8px; font-size: .8rem; font-weight: 700; box-shadow: 0 6px 18px rgba(255,45,120,.3); }

.badge-chip { display: inline-flex; align-items: center; gap: .4rem; margin: .3rem .3rem .3rem 0; padding: .4rem .85rem; background: rgba(22,163,74,.1); color: var(--green); border: 1px solid rgba(22,163,74,.3); border-radius: 999px; font-size: .8rem; font-weight: 600; }

.car-specs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 1.4rem 0; }
.spec-item { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; background: #f7f8fa; border: 1px solid var(--border); border-radius: 10px; }
.spec-item i { color: var(--primary); width: 18px; text-align: center; font-size: .85rem; flex-shrink: 0; }
.spec-item > div { display: flex; flex-direction: column; min-width: 0; }
.spec-label { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.spec-value { font-size: .92rem; font-weight: 600; color: var(--text); overflow-wrap: break-word; word-break: break-word; min-width: 0; }

/* Dealer card */
.dealer-card { margin-top: 1.6rem; padding: 1.2rem; background: #f7f8fa; border: 1px solid var(--border); border-radius: 12px; }
.dealer-card-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .7rem; }
.dealer-card .dealer-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; overflow: hidden; flex-shrink: 0; }
.dealer-card .dealer-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dealer-card-name { font-weight: 700; color: var(--text); font-size: .98rem; }
.dealer-card-domain { font-size: .82rem; color: var(--text-muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.dealer-card .line { display: flex; align-items: flex-start; gap: .7rem; font-size: .88rem; color: var(--text-muted); margin-bottom: .5rem; }
.dealer-card .line i { color: var(--primary); width: 16px; margin-top: .2rem; flex-shrink: 0; }

.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 22px; font-size: 1rem; }

/* Fullscreen lightbox */
.prime-lightbox { position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center; background: rgba(4,4,6,.96); }
.prime-lightbox.active { display: flex; }
.prime-lightbox-backdrop { position: absolute; inset: 0; }
.prime-lightbox-figure { position: relative; z-index: 2; margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; }
.prime-lightbox-figure img { max-width: 92vw; max-height: 80vh; width: auto; height: auto; object-fit: contain; background: #000; border-radius: 8px; }
.prime-lightbox-count { margin-top: .9rem; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: #c7d2e8; }
.prime-lightbox-close { position: fixed; top: 20px; right: 20px; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.2rem; transition: .15s; z-index: 3; }
.prime-lightbox-close:hover { background: var(--primary); border-color: var(--primary); }
.prime-lightbox-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; transition: .15s; z-index: 3; }
.prime-lightbox-nav:hover { background: var(--primary); border-color: var(--primary); }
.prime-lightbox-nav--prev { left: 20px; }
.prime-lightbox-nav--next { right: 20px; }

@media (max-width: 900px) {
    .product-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .product-gallery { position: static; }
    .car-specs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .product-details { padding: 1.2rem; }
    .product-title { font-size: 1.4rem; }
    .product-price, .price-sale { font-size: 1.7rem; }
    .carousel-inner { aspect-ratio: 4 / 3; }
    .thumb-strip-item { width: 70px; height: 48px; }
    .spec-item { padding: .6rem .7rem; gap: .55rem; }
}



/* ===== Mobile hero + hero search (kept AFTER the base hero styles so these win the cascade) ===== */
@media (max-width: 560px) {
    .hero { padding: 36px 0 44px; }
    .hero .container { gap: 15px; }
    .hero h1 { font-size: 1.5rem; }
    .hero p { font-size: .9rem; }

    .hero-search { max-width: 100%; margin-top: 6px; }
    .hero-search-tabs { gap: 4px; padding: 4px; }
    .hs-tab { padding: 8px 14px; font-size: .84rem; gap: 7px; }
    .hs-tab i { font-size: .8rem; }

    .hero-search-row { min-width: 0; }
    .hero-search-row input { flex: 1 1 auto; min-width: 0; padding: 12px 14px; font-size: .9rem; border-radius: 0 0 0 12px; }
    .hero-search-row button { flex: 0 0 auto; padding: 0 13px; font-size: .8rem; gap: 6px; border-radius: 0 0 12px 0; }
    .hero-results { font-size: .7rem; gap: 4px; }
}

/* Very narrow phones: icon-only button so the bar can never overflow */
@media (max-width: 360px) {
    .hero-results { display: none; }
    .hero-search-row button { padding: 0 13px; }
}