/* ==========================================================================
   AutoVista — Showroom Crimson theme (public)
   Crimson #E11D2A + Graphite #14171C on warm white #FAF8F6.
   Sora (display) + Inter (body) + Hind Siliguri (Bangla).
   ========================================================================== */

:root {
    --cs-primary: #E11D2A;
    --cs-primary-dark: #B3141F;
    --cs-ink: #14171C;
    --cs-ink-soft: #2A2F37;
    --cs-bg: #FAF8F6;
    --cs-surface: #FFFFFF;
    --cs-soft: #F4F0EC;
    --cs-muted: #6B7280;
    --cs-line: #ECE7E3;
    --cs-accent: #14171C;
    --cs-gold: #C9A227;
    --cs-success: #1E9E5A;
    --cs-shadow: 0 10px 30px rgba(20,23,28,.08);
    --cs-shadow-lg: 0 18px 50px rgba(20,23,28,.14);
    --cs-radius: 14px;

    /* Backward-compat aliases for ported partials that still use --re-* */
    --re-primary: var(--cs-primary);
    --re-accent: var(--cs-gold);
    --re-dark: var(--cs-ink);
    --re-muted: var(--cs-muted);
    --re-line: var(--cs-line);

    --serif: 'Sora', 'Inter', system-ui, sans-serif;
    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bengali: 'Hind Siliguri', 'Noto Sans Bengali', var(--sans);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--cs-ink);
    background: var(--cs-bg);
    line-height: 1.65;
    overflow-x: clip; /* §31 safety net — clip, not hidden (keeps sticky header) */
}

:lang(bn), .bn { font-family: var(--bengali); }

h1, h2, h3, h4, h5, .display-head { font-family: var(--serif); font-weight: 700; line-height: 1.15; color: var(--cs-ink); }
a { color: var(--cs-primary); text-decoration: none; }
a:hover { color: var(--cs-primary-dark); }
img { max-width: 100%; height: auto; }
svg, video, iframe { max-width: 100%; }
table { max-width: 100%; }
.container, .container-fluid { overflow-wrap: break-word; }
h1, h2, h3, h4, p, a, span, li { overflow-wrap: break-word; }
.text-primary { color: var(--cs-primary) !important; }

/* ---------- Buttons ---------- */
.btn-cta, .btn-primary {
    background: var(--cs-primary); border: 1px solid var(--cs-primary);
    color: #fff; font-weight: 600; border-radius: 999px; padding: .6rem 1.4rem;
    transition: transform .18s ease, box-shadow .2s ease, background .2s ease;
}
.btn-cta:hover, .btn-primary:hover { background: var(--cs-primary-dark); border-color: var(--cs-primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(225,29,42,.28); }
.btn-ink { background: var(--cs-ink); border: 1px solid var(--cs-ink); color: #fff; font-weight: 600; border-radius: 999px; padding: .6rem 1.4rem; }
.btn-ink:hover { background: #000; color: #fff; }
.btn-outline-ink { background: transparent; border: 1.5px solid var(--cs-ink); color: var(--cs-ink); font-weight: 600; border-radius: 999px; padding: .55rem 1.3rem; }
.btn-outline-ink:hover { background: var(--cs-ink); color: #fff; }
.btn-accent { background: var(--cs-gold); border-color: var(--cs-gold); color: var(--cs-ink); font-weight: 600; border-radius: 999px; }
.btn-accent:hover { filter: brightness(.95); color: var(--cs-ink); }

/* ---------- Topbar (light) ---------- */
.topbar { background: var(--cs-soft); color: var(--cs-muted); font-size: .82rem; padding: .45rem 0; border-bottom: 1px solid var(--cs-line); }
.topbar a { color: var(--cs-muted); }
.topbar a:hover { color: var(--cs-primary); }

/* ---------- Header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 1020; background: rgba(255,255,255,.92); backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--cs-line); transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(20,23,28,.08); }
.navbar { padding: .55rem 0; }
.navbar-brand { font-family: var(--serif); font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color: var(--cs-ink); min-width: 0; display: flex; align-items: center; gap: .5rem; }
.navbar-brand .brand-mark { color: var(--cs-primary); font-size: 1.6rem; line-height: 1; }
.navbar-brand .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 150px); }
.navbar .nav-link { color: var(--cs-ink-soft); font-weight: 500; padding: .5rem .85rem; position: relative; }
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--cs-primary); }
.navbar .nav-link::after { content: ""; position: absolute; left: .85rem; right: .85rem; bottom: .25rem; height: 2px; background: var(--cs-primary); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
.navbar .nav-link:hover::after, .navbar .nav-link.active::after { transform: scaleX(1); }

/* ---------- Hero (light split) ---------- */
.hero { position: relative; background: linear-gradient(135deg, var(--cs-surface) 0%, var(--cs-soft) 58%, rgba(225,29,42,.06) 100%); color: var(--cs-ink); overflow: hidden; padding: 3.5rem 0 4rem; }
.hero-inner { position: relative; z-index: 2; }
.hero h1 { color: var(--cs-ink); font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -.02em; }
.hero .lead { color: var(--cs-muted); font-size: clamp(1rem, 1.5vw, 1.2rem); max-width: 560px; }
.hero .eyebrow { color: var(--cs-primary); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.hero-media { position: relative; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; box-shadow: var(--cs-shadow-lg); background: var(--cs-soft); }
.hero-slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.1s ease; }
.hero-slide.active { opacity: 1; animation: kenburns 16s ease-out forwards; }
@keyframes kenburns { from { transform: scale(1.001); } to { transform: scale(1.08); } }
.hero-badge { position: absolute; left: 1rem; bottom: 1rem; z-index: 3; background: rgba(255,255,255,.95); color: var(--cs-ink); border-radius: 999px; padding: .45rem 1rem; font-weight: 600; font-size: .85rem; box-shadow: var(--cs-shadow); }
.hero-badge i { color: var(--cs-primary); }
@media (max-width: 991.98px) { .hero-media { aspect-ratio: 16 / 10; margin-top: 1.5rem; } }

/* ---------- Quick search bar ---------- */
.quick-search { background: var(--cs-surface); border-radius: var(--cs-radius); box-shadow: var(--cs-shadow-lg); padding: 1rem; }
.quick-search .form-select, .quick-search .form-control { border-radius: 10px; }

/* ---------- Crimson underline motif ---------- */
.cs-underline { position: relative; display: inline-block; }
.cs-underline::after { content: ""; position: absolute; left: 0; bottom: -10px; height: 4px; width: 64px; border-radius: 4px; background: linear-gradient(90deg, var(--cs-primary), var(--cs-gold)); }
.section-head { margin-bottom: 2.2rem; }
.section-head .eyebrow { color: var(--cs-primary); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; }

/* ---------- Sections ---------- */
.section { padding: 76px 0; }
.section.alt { background: var(--cs-soft); }
/* "ink" sections are now LIGHT — a soft cream band with a crimson hairline top/bottom. */
.section.ink { background: linear-gradient(180deg, var(--cs-surface) 0%, var(--cs-soft) 100%); color: var(--cs-ink); border-top: 1px solid var(--cs-line); border-bottom: 1px solid var(--cs-line); }
.section.ink h1, .section.ink h2, .section.ink h3 { color: var(--cs-ink); }
/* keep older white-text markup readable on the now-light bands */
.section.ink .text-white, .page-hero .text-white { color: var(--cs-ink) !important; }
.section.ink .text-white-50, .page-hero .text-white-50 { color: var(--cs-muted) !important; }
.section.ink .btn-outline-light, .page-hero .btn-outline-light { border-color: var(--cs-ink); color: var(--cs-ink); background: transparent; }
.section.ink .btn-outline-light:hover, .page-hero .btn-outline-light:hover { background: var(--cs-ink); color: #fff; }

/* ---------- Car cards ---------- */
.car-card { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: var(--cs-radius); overflow: hidden; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; display: flex; flex-direction: column; }
.car-card:hover { transform: translateY(-6px); box-shadow: var(--cs-shadow-lg); border-color: rgba(225,29,42,.4); }
.car-card .media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cs-soft); }
.car-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.car-card:hover .media img { transform: scale(1.07); }
.car-card .badges { position: absolute; top: .6rem; left: .6rem; display: flex; gap: .35rem; flex-wrap: wrap; z-index: 2; }
.car-card .fav-btn { position: absolute; top: .6rem; right: .6rem; z-index: 3; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.92); border: none; display: grid; place-items: center; color: var(--cs-ink); cursor: pointer; }
.car-card .fav-btn.is-active, .car-card .fav-btn:hover { color: var(--cs-primary); }
.car-card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.car-card .title { font-family: var(--serif); font-weight: 700; font-size: 1.08rem; margin: 0; line-height: 1.25; }
.car-card .title a { color: var(--cs-ink); }
.car-card .title a:hover { color: var(--cs-primary); }
.car-card .meta { color: var(--cs-muted); font-size: .85rem; }
.price-tag { font-family: var(--serif); font-weight: 800; color: var(--cs-primary); font-size: 1.25rem; }
.price-old { color: var(--cs-muted); text-decoration: line-through; font-size: .9rem; margin-left: .4rem; }

/* spec chips */
.spec-row { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--cs-ink-soft); font-size: .82rem; }
.spec-chip { display: inline-flex; align-items: center; gap: .3rem; }
.spec-chip i { color: var(--cs-primary); }
.spec-pill { display: inline-flex; align-items: center; gap: .35rem; background: var(--cs-soft); border: 1px solid var(--cs-line); border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; }

.badge-soft { background: rgba(225,29,42,.1); color: var(--cs-primary); font-weight: 600; }

/* ---------- Tiles (body type / brand) ---------- */
.tile { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: var(--cs-radius); padding: 1.3rem 1rem; text-align: center; transition: transform .25s ease, box-shadow .25s ease; display: block; color: var(--cs-ink); }
.tile:hover { transform: translateY(-5px); box-shadow: var(--cs-shadow); color: var(--cs-primary); }
.tile .ic { font-size: 2.1rem; color: var(--cs-primary); }
.tile .t { font-weight: 600; margin-top: .5rem; font-size: .98rem; }
.tile .c { color: var(--cs-muted); font-size: .82rem; }
.brand-tile img { max-height: 46px; object-fit: contain; filter: grayscale(1); opacity: .8; transition: .25s; }
.brand-tile:hover img { filter: none; opacity: 1; }

/* ---------- Stat tiles (odometer) ---------- */
.stat-tile { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: var(--cs-radius); padding: 1.6rem 1rem; text-align: center; }
.stat-tile .stat-num { font-family: var(--serif); font-weight: 800; font-size: 2.4rem; color: var(--cs-primary); letter-spacing: -.02em; }
.stat-tile .stat-label { color: var(--cs-muted); font-size: .9rem; }
.section.ink .stat-tile { background: var(--cs-surface); border-color: var(--cs-line); box-shadow: var(--cs-shadow); }
.section.ink .stat-tile .stat-label { color: var(--cs-muted); }

/* ---------- Filter card ---------- */
.filter-card { background: var(--cs-surface); border: 1px solid var(--cs-line); border-radius: var(--cs-radius); padding: 1.1rem; box-shadow: var(--cs-shadow); }
.filter-card .form-label { font-size: .82rem; font-weight: 600; color: var(--cs-ink-soft); margin-bottom: .25rem; }

/* ---------- Page hero (interior pages) — LIGHT ---------- */
.page-hero { background: linear-gradient(180deg, var(--cs-surface) 0%, var(--cs-soft) 100%); color: var(--cs-ink); padding: 3rem 0; border-bottom: 1px solid var(--cs-line); position: relative; }
.page-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cs-primary); }
.page-hero h1 { color: var(--cs-ink); font-size: clamp(1.6rem, 4vw, 2.6rem); }
.page-hero .crumbs { color: var(--cs-muted); font-size: .85rem; }
.page-hero .crumbs a { color: var(--cs-primary); }

/* ---------- Detail page ---------- */
.detail-gallery .main-img { aspect-ratio: 16 / 10; border-radius: var(--cs-radius); overflow: hidden; background: var(--cs-soft); }
.detail-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-thumbs img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.detail-thumbs img.active { border-color: var(--cs-primary); }
.key-spec { background: var(--cs-soft); border: 1px solid var(--cs-line); border-radius: 12px; padding: .8rem; text-align: center; }
.key-spec .ic { color: var(--cs-primary); font-size: 1.4rem; }
.key-spec .v { font-weight: 700; }
.key-spec .l { color: var(--cs-muted); font-size: .78rem; }
.spec-table th { color: var(--cs-muted); font-weight: 500; width: 45%; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: var(--cs-line); border-radius: 10px; }
.form-control:focus, .form-select:focus { border-color: var(--cs-primary); box-shadow: 0 0 0 .2rem rgba(225,29,42,.15); }

/* ---------- Footer ---------- */
.site-footer { background: var(--cs-soft); color: var(--cs-muted); padding: 56px 0 24px; border-top: 4px solid var(--cs-primary); }
.site-footer h5 { color: var(--cs-ink); font-size: 1rem; margin-bottom: 1rem; }
.site-footer p { color: var(--cs-muted); }
.site-footer a { color: var(--cs-muted); }
.site-footer a:hover { color: var(--cs-primary); }
.site-footer .footer-bottom { border-top: 1px solid var(--cs-line); margin-top: 2.2rem; padding-top: 1.2rem; font-size: .85rem; }
.dev-credit { color: var(--cs-primary) !important; font-weight: 600; }

/* ---------- Floating actions + back to top ---------- */
.float-actions { position: fixed; right: 18px; bottom: 18px; z-index: 1030; display: flex; flex-direction: column; gap: .6rem; }
.float-actions a { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.3rem; box-shadow: var(--cs-shadow); transition: transform .2s ease; }
.float-actions a:hover { transform: translateY(-3px); color: #fff; }
.fa-whatsapp { background: #25D366; }
.fa-call { background: var(--cs-primary); }
.back-to-top { position: fixed; left: 18px; bottom: 18px; z-index: 1030; width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--cs-ink); color: #fff; display: none; place-items: center; cursor: pointer; box-shadow: var(--cs-shadow); }
.back-to-top.show { display: grid; }

/* ---------- Compare bar (light) ---------- */
.compare-bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--cs-surface); color: var(--cs-ink); padding: .7rem 0; z-index: 1029; transform: translateY(110%); transition: transform .3s ease; border-top: 1px solid var(--cs-line); box-shadow: 0 -8px 24px rgba(20,23,28,.1); }
.compare-bar.show { transform: translateY(0); }
.compare-bar .btn-outline-light { border-color: var(--cs-ink); color: var(--cs-ink); }
.compare-bar .btn-outline-light:hover { background: var(--cs-ink); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) { .row.g-5, .row.gx-5 { --bs-gutter-x: 1.5rem; } }
@media (max-width: 991.98px) {
    .section { padding: 56px 0; }
    .hero { min-height: 72vh; }
}
@media (max-width: 767px) {
    .section, .page-hero { padding: 40px 0; }
    .navbar-brand { font-size: 1.15rem; }
    .stat-tile .stat-num { font-size: 1.9rem; }
}
