/* ==========================================================================
   Dealer theme – colors are set from the admin panel (Settings → Appearance)
   via the --primary / --dark / --accent variables in layout.php.
   Design styles (body.style-*) at the end of the file override the surface,
   font and shape variables below.
   ========================================================================== */

:root {
    --primary: #e11d2e;
    --dark: #0f172a;
    --accent: #f59e0b;
    --on-primary: #fff;
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #e2e8f0;
    --input-bg: var(--surface);
    --header-bg: var(--surface);
    --text: #1e293b;
    --heading: var(--dark);
    --muted: #64748b;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 8px;
    --btn-radius: var(--radius-sm);
    --btn-transform: none;
    --btn-spacing: normal;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 10px 40px rgba(15, 23, 42, .16);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-head: var(--font);
    --head-weight: 800;
    --head-spacing: -.02em;
    --head-transform: none;
    --container: 1240px;
}
.hero[style*="--hero-desktop"] { --hero-img: var(--hero-desktop); }
@media (max-width: 768px) {
    .hero[style*="--hero-desktop"] { --hero-img: var(--hero-mobile, var(--hero-desktop)); }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--heading); font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-spacing); text-transform: var(--head-transform); }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(22px, 2.6vw, 32px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.icon { flex-shrink: 0; vertical-align: middle; }
.icon.filled { fill: currentColor; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.captcha { margin: 0 0 12px; min-height: 65px; }
.captcha-external { min-width:0; min-height:0; width:100%; overflow:visible; }
.captcha-widget { transform-origin:top left; max-width:none; }
.captcha-widget iframe { display:block; }
.chat-start .captcha, .lead-form .captcha { margin: 0; }
.captcha-builtin { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 0; }
.captcha-builtin img { border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: #f4f6fa; width: 150px; height: auto; }
.captcha-question { font-weight: 700; font-size: 18px; padding: 6px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.captcha-refresh { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; color: inherit; }
.captcha-builtin input[name=captcha] { flex: 1 1 120px; min-width: 110px; text-transform: uppercase; letter-spacing: 2px; }
.chat-start .captcha-builtin img { width: 130px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: var(--btn-radius); border: 2px solid transparent;
    font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; text-decoration: none !important;
    text-transform: var(--btn-transform); letter-spacing: var(--btn-spacing);
    transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
    background: var(--surface-2); color: var(--heading); white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { filter: brightness(1.25); }
.btn-light { background: #fff; color: var(--dark); }
.btn-light:hover { background: #f1f5f9; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--heading); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline-light { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, .1); border-color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--heading); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; background: var(--surface-2); color: var(--heading); }
.badge-featured { background: var(--accent); color: #111; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-sold { background: #1e293b; color: #fff; }
.badge-certified { background: #dcfce7; color: #166534; }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 12px; font-weight: 500; transition: opacity .5s; }
.alert.fade { opacity: 0; pointer-events: none; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #0c4a6e; border: 1px solid #bae6fd; }
.flashes { padding-top: 20px; }

/* ---------- topbar & header ---------- */
.topbar { background: var(--dark); color: rgba(255, 255, 255, .75); font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 40px; }
.topbar-info, .topbar-social { display: flex; align-items: center; gap: 20px; }
.topbar span, .topbar a { display: inline-flex; align-items: center; gap: 6px; }
.topbar a { color: rgba(255, 255, 255, .75); }
.topbar a:hover { color: #fff; text-decoration: none; }

.header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); border-bottom: 1px solid var(--border); transition: box-shadow .2s; }
.header.scrolled { box-shadow: 0 4px 20px rgba(15, 23, 42, .08); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none !important; flex-shrink: 0; }
.logo img { max-height: 52px; width: auto; }
.logo-mark { width: 42px; height: 42px; border-radius: min(10px, var(--radius)); background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.logo-text { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.1; letter-spacing: var(--head-spacing); text-transform: var(--head-transform); }
.logo-text small { display: block; font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.logo-light { color: #fff; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 10px 14px; border-radius: var(--btn-radius); color: var(--heading); font-weight: 600; font-size: 15px; text-transform: var(--btn-transform); letter-spacing: var(--btn-spacing); }
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--primary); }
.nav-phone-mobile { display: none !important; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-phone { display: flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 700; text-decoration: none !important; }
.header-phone small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.header-phone-icon { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 12%, var(--surface)); color: var(--primary); display: grid; place-items: center; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--heading); }

/* ---------- hero ---------- */
.hero {
    position: relative; color: #fff; overflow: hidden;
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--dark) 94%, transparent) 0%, color-mix(in srgb, var(--dark) 70%, transparent) 55%, color-mix(in srgb, var(--dark) 35%, transparent) 100%),
        var(--hero-img, radial-gradient(circle at 80% 20%, color-mix(in srgb, var(--primary) 55%, var(--dark)) 0%, var(--dark) 60%)) center / cover no-repeat;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-top: 80px; padding-bottom: 80px; }
.hero h1 { color: #fff; font-size: clamp(34px, 5vw, 58px); margin-bottom: 16px; }
.hero p { font-size: 18px; color: rgba(255, 255, 255, .85); max-width: 560px; }
.hero-kicker { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); font-size: 14px; font-weight: 600; margin-bottom: 18px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.quick-search { background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-search label span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.quick-search .btn { grid-column: 1 / -1; padding: 14px; font-size: 16px; }

/* ---------- form controls ---------- */
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=password], select, textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg);
    transition: border-color .15s, box-shadow .15s; min-height: 46px;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select:disabled { opacity: .6; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--heading); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field-full, .form-grid .form-section { grid-column: 1 / -1; }
.form-grid > .check { margin-bottom: 20px; }
.form-grid > .check input { flex-shrink: 0; }
.form-section { font-size: 15px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.form-note { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.email-hint { display:block; margin-top:6px; font-size:13px; line-height:1.4; color:var(--muted); overflow-wrap:anywhere; }
.lead-form { display: grid; gap: 10px; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-tight { padding: 32px 0 64px; }
.section-alt { background: var(--surface); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.section-head h2 { margin: 0; }
.section-head-center { justify-content: center; text-align: center; }
.section-kicker { display: block; color: var(--primary); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

.quick-links { margin-top: -36px; position: relative; z-index: 2; }
.quick-links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.quick-link { display: flex; align-items: center; gap: 16px; padding: 22px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .2s; }
.quick-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.quick-link strong { display: block; color: var(--heading); font-size: 17px; }
.quick-link small { color: var(--muted); font-size: 14px; }
.quick-link-icon { width: 56px; height: 56px; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }

/* ---------- car cards ---------- */
.car-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.car-grid-3 { grid-template-columns: repeat(3, 1fr); }
.car-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.car-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.car-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.car-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.car-card:hover .car-card-media img { transform: scale(1.05); }
.car-card-badges { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 104px); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.car-card-badges .badge { max-width: 100%; padding: 3px 7px; font-size: 10px; line-height: 1.3; letter-spacing: .01em; overflow-wrap: anywhere; }
.car-card-badges .badge svg { width: 10px; height: 10px; flex-shrink: 0; }
.car-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.car-card-title { font-size: 17px; margin-bottom: 10px; }
.car-card-title a { color: var(--heading); }
.car-card-specs { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.car-card-specs li { display: flex; align-items: center; gap: 6px; }
.car-card-footer { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.car-card-price s { display: block; font-size: 13px; color: var(--muted); }
.car-card-price strong { display: block; font-size: 22px; color: var(--primary); line-height: 1.1; }
.car-card-price small { font-size: 12px; color: var(--muted); }

/* ---------- body styles ---------- */
.body-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.body-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--heading); text-decoration: none !important; transition: border-color .2s, transform .2s, background .2s; }
.body-tile:hover { border-color: var(--primary); background: var(--surface); transform: translateY(-3px); }
.body-tile img { width: 110px; height: 50px; object-fit: contain; }
.body-tile small { color: var(--muted); }

/* ---------- why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.why-item { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.why-icon { width: 60px; height: 60px; border-radius: var(--radius); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); margin-bottom: 18px; }
.why-item h3 { font-size: 18px; }
.why-item p { color: var(--muted); margin: 0; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--dark))); color: #fff; padding: 56px 0; }
.cta-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { margin: 0; color: rgba(255, 255, 255, .85); font-size: 17px; }
.cta-band-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- reviews ---------- */
.reviews-carousel { min-width: 0; max-width: 100%; }
.reviews-controls { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.reviews-controls[hidden] { display: none; }
.reviews-controls .btn { min-width: 44px; min-height: 44px; padding: 8px 14px; }
.reviews-controls .btn:disabled { opacity: .4; cursor: default; }
.reviews-grid { display: grid; grid-auto-flow: column; grid-auto-columns: min(340px, 85%); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 4px 2px 18px; scrollbar-width: thin; }
.reviews-grid > .review { min-width: 0; scroll-snap-align: start; overflow-wrap: anywhere; }
.reviews-grid .review-avatar { flex-shrink: 0; }
.reviews-grid:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }
.ex-reviews, .mk-side { min-width: 0; }
.review { margin: 0; background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.review-stars { color: var(--accent); display: flex; gap: 2px; margin-bottom: 14px; }
.review blockquote { margin: 0 0 20px; font-size: 16px; flex: 1; }
.review figcaption { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--heading); }
.review-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* ---------- about strip ---------- */
.about-strip { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.about-strip p { color: var(--muted); font-size: 17px; }
.about-contacts { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.about-contacts li { display: flex; gap: 14px; padding: 18px; background: var(--bg); border-radius: var(--radius); }
.about-contacts li > .icon { color: var(--primary); margin-top: 2px; }
.about-contacts small { display: block; color: var(--muted); font-size: 13px; }
.about-contacts a { color: var(--heading); font-weight: 600; }

/* ---------- page hero & breadcrumbs ---------- */
.page-hero { background: var(--dark); color: #fff; padding: 40px 0 44px; }
.page-hero-sm { padding: 28px 0 30px; }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero p { color: rgba(255, 255, 255, .8); margin: 10px 0 0; max-width: 680px; font-size: 17px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: inherit; }
.page-hero .breadcrumbs { color: rgba(255, 255, 255, .6); }

/* ---------- inventory ---------- */
.inventory-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: start; }
.filters { position: static; min-width: 0; }
.filters-form { background: var(--surface); padding: 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.filters-basic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 18px; }
.filters-basic .filter-keyword, .filters-basic > .field-row { grid-column: span 2; }
.filters-advanced { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; padding-top: 16px; }
.filters-basic .field, .filters-advanced .field { min-width: 0; margin-bottom: 0; }
.filters-more { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.filters-more summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.filters-actions { display: flex; gap: 12px; margin-top: 16px; }
.filters-actions .btn-block { width: auto; min-width: 160px; margin-top: 0; }
.filters-form .field { margin-bottom: 12px; }
.filters-form .field > span { font-size: 13px; color: var(--muted); }
.filters-form .btn-block { margin-top: 8px; }
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.filters-head h3 { margin: 0; }
.filters-close, .filters-toggle { display: none; }
.filters-close { background: none; border: 0; cursor: pointer; }
.filters-backdrop { display: none; }
.results-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.results-count { font-weight: 700; color: var(--heading); }
.sort-select { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.sort-select select { width: auto; min-width: 200px; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a, .pagination .dots { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 10px; border-radius: var(--btn-radius); background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: var(--shadow); text-decoration: none !important; }
.pagination .dots { background: none; box-shadow: none; }
.pagination a.active, .pagination a:hover { background: var(--primary); color: var(--on-primary); }
.empty-state { text-align: center; padding: 60px 20px; background: var(--surface); border-radius: var(--radius); color: var(--muted); }
.empty-state .icon { color: var(--border); margin-bottom: 12px; }
.empty-state-lg { background: none; }
.empty-state-lg .hero-buttons { justify-content: center; }
.big-code { display: block; font-size: 120px; font-weight: 800; line-height: 1; color: var(--primary); opacity: .15; }

/* ---------- vehicle page ---------- */
.car-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.car-head h1 { margin-bottom: 10px; }
.car-head-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.car-head-meta span { display: inline-flex; align-items: center; gap: 6px; }
.car-head-price { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.car-head-price s { display: block; color: var(--muted); }
.car-head-price strong { font-size: 36px; color: var(--primary); line-height: 1; }
.car-layout { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.car-main { min-width: 0; }

.gallery { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 24px; }
.gallery-main { position: relative; aspect-ratio: 16 / 10; background: #0b1220; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; cursor: zoom-in; }
.gallery-main img.active { opacity: 1; z-index: 1; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #0f172a; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); }
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 14px; }
.gallery-nav.next { right: 14px; }
.gallery-counter { position: absolute; right: 14px; bottom: 14px; z-index: 2; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; scrollbar-width: thin; }
.gallery-thumbs button { flex: 0 0 96px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; opacity: .6; background: none; transition: opacity .2s, border-color .2s; }
.gallery-thumbs button.active, .gallery-thumbs button:hover { opacity: 1; border-color: var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.key-specs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
.key-specs div { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.key-specs .icon { color: var(--primary); margin-bottom: 4px; }
.key-specs small { color: var(--muted); font-size: 12px; }
.key-specs strong { color: var(--heading); font-size: 15px; }

.panel { background: var(--surface); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); margin-bottom: 24px; }
.panel h2 { font-size: 22px; }
.panel-sticky { position: sticky; top: 96px; }
.spec-table { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 0; }
.spec-table div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.spec-table dt { color: var(--muted); }
.spec-table dd { margin: 0; font-weight: 600; color: var(--heading); text-align: right; word-break: break-word; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; }
.feature-list-1 { grid-template-columns: 1fr; }
.feature-list li { display: flex; align-items: center; gap: 10px; }
.feature-list .icon { color: #16a34a; background: #dcfce7; border-radius: 50%; padding: 3px; width: 22px; height: 22px; }
.prose { font-size: 16px; }
.prose img { border-radius: var(--radius-sm); height: auto; }
.prose h2 { margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--radius-sm); }

.side-price { text-align: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.side-price span { display: block; color: var(--muted); font-size: 14px; }
.side-price strong { display: block; font-size: 38px; color: var(--primary); line-height: 1.15; }
.side-price small { color: var(--muted); font-size: 13px; }
.side-old-price { display: block; color: var(--muted); margin: 6px 0; }
.side-price-drop { margin: 8px 0; }
.side-price .badge-drop { display: inline-flex; color: #fff; font-size: 12px; }
.side-actions { display: grid; gap: 10px; margin-bottom: 22px; }
.side-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.side-actions + .side-tools { margin-top: -12px; }
.side-tools .btn { justify-content: center; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.side-tools .btn.is-on { background: color-mix(in srgb, var(--primary) 12%, transparent); border-color: var(--primary); color: var(--primary); }
.side-tools .btn.is-on svg { fill: currentColor; }
.car-head-price .badge-drop { margin-top: 2px; font-size: 11px; padding: 4px 8px; }
.offer-panel { margin: 16px 0; }
.offer-panel summary { cursor: pointer; list-style: none; }
.offer-panel summary::-webkit-details-marker { display: none; }
.offer-panel .lead-form { margin-top: 14px; }

/* ---------- compare / saved / recently viewed ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.car-card { position: relative; }
.badge-drop { background: #16a34a; color: #fff; }
.card-tools { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 6px; }
.card-tool { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .92); color: #1e293b; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); transition: transform .15s, background .15s, color .15s; }
.card-tool:hover { transform: scale(1.08); }
.card-tool.is-on { background: var(--primary); color: var(--on-primary); }
.card-tool[data-fav].is-on svg { fill: currentColor; }
.tray { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 140; display: flex; gap: 10px; max-width: calc(100vw - 200px); }
.tray-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--dark, #0f172a); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); font-size: 14px; white-space: nowrap; min-height: 48px; }
a.tray-item { padding-right: 18px; }
a.tray-item:hover { color: #fff; filter: brightness(1.15); }
.tray-item b { background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 1px 8px; font-size: 13px; }
.tray-compare .btn.is-disabled { opacity: .55; pointer-events: none; }
.tray-clear { border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.tray-item[hidden], .tray[hidden] { display: none; }
body.has-tray .footer { padding-bottom: 90px; }
@media (min-width: 981px) { body.theme-garage .tray { margin-left: 132px; } }
@media (max-width: 720px) {
    .tray { left: 12px; right: 92px; transform: none; max-width: none; bottom: 16px; flex-wrap: wrap; }
    .tray-item span:not([data-tray-compare-n]) { display: none; }
}
.toast { position: fixed; left: 50%; top: 22px; transform: translate(-50%, -12px); z-index: 300; background: var(--dark, #0f172a); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 40px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.compare-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.compare-toolbar .check { align-items: center; color: var(--heading); font-weight: 600; }
.compare-toolbar .check input { margin-top: 0; }
.compare-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; table-layout: fixed; }
.compare-table th, .compare-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; font-size: 15px; }
.compare-table tbody th { width: 200px; color: var(--muted); font-weight: 600; font-size: 14px; }
.compare-table thead th:first-child { width: 200px; }
.compare-table tbody tr:hover td, .compare-table tbody tr:hover th { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.compare-table .cmp-group th { background: var(--surface-2); color: var(--heading); text-transform: uppercase; letter-spacing: .05em; font-size: 13px; }
.compare-table.diff-only tr[data-same] { display: none; }
.cmp-car { position: relative; display: grid; gap: 8px; align-content: start; }
.cmp-img { display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); }
.cmp-img img { width: 100%; height: 100%; object-fit: cover; }
.cmp-title { font-weight: 700; color: var(--heading); line-height: 1.3; }
.cmp-price strong { display: block; font-size: 22px; color: var(--primary); }
.cmp-price s { color: var(--muted); font-size: 14px; }
.cmp-price small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.cmp-car .badge { justify-self: start; }
.cmp-car .btn { justify-self: start; }
.cmp-remove { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: #1e293b; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.cmp-yes { color: #16a34a; }
@media (max-width: 760px) {
    .compare-toolbar { gap: 12px; }
    .compare-scroll { overflow: hidden; }
    .compare-table { display: block; min-width: 0; --compare-columns: 2; }
    .compare-table.compare-n1 { --compare-columns: 1; }
    .compare-table.compare-n3 { --compare-columns: 3; }
    .compare-table thead, .compare-table tbody { display: block; }
    .compare-table tr { display: grid; grid-template-columns: repeat(var(--compare-columns), minmax(0, 1fr)); }
    .compare-table thead th:first-child { display: none; }
    .compare-table th, .compare-table td { min-width: 0; width: auto; padding: 10px; font-size: 13px; overflow-wrap: anywhere; }
    .compare-table tbody th { grid-column: 1 / -1; width: auto; padding: 9px 12px 3px; border-bottom: 0; font-size: 12px; }
    .compare-table tbody td { padding: 6px 12px 12px; color: var(--heading); }
    .compare-table tbody td + td, .compare-table thead th + th + th { border-left: 1px solid var(--border); }
    .compare-table .cmp-group th { padding: 12px; font-size: 12px; }
    .cmp-car { gap: 6px; }
    .cmp-title { font-size: 13px; }
    .cmp-price strong { font-size: 18px; }
    .cmp-price small, .cmp-price s { font-size: 11px; }
    .cmp-car .btn { width: 100%; padding: 8px 4px; font-size: 12px; }
    .cmp-car .badge { font-size: 10px; padding: 3px 6px; }
    .cmp-remove { top: 4px; right: 4px; width: 32px; height: 32px; }
    .compare-table.compare-n3 th, .compare-table.compare-n3 td { padding-left: 8px; padding-right: 8px; }
    .compare-n3 .cmp-price strong { font-size: 16px; }
}
.saved-note { margin: 0 0 18px; }

.recent-list { display: grid; grid-auto-flow: column; grid-auto-columns: min(240px, 85%); justify-content: start; align-items: stretch; gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.recent-card { display: flex; flex-direction: column; min-width: 0; gap: 4px; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; overflow-wrap: anywhere; box-shadow: var(--shadow); padding-bottom: 12px; scroll-snap-align: start; color: var(--text); }
.recent-card img { flex: 0 0 auto; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 6px; }
.recent-title { flex: 1; font-weight: 700; color: var(--heading); padding: 0 12px; line-height: 1.3; font-size: 14px; }
.recent-meta { color: var(--muted); font-size: 13px; padding: 0 12px; }
.recent[hidden] { display: none; }

.vin-row { display: flex; gap: 8px; }
.vin-row input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
.vin-row .btn { white-space: nowrap; }
.vin-decoder > label > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--heading); }
.vin-result { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.vin-result.is-ok { color: #16a34a; font-weight: 600; }
.vin-result.is-error { color: #dc2626; }
@media (max-width: 600px) {
    .vin-row { flex-direction: column; }
    .vin-row .btn { align-self: flex-start; min-height: 44px; }
}
.tab-buttons { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 14px; }
.tab-buttons button { border: 0; background: none; padding: 9px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.tab-buttons button.active { background: var(--surface); color: var(--heading); box-shadow: var(--shadow); }

.calculator .field { margin-bottom: 12px; }
.calc-result { background: var(--bg); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.calc-result span { display: block; color: var(--muted); font-size: 14px; }
.calc-result strong { display: block; font-size: 30px; color: var(--heading); margin: 4px 0; }
.calc-result small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 23, .95); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox-close, .lightbox-nav { position: absolute; background: rgba(255, 255, 255, .1); border: 0; color: #fff; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .2); }
.lightbox-close { top: 20px; right: 20px; }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

/* ---------- financing, sell, contact ---------- */
.two-col { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.selected-car { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 20px; }
.steps ol { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 18px; }
.steps ol > li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 0 14px; }
.steps ol > li::before { content: counter(step); grid-row: span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; }
.steps li strong { color: var(--heading); }
.steps li span { color: var(--muted); font-size: 14px; }
.contact-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 4px; text-decoration: none !important; }
.contact-card .icon { color: var(--primary); margin-bottom: 8px; }
.contact-card small { color: var(--muted); }
.contact-card strong { color: var(--heading); font-size: 15px; word-break: break-word; }
.two-col .map-panel { padding: 0; overflow: hidden; min-height: 420px; }
.map-panel iframe { width: 100%; height: 100%; min-height: 480px; border: 0; display: block; }
.contact-cards + .two-col { grid-template-columns: 1fr 1fr; }

/* ---------- footer ---------- */
.footer { background: var(--dark); color: rgba(255, 255, 255, .7); padding-top: 64px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1.2fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer h4 { color: #fff; font-size: 16px; margin-bottom: 18px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a { color: rgba(255, 255, 255, .7); }
.footer a:hover { color: #fff; }
.footer-about p { margin: 18px 0; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.footer-social a:hover { background: var(--primary); color: var(--on-primary); }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .icon { margin-top: 3px; color: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 0; font-size: 14px; }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- chat widget ---------- */
.chat { position: fixed; right: 24px; bottom: 24px; z-index: 150; }
.chat-launcher { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 45%, transparent); display: grid; place-items: center; position: relative; transition: transform .2s; }
.chat-launcher:hover { transform: scale(1.06); }
.chat-launcher-close { display: none; }
.chat.is-open .chat-launcher-icon { display: none; }
.chat.is-open .chat-launcher-close { display: block; }
.chat-launcher::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary); animation: chat-pulse 2.4s infinite; }
.chat.is-open .chat-launcher::after { display: none; }
@keyframes chat-pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.chat-badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #111; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.chat-panel { position: absolute; right: 0; bottom: 80px; width: 370px; height: min(560px, calc(100vh - 130px)); background: var(--surface); border-radius: max(18px, var(--radius)); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: chat-in .2s ease-out; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--dark); color: #fff; }
.chat-header strong { display: block; font-size: 16px; }
.chat-header small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255, 255, 255, .7); }
.chat-header .dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.chat-header small.online .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex-shrink: 0; }
.chat-close { margin-left: auto; background: none; border: 0; color: #fff; cursor: pointer; opacity: .7; padding: 4px; }
.chat-close:hover { opacity: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 18px; background: var(--bg); display: flex; flex-direction: column; }
.chat-msg { display: flex; flex-direction: column; margin-bottom: 10px; max-width: 85%; }
.chat-msg-admin { align-self: flex-start; }
.chat-msg-visitor { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg-admin .chat-bubble { background: var(--surface); color: var(--text); border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.chat-msg-visitor .chat-bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.chat-time { font-size: 11px; color: var(--muted); margin-top: 3px; padding: 0 4px; }
.chat-start { padding: 14px; display: grid; gap: 8px; border-top: 1px solid var(--border); }
.chat-start input, .chat-start textarea { min-height: 40px; padding: 9px 12px; font-size: 14px; }
.chat-start textarea { min-height: 60px; }
.chat-input { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input textarea { min-height: 44px; max-height: 120px; resize: none; padding: 11px 14px; font-size: 14px; border-radius: 22px; }
.chat-input button { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
    .car-grid { grid-template-columns: repeat(3, 1fr); }
    .car-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .header-phone > span:last-child { display: none; }
    .key-specs { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
    .burger { display: block; }
    .nav { position: fixed; inset: 0 0 0 auto; width: min(320px, 85vw); flex-direction: column; background: var(--header-bg); padding: 90px 20px 20px; box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .25s; z-index: 60; }
    .nav a { padding: 14px; font-size: 17px; border-bottom: 1px solid var(--border); border-radius: 0; }
    .nav-phone-mobile { display: flex !important; align-items: center; gap: 8px; color: var(--primary) !important; }
    .nav { visibility: hidden; overflow-y: auto; }
    body.nav-open .nav { transform: none; visibility: visible; }
    body.nav-open .burger { position: relative; z-index: 70; }
    .header-actions { margin-left: auto; }
    .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 80px; gap: 32px; }
    .quick-links-grid { grid-template-columns: 1fr; }
    .inventory-layout, .car-layout, .two-col, .contact-cards + .two-col, .about-strip { grid-template-columns: 1fr; }
    .filters { position: fixed; inset: 0 auto 0 0; width: min(340px, 90vw); z-index: 120; transform: translateX(-100%); transition: transform .25s; top: 0; }
    .filters-form { height: 100%; max-height: none; border-radius: 0; overflow-y: auto; overscroll-behavior: contain; }
    .filters-basic, .filters-advanced { display: block; }
    .filters-basic .field, .filters-advanced .field { margin-bottom: 12px; }
    .filters-actions { flex-direction: column; }
    .filters-actions .btn-block { width: 100%; }
    body.filters-open { overflow: hidden; }
    body.filters-open .filters { transform: none; }
    body.filters-open .filters-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 110; }
    .filters-close, .filters-toggle { display: inline-flex; }
    .panel-sticky { position: static; }
    .contact-cards { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .hide-sm { display: none !important; }
    .topbar-info span:first-child { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
    .car-grid, .car-grid-3 { grid-template-columns: 1fr; }
    .section { padding: 52px 0; }
    .section-head { flex-direction: column; align-items: flex-start; }
    .section-head-center { align-items: center; }
    .quick-search, .form-grid, .spec-table { grid-template-columns: 1fr; }
    .key-specs { grid-template-columns: repeat(2, 1fr); }
    .car-head-price { text-align: left; align-items: flex-start; }
    .contact-cards, .footer-grid { grid-template-columns: 1fr; }
    .sort-select { margin-left: 0; width: 100%; }
    .sort-select select { flex: 1; min-width: 0; }
    .results-count { order: -1; width: 100%; }
    .logo-text small { display: none; }
    .chat { right: 16px; bottom: 16px; }
    .chat-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; bottom: 0; }
    .chat.is-open .chat-launcher { display: none; }
}

/* ==========================================================================
   Design styles – chosen in Settings → Appearance (body.style-<name>).
   Colors (--primary / --dark / --accent) stay editable on top of any style.
   ========================================================================== */

/* ---------- shared dark surfaces (Midnight, Luxury) ---------- */
body.scheme-dark { color-scheme: dark; }
body.scheme-dark .header.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, .45); }
body.scheme-dark .body-tile img { filter: invert(.92) hue-rotate(180deg); }
body.scheme-dark img[src*="no-photo.svg"] { filter: invert(.9) hue-rotate(180deg) brightness(.85); }
body.scheme-dark .alert-success { background: #0f2e1d; color: #bbf7d0; border-color: #166534; }
body.scheme-dark .alert-error { background: #3a1214; color: #fecaca; border-color: #7f1d1d; }
body.scheme-dark .alert-info { background: #0c2536; color: #bae6fd; border-color: #075985; }
body.scheme-dark .badge-pending { background: #3b2a0a; color: #fcd34d; }
body.scheme-dark .badge-certified { background: #0f2e1d; color: #86efac; }
body.scheme-dark .badge-sold { background: #000; }
body.scheme-dark .feature-list .icon { background: #0f2e1d; color: #4ade80; }
body.scheme-dark .btn-light { background: #fff; color: #111; }
body.scheme-dark .chat-msg-admin .chat-bubble { box-shadow: none; border: 1px solid var(--border); }

/* ---------- Midnight: dark mode ---------- */
body.style-midnight {
    --bg: #0b1120;
    --surface: #131b2c;
    --surface-2: #1e293b;
    --input-bg: #0f1627;
    --header-bg: #0f1627;
    --text: #cbd5e1;
    --heading: #f1f5f9;
    --muted: #94a3b8;
    --border: #243049;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 14px 44px rgba(0, 0, 0, .55);
}
body.style-midnight .car-card:hover, body.style-midnight .quick-link:hover { box-shadow: 0 14px 44px rgba(0, 0, 0, .55), 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }

/* ---------- Luxury: black & gold, serif headings, sharp corners ---------- */
body.style-luxury {
    --on-primary: #111;
    --bg: #0c0c0c;
    --surface: #151515;
    --surface-2: #222;
    --input-bg: #101010;
    --header-bg: #0a0a0a;
    --text: #d6d3cd;
    --heading: #f5f1e8;
    --muted: #9a958c;
    --border: #2b2925;
    --radius: 4px;
    --radius-sm: 2px;
    --btn-transform: uppercase;
    --btn-spacing: .12em;
    --shadow: 0 0 0 1px #242220;
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
    --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --head-weight: 700;
    --head-spacing: 0;
}
body.style-luxury .btn { font-size: 13px; font-weight: 600; }
body.style-luxury .btn-lg { font-size: 14px; }
body.style-luxury .section-kicker { letter-spacing: .25em; font-weight: 600; }
body.style-luxury .car-card-price strong, body.style-luxury .side-price strong, body.style-luxury .car-head-price strong { font-family: var(--font-head); }
body.style-luxury .hero-kicker { border-radius: 0; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; }
body.style-luxury .quick-link:hover, body.style-luxury .car-card:hover { box-shadow: 0 0 0 1px var(--primary), 0 18px 50px rgba(0, 0, 0, .6); }

/* ---------- Sport: condensed uppercase headings, bold, angular ---------- */
body.style-sport {
    --bg: #eceef1;
    --surface-2: #dde1e6;
    --radius: 6px;
    --radius-sm: 4px;
    --btn-transform: uppercase;
    --btn-spacing: .06em;
    --font-head: 'Oswald', 'Arial Narrow', Impact, sans-serif;
    --head-weight: 700;
    --head-spacing: .01em;
    --head-transform: uppercase;
}
body.style-sport .btn { font-weight: 800; }
body.style-sport .btn-primary { box-shadow: 4px 4px 0 color-mix(in srgb, var(--primary) 35%, var(--dark)); }
body.style-sport .btn-primary:hover { box-shadow: 6px 6px 0 color-mix(in srgb, var(--primary) 35%, var(--dark)); }
body.style-sport .section-kicker { font-family: var(--font-head); letter-spacing: .12em; }
body.style-sport .car-card { border-top: 4px solid var(--primary); }
body.style-sport .car-card-price strong, body.style-sport .side-price strong, body.style-sport .car-head-price strong { font-family: var(--font-head); font-weight: 700; }
body.style-sport .hero-kicker { border-radius: 2px; background: var(--primary); border-color: var(--primary); color: var(--on-primary); text-transform: uppercase; letter-spacing: .08em; }
body.style-sport .nav a.active { box-shadow: inset 0 -3px 0 var(--primary); border-radius: 0; }

/* ---------- Minimal: white, flat, thin borders ---------- */
body.style-minimal {
    --bg: #ffffff;
    --surface-2: #f1f3f5;
    --text: #222831;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 10px;
    --radius-sm: 8px;
    --shadow: 0 0 0 1px var(--border);
    --shadow-lg: 0 12px 32px rgba(17, 24, 39, .10), 0 0 0 1px var(--border);
    --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --head-weight: 700;
    --head-spacing: -.025em;
}
body.style-minimal .section-alt { background: #f7f8fa; }
body.style-minimal .quick-links { margin-top: 0; padding-top: 28px; }
body.style-minimal .car-card:hover, body.style-minimal .quick-link:hover { transform: none; }
body.style-minimal .why-icon { background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); }
body.style-minimal .btn-primary:hover { box-shadow: none; filter: brightness(1.12); }

/* ---------- Soft: rounded, friendly ---------- */
body.style-soft {
    --bg: #f6f4fb;
    --surface-2: #ece8f6;
    --text: #2a2540;
    --muted: #6e6886;
    --border: #e6e1f2;
    --radius: 24px;
    --radius-sm: 14px;
    --btn-radius: 999px;
    --shadow: 0 2px 6px rgba(60, 40, 120, .05), 0 10px 30px rgba(60, 40, 120, .07);
    --shadow-lg: 0 18px 50px rgba(60, 40, 120, .16);
    --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --head-weight: 800;
    --head-spacing: -.01em;
}
body.style-soft .why-icon, body.style-soft .quick-link-icon { border-radius: 50%; }
body.style-soft .car-card-media { margin: 10px 10px 0; border-radius: calc(var(--radius) - 8px); }
body.style-soft .cta-band { margin: 0 20px; border-radius: var(--radius); }
body.style-soft .tab-buttons, body.style-soft .tab-buttons button { border-radius: 999px; }

/* ---------- Carbon: graphite and neon, technical ---------- */
body.style-carbon {
    --on-primary: #0a0c0f;
    --bg: #111418;
    --surface: #1a1e24;
    --surface-2: #262b33;
    --input-bg: #14171c;
    --header-bg: #0d1013;
    --text: #c9ced6;
    --heading: #f3f5f7;
    --muted: #8b939f;
    --border: #2a3039;
    --radius: 6px;
    --radius-sm: 3px;
    --btn-transform: uppercase;
    --btn-spacing: .08em;
    --shadow: 0 0 0 1px #242a32;
    --shadow-lg: 0 16px 44px rgba(0, 0, 0, .6);
    --font-head: 'Rajdhani', 'Arial Narrow', sans-serif;
    --head-weight: 700;
    --head-spacing: .02em;
    --head-transform: uppercase;
}
body.style-carbon { background-image: linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px); background-size: 32px 32px; }
body.style-carbon .btn { font-weight: 700; }
body.style-carbon .btn-primary { box-shadow: 0 0 0 1px var(--primary), 0 0 22px color-mix(in srgb, var(--primary) 35%, transparent); }
body.style-carbon .btn-primary:hover { box-shadow: 0 0 0 1px var(--primary), 0 0 30px color-mix(in srgb, var(--primary) 55%, transparent); }
body.style-carbon .section-kicker { font-family: var(--font-head); letter-spacing: .2em; }
body.style-carbon .car-card-price strong, body.style-carbon .side-price strong, body.style-carbon .car-head-price strong { font-family: var(--font-head); font-weight: 700; text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 45%, transparent); }
body.style-carbon .car-card { border-bottom: 2px solid transparent; }
body.style-carbon .car-card:hover { border-bottom-color: var(--primary); box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 50%, transparent), 0 16px 44px rgba(0, 0, 0, .6); }
body.style-carbon .hero-kicker { border-radius: 2px; border-color: var(--primary); color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
body.style-carbon .nav a.active { color: var(--primary); }
body.style-carbon .badge-featured { background: var(--primary); color: var(--on-primary); }

/* ---------- Heritage: cream, serif, framed ---------- */
body.style-heritage {
    --bg: #f5efe3;
    --surface: #fffdf8;
    --surface-2: #ebe3d3;
    --header-bg: #fffdf8;
    --text: #3a352c;
    --heading: #2b2a22;
    --muted: #7b7263;
    --border: #e2d8c5;
    --radius: 6px;
    --radius-sm: 4px;
    --shadow: 0 0 0 1px var(--border), 0 6px 18px rgba(80, 60, 20, .06);
    --shadow-lg: 0 0 0 1px var(--border), 0 18px 44px rgba(80, 60, 20, .14);
    --font: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-head: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    --head-weight: 400;
    --head-spacing: 0;
}
body.style-heritage .section-kicker { font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 16px; font-family: var(--font-head); color: var(--accent); }
body.style-heritage .car-card { outline: 1px solid var(--border); outline-offset: -7px; }
body.style-heritage .car-card-media { margin: 8px 8px 0; border-radius: 3px; }
body.style-heritage .car-card:hover { transform: none; }
body.style-heritage .car-card-price strong, body.style-heritage .side-price strong, body.style-heritage .car-head-price strong { font-family: var(--font-head); font-weight: 400; }
body.style-heritage .btn { font-weight: 700; letter-spacing: .03em; }
body.style-heritage .hero-kicker { font-family: var(--font-head); font-style: italic; font-weight: 400; font-size: 16px; }
body.style-heritage .why-icon { background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: 50%; }
/* Full-screen vehicle photo detail viewer */
.gallery-expand { position:absolute; left:14px; bottom:14px; z-index:2; border:1px solid #ffffff66; border-radius:8px; padding:8px 12px; background:#0b1220d9; color:#fff; cursor:zoom-in; font:inherit; font-size:13px; }
.gallery-main img:not(.active) { pointer-events:none; }
dialog.lightbox { width:100vw; height:100dvh; max-width:none; max-height:none; margin:0; padding:0; border:0; color:#fff; overflow:hidden; background:#080d17; }
.lightbox::backdrop { background:#080d17; }
.lightbox-stage { position:absolute; inset:80px 76px 55px; overflow:hidden; touch-action:none; user-select:none; cursor:zoom-in; }
.lightbox-stage.zoomed { cursor:grab; }
.lightbox-stage.zoomed:active { cursor:grabbing; }
.lightbox .lightbox-stage img { width:100%; height:100%; max-width:none; max-height:none; object-fit:contain; transform-origin:center; pointer-events:none; }
.lightbox-stage.is-loading img, .lightbox-stage.has-error img { visibility: hidden; }
.lightbox-status { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; flex-direction: column; gap: 16px; padding: 24px; text-align: center; color: #cbd5e1; pointer-events: none; }
.lightbox-stage.is-loading .lightbox-status, .lightbox-stage.has-error .lightbox-status { display: flex; }
.lightbox-stage.is-loading .lightbox-status::before { content: ''; width: 36px; height: 36px; border: 3px solid #ffffff30; border-top-color: #fff; border-radius: 50%; animation: photo-loading 1s linear infinite; }
@keyframes photo-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lightbox-stage.is-loading .lightbox-status::before { animation: none; } }
.lightbox-toolbar { position:absolute; top:16px; left:20px; right:90px; display:flex; gap:8px; align-items:center; z-index:2; }
.lightbox-toolbar span { margin-right:12px; font-variant-numeric:tabular-nums; }
.lightbox-toolbar button { min-width:44px; height:44px; padding:0 10px; border:1px solid #ffffff44; border-radius:8px; background:#ffffff14; color:#fff; font:inherit; cursor:pointer; }
.lightbox-toolbar button:disabled { opacity:.4; cursor:default; }
.lightbox button:focus-visible { outline:3px solid #fff; outline-offset:3px; }
.lightbox-close, .lightbox-nav { z-index:3; }
.lightbox-nav { top:50%; transform:translateY(-50%); }
.lightbox-help { position:absolute; bottom:12px; left:12px; right:12px; margin:0; text-align:center; font-size:12px; color:#cbd5e1; pointer-events:none; }
@media (max-width:600px) {
    .lightbox-stage { inset:76px 0 90px; }
    .lightbox-close { width:44px; height:44px; top:16px; right:12px; }
    .lightbox-toolbar { left:12px; right:64px; gap:5px; }
    .lightbox-toolbar span { margin-right:4px; font-size:13px; }
    .lightbox-nav { top:auto; bottom:36px; transform:none; width:44px; height:44px; }
    .lightbox-nav.prev { left:calc(50% - 54px); }
    .lightbox-nav.next { right:calc(50% - 54px); }
    .lightbox-help { font-size:10px; bottom:12px; }
}
/* Keep vehicle actions and contact forms reachable independently of long descriptions. */
.car-page-tools { margin:0 0 20px; display:flex; flex-wrap:wrap; gap:8px; }
.car-layout { grid-template-columns:minmax(0,1fr) 380px; grid-template-areas:"main contact"; }
.car-main { display:block; grid-area:main; min-width:0; }
.car-main > .gallery { grid-area:photos; min-width:0; margin-bottom:28px; }
.car-details { grid-area:details; min-width:0; }
.car-side { grid-area:contact; min-width:0; }
.car-contact-panel { position:static; }
.car-side .captcha-builtin { display:grid; grid-template-columns:minmax(0,1fr) 38px; }
.car-side .captcha-builtin input[name=captcha] { grid-column:1 / -1; width:100%; min-width:0; }
.car-side .captcha-builtin img { max-width:100%; }
.cmp-price-placeholder { visibility:hidden; }
.cmp-price s { display:block; min-height:1.5em; }
.cmp-price small { min-height:1.5em; }
.cmp-status { min-width:0; }
@media (max-width:1000px) {
    .car-layout { grid-template-columns:minmax(0,1fr); grid-template-areas:"photos" "contact" "details"; }
    .car-main { display:contents; }
    .car-main > .gallery { margin-bottom:0; }
    .car-page-tools .btn { flex:1 1 auto; }
}

/* Contact controls share one form; hide floating tools while entering data. */
.vehicle-request .tab-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.vehicle-request .tab-buttons button { padding:10px 5px; font-size:12px; white-space:normal; }
.vehicle-request [hidden] { display:none!important; }
.vehicle-request .field-row > label { min-width:0; flex:1; }
@media(max-width:760px) {
 .header-inner { gap:10px; }
 .header-inner .logo { min-width:0; flex-shrink:1; }
 .header-inner .logo-text { min-width:0; overflow-wrap:anywhere; }
 .header-inner .logo-mark,.header-actions { flex-shrink:0; }
 .header-inner .logo img { max-width:min(180px,45vw); object-fit:contain; }
 body.editing-contact .tray,body.editing-contact .chat:not(.is-open),body.contact-visible .tray,body.contact-visible .chat:not(.is-open) { visibility:hidden; pointer-events:none; }
 body:has([data-compare-page]) .tray { position:static; transform:none; margin:16px; max-width:none; justify-content:center; }
 .vehicle-request input,.vehicle-request select,.vehicle-request textarea { font-size:16px; }
}
@media(max-width:360px) {
 .header-inner .logo-text { font-size:15px; }
 .header-inner .logo-mark { width:32px; height:32px; }
 .header-actions { gap:6px; }
}

/* Keep narrow forms usable independently of the floating shortcuts. */
@media(max-width:760px) {
    .chat-start { max-height:70dvh; overflow-y:auto; }
    .chat-body { min-height:0; }
    .form-grid > *, .captcha { min-width:0; }
    .captcha { max-width:100%; }
}
@media(max-width:720px) {
    .tray { bottom:max(16px, env(safe-area-inset-bottom)); }
    .tray-compare { gap:6px; padding:6px 8px; }
    .tray-compare > .icon { display:none; }
    .tray-compare .btn { padding:8px; font-size:12px; }
    .tray-clear { width:28px; height:28px; flex-shrink:0; }
}
@media(max-width:980px) {
    .theme-garage .gr-side > .logo { flex:1; min-width:0; }
    .theme-garage .gr-side .logo-text { font-size:16px; min-width:0; overflow-wrap:anywhere; }
    .theme-garage .gr-side .logo img { max-width:min(180px, 45vw); }
}

.footer-policy-links{display:flex;flex-wrap:wrap;gap:12px 20px}.footer-bottom-inner{flex-wrap:wrap;gap:16px}.cmp-unspecified{font-size:.8em}.compare-note{max-width:80ch;margin-bottom:20px}.card-price-note{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-bottom:3px}.badge-on_request{background:#eef2ff;color:#334155}

.form-privacy-note { display:block; line-height:1.6; }
.form-privacy-note a { display:inline; }
