/* ===== بنگاه ماشین — Marketplace (Bama-inspired UX patterns) ===== */
:root, [data-theme="light"] {
  --bg: #f5f7fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-alt: #eef1f6;
  --text: #1a2332;
  --text-muted: #5c6b7a;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: var(--brand-accent-light, #1565c0);
  --accent-hover: #0d47a1;
  --accent-soft: rgba(21, 101, 192, 0.08);
  --accent-glow: rgba(21, 101, 192, 0.22);
  --primary: var(--brand-primary-light, #1a2332);
  --whatsapp: #128c7e;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
  --header-bg: rgba(255, 255, 255, 0.96);
  --shadow: 0 1px 2px rgba(26,35,50,.04), 0 4px 16px rgba(26,35,50,.06);
  --shadow-lg: 0 4px 8px rgba(26,35,50,.05), 0 16px 40px rgba(26,35,50,.1);
  --shadow-card: 0 1px 3px rgba(26,35,50,.06), 0 1px 2px rgba(26,35,50,.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: Vazirmatn, Tahoma, sans-serif;
  --space: 8px;
  --hero-grad: linear-gradient(160deg, #0b3d91 0%, #1565c0 42%, #1a2332 100%);
  --placeholder-grad: linear-gradient(155deg, hsl(var(--hue, 210), 22%, 42%), hsl(calc(var(--hue, 210) + 20), 20%, 55%));
  --glass: #ffffff;
  --glass-border: #e2e8f0;
  --mesh-1: rgba(255,255,255,.12);
  --mesh-2: rgba(21,101,192,.25);
  --orb-1: transparent;
  --orb-2: transparent;
  --orb-3: transparent;
  --ease-out: cubic-bezier(.22,1,.36,1);
  --ring: 0 0 0 3px var(--accent-soft);
  --price-color: #c62828;
}

[data-theme="dark"] {
  --bg: #0b0f16;
  --bg-elevated: #121826;
  --bg-card: #141b2a;
  --bg-card-solid: #141b2a;
  --bg-alt: #0e1420;
  --text: #f0f3f8;
  --text-muted: #8b95a8;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.16);
  --accent: var(--brand-accent, #d4af37);
  --accent-hover: #e8c547;
  --accent-soft: rgba(212, 175, 55, 0.1);
  --accent-glow: rgba(212, 175, 55, 0.3);
  --primary: var(--brand-primary, #0b0f1a);
  --whatsapp: #25d366;
  --danger: #ef4444;
  --success: #22c55e;
  --warn: #f59e0b;
  --header-bg: rgba(11, 15, 22, 0.94);
  --shadow: 0 4px 6px rgba(0,0,0,.25), 0 12px 32px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.45);
  --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.3);
  --hero-grad: linear-gradient(165deg, #05080f 0%, #0e1526 50%, #080e1a 100%);
  --placeholder-grad: linear-gradient(155deg, hsl(var(--hue, 220), 22%, 14%), hsl(calc(var(--hue, 220) + 30), 24%, 22%));
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --mesh-1: rgba(212,175,55,.18);
  --mesh-2: rgba(59,130,246,.12);
  --price-color: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Force Vazirmatn site-wide (public + panel via main.css); Tahoma fallback */
html, body, * {
  font-family: Vazirmatn, Tahoma, sans-serif !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Persian digits: Vazirmatn supplies Arabic-Indic glyphs; do not fall back to system numeric fonts */
  font-variant-numeric: normal;
}
a { color: var(--accent); text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, .form-control:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
img { max-width: 100%; display: block; }
.container { width: min(1200px, 94%); margin-inline: auto; }
.accent { color: var(--accent); }
.muted { color: var(--text-muted); }

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.text-4xl { font-size: clamp(2rem, 5vw, 3.25rem); }

/* ===== Header — clean marketplace ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: calc(var(--space) * 2); padding: .85rem 0;
}
.logo {
  display: flex; align-items: center; gap: .65rem;
  color: var(--text); font-weight: 800; font-size: 1.05rem;
}
.logo:hover { color: var(--accent); }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #fff; display: grid; place-items: center; font-size: .9rem;
  box-shadow: 0 2px 10px var(--accent-glow);
}
[data-theme="dark"] .logo-icon { color: #0b0f1a; }
.logo-icon svg { display: block; }
.logo-img { height: 34px; width: auto; border-radius: 6px; }
.logo-text { white-space: nowrap; }
.main-nav { display: flex; gap: 0.05rem; flex-wrap: wrap; align-items: center; }
.main-nav a {
  color: var(--text-muted); font-size: .86rem; font-weight: 600;
  padding: .4rem .7rem; border-radius: 8px; transition: .15s;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent); background: var(--accent-soft);
}
.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-phone {
  color: var(--text); font-size: .82rem; font-weight: 700; direction: ltr;
  padding: .35rem .7rem; border-radius: 8px; background: var(--bg-alt);
  border: 1px solid var(--border);
}
.header-phone:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: .35rem;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  cursor: pointer; display: grid; place-items: center; color: var(--text);
  transition: border-color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  display: grid; place-items: center; color: var(--text-muted); position: relative;
  transition: .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn .badge-count {
  position: absolute; top: -4px; left: -4px;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 800; display: grid; place-items: center;
}
[data-theme="dark"] .icon-btn .badge-count { color: #0b0f1a; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .65rem 1.2rem; border-radius: 10px; border: 1px solid transparent;
  font-family: inherit; font-weight: 700; font-size: .88rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s, border-color .15s, filter .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn-accent {
  background: var(--accent);
  color: #fff !important;
  box-shadow: 0 2px 10px var(--accent-glow);
}
[data-theme="dark"] .btn-accent {
  color: #0b0f1a !important;
  background: linear-gradient(145deg, var(--accent), var(--accent-hover));
}
.btn-accent:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  color: #fff !important;
}
[data-theme="dark"] .btn-accent:hover { color: #0b0f1a !important; }
.btn-outline {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.3);
  color: #fff !important;
}
.hero .btn-outline:hover, .cta-banner .btn-outline:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.5);
}
.btn-outline.btn-dark {
  border-color: var(--border-strong); color: var(--accent) !important;
  background: transparent;
}
.btn-outline.btn-dark:hover { background: var(--accent-soft); }
.btn-ghost {
  background: transparent; color: var(--text-muted) !important;
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--text) !important; border-color: var(--accent);
  background: var(--accent-soft);
}
.btn-whatsapp {
  background: #25d366;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(37,211,102,.25);
}
.btn-whatsapp:hover { filter: brightness(1.05); color: #fff !important; }
.btn-danger { background: var(--danger); color: #fff !important; border: 0; }
.btn-sm { padding: .38rem .8rem; font-size: .8rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.5rem; font-size: .95rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }

/* Forms */
.form-control {
  width: 100%; padding: .65rem .9rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text);
  font-family: inherit; font-size: .9rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: var(--ring);
}
.form-group { margin-bottom: calc(var(--space) * 2); }
.form-group label {
  display: block; margin-bottom: .35rem; font-size: .8rem;
  color: var(--text-muted); font-weight: 600;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-error { color: var(--danger); font-size: .8rem; }

.alert {
  padding: .85rem 1.1rem; border-radius: 10px; margin: 1rem 0;
  background: var(--accent-soft); border: 1px solid var(--border);
}
.alert-success, .alert-info { border-color: var(--success); }
.alert-error, .alert-warning { border-color: var(--warn); background: rgba(245,158,11,.1); }
.messages-wrap { padding-top: .5rem; }

/* ===== Hero — marketplace (search-first) ===== */
.hero {
  position: relative;
  min-height: auto;
  display: flex; align-items: center;
  padding: calc(var(--space) * 6) 0 calc(var(--space) * 5);
  overflow: hidden;
  background: var(--hero-grad);
  color: #fff;
}
.hero-marketplace { padding: 2.75rem 0 3.25rem; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hero-orb { display: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: .4;
}
.hero-bg::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 80px;
  background: linear-gradient(transparent, var(--bg));
}
.hero-content { position: relative; z-index: 1; max-width: 920px; margin-inline: auto; text-align: center; }
.hero-marketplace .hero-content { max-width: 100%; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem; border-radius: 999px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .78rem; font-weight: 600; margin-bottom: 1rem; color: #fff;
}
.hero-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 8px #7dd3fc;
}
.hero h1 {
  font-size: clamp(1.65rem, 3.8vw, 2.35rem);
  line-height: 1.35;
  margin: 0 auto 0.85rem; color: #fff; font-weight: 800;
  max-width: 18em;
}
.hero h1 .accent {
  color: #fff;
  background: linear-gradient(135deg, #93c5fd, #e0f2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .hero h1 .accent {
  background: linear-gradient(135deg, var(--accent), #f5e6a3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: rgba(255,255,255,.88); font-size: 1rem; margin: 0 auto 1.75rem;
  max-width: 36em; line-height: 1.7;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem;
  justify-content: center;
}
.hero-stats, .trust-strip {
  display: flex; gap: 0; flex-wrap: wrap;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.5rem;
  max-width: 720px;
  margin-inline: auto;
}
.trust-strip .stat, .hero-stats .stat {
  flex: 1; min-width: 110px; padding: .95rem 1.1rem;
  display: flex; flex-direction: column; gap: .15rem;
  border-left: 1px solid rgba(255,255,255,.1);
}
.trust-strip .stat:last-child, .hero-stats .stat:last-child { border-left: 0; }
.hero-stats strong, .trust-strip strong {
  font-size: 1.35rem; color: #fff; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.hero-stats span, .trust-strip span {
  font-size: .75rem; color: rgba(255,255,255,.7); font-weight: 500;
}

/* Marketplace search bar */
.mkt-search {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.2rem 1rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.2);
  text-align: right;
  max-width: 980px;
  margin: 0 auto 0.25rem;
}
.mkt-search-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.1fr 1fr auto;
  gap: .75rem;
  align-items: end;
}
.mkt-field label {
  display: block; font-size: .72rem; font-weight: 700;
  color: var(--text-muted); margin-bottom: .3rem;
}
.mkt-field .form-control {
  background: var(--bg);
  border-color: var(--border);
  font-size: .88rem;
  padding: .7rem .85rem;
}
.mkt-search-btn {
  height: 44px;
  padding-inline: 1.4rem;
  white-space: nowrap;
}
.mkt-search-quick {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-top: .85rem; padding-top: .75rem;
  border-top: 1px solid var(--border);
}
.mkt-quick-label {
  font-size: .75rem; color: var(--text-muted); font-weight: 600; margin-left: .25rem;
}
.chip-soft {
  background: var(--bg-alt) !important;
  box-shadow: none !important;
  font-size: .78rem !important;
  padding: .32rem .75rem !important;
  color: var(--text) !important;
}
.chip-soft:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  transform: none !important;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-hero {
  padding: calc(var(--space) * 3.5) 0 calc(var(--space) * 2.5);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-hero-sm { padding: calc(var(--space) * 2) 0 calc(var(--space) * 2.25); }
.page-hero h1 {
  margin: .55rem 0 .35rem; font-size: clamp(1.35rem, 2.5vw, 1.7rem);
}
.page-hero p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.breadcrumb {
  display: flex; gap: .4rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted);
  align-items: center;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span:not(:last-child) { opacity: .45; }

/* Sections */
.section { padding: calc(var(--space) * 6.5) 0; }
.section-tight { padding: calc(var(--space) * 4) 0; }
.section-alt { background: var(--bg-alt); }
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: calc(var(--space) * 3); flex-wrap: wrap;
}
.section-header h2 {
  margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  position: relative; padding-bottom: .55rem;
}
.section-header h2::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 40px; height: 3px; border-radius: 2px;
  background: var(--accent);
}
.link-more {
  color: var(--accent); font-weight: 700; font-size: .88rem;
  display: inline-flex; align-items: center; gap: .3rem;
}
.quick-filters { display: flex; gap: .45rem; flex-wrap: wrap; }
.chip, .brand-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .4rem .9rem; border-radius: 999px;
  background: var(--bg-card-solid); border: 1px solid var(--border);
  color: var(--text); font-size: .82rem; font-weight: 600;
  transition: .15s; box-shadow: none;
}
.chip:hover, .brand-pill:hover, .chip.active {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft);
}
.brands-row { display: flex; flex-wrap: wrap; gap: .55rem; }

/* Banners */
.banners-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.banner-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 170px; background: var(--bg-card-solid);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  display: flex; align-items: flex-end;
  transition: transform .25s, box-shadow .25s;
}
.banner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.banner-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .55;
}
.banner-card-body {
  position: relative; z-index: 1; padding: 1.25rem;
  background: linear-gradient(transparent 0%, rgba(0,0,0,.65) 45%, rgba(0,0,0,.85) 100%);
  width: 100%; color: #fff;
}
.banner-card h3 { margin: 0 0 .3rem; font-size: 1.05rem; color: #fff; }
.banner-card p { margin: 0 0 .75rem; font-size: .85rem; color: rgba(255,255,255,.8); }

/* ===== Car cards — dense marketplace ===== */
.car-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}
.car-grid-dense {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.car-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .25s var(--ease-out), box-shadow .25s, border-color .2s;
  position: relative;
}
.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.car-card-link { color: inherit; display: flex; flex-direction: column; height: 100%; }
.car-card-image {
  position: relative; aspect-ratio: 16 / 10;
  background: var(--placeholder-grad); overflow: hidden;
}
.car-card-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s var(--ease-out);
}
.car-card:hover .car-card-image img { transform: scale(1.04); }

.car-placeholder {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem;
  color: rgba(255,255,255,.92); padding: 1rem;
}
.car-placeholder.large { min-height: 340px; }
.car-placeholder svg { width: min(78%, 220px); height: auto; opacity: .95; }
.placeholder-brand { font-weight: 800; font-size: 1rem; }
.placeholder-sub { font-size: .78rem; opacity: .65; }

.badge {
  position: absolute; top: .65rem; padding: .22rem .55rem;
  border-radius: 6px; font-size: .68rem; font-weight: 800;
  z-index: 2;
}
.badge-featured {
  right: .65rem;
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .badge-featured { color: #0b0f1a; }
.badge-condition {
  left: .65rem;
  background: rgba(0,0,0,.55);
  color: #fff;
}
.badge-sold { top: 2.35rem; right: .65rem; background: var(--danger); color: #fff; }
.badge-reserved { top: 2.35rem; right: .65rem; background: var(--warn); color: #fff; }

.car-card-body {
  padding: .9rem 1rem 1rem;
  display: flex; flex-direction: column; flex: 1;
}
.car-card-top { margin-bottom: .45rem; }
.car-card-title {
  margin: 0; font-size: .98rem; font-weight: 800;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.car-card-loc {
  margin: .2rem 0 0; font-size: .75rem; color: var(--text-muted);
}
.car-card-meta {
  display: flex; flex-wrap: wrap; gap: .3rem;
  font-size: .72rem; color: var(--text-muted); margin-bottom: .75rem;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: .2rem;
  padding: .18rem .45rem; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--border);
  font-weight: 600;
}
.meta-chip svg { width: 12px; height: 12px; opacity: .65; flex-shrink: 0; }

.car-card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.car-price {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem;
}
.car-price .price-label { display: none; }
.car-price .price-value {
  font-size: 1.12rem; font-weight: 800; color: var(--price-color);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.car-price .price-unit {
  font-size: .72rem; color: var(--text-muted); font-weight: 600;
}
.card-actions { display: flex; gap: .3rem; }
.card-action {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  display: grid; place-items: center; cursor: pointer; color: var(--text-muted);
  transition: .15s; padding: 0;
}
.card-action:hover, .card-action.active {
  color: var(--accent); border-color: var(--accent);
  background: var(--accent-soft);
}
.card-action.active { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,.08); }
.card-action[data-cmp-id].active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.card-action svg { width: 15px; height: 15px; }

/* List layout */
.list-layout {
  display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start;
}
.filters-sidebar {
  position: sticky; top: 4.75rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem;
  box-shadow: var(--shadow-card);
}
.filters-form h3 { margin: 0 0 1rem; font-size: 1rem; }
.filter-group { margin-bottom: .85rem; }
.filter-group label {
  display: block; font-size: .74rem; color: var(--text-muted);
  margin-bottom: .3rem; font-weight: 600;
}
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.list-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: .85rem; margin-bottom: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.list-toolbar-actions {
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.sort-label {
  font-size: .8rem; color: var(--text-muted); font-weight: 600; white-space: nowrap;
}
.sort-select {
  width: auto; min-width: 150px; padding: .45rem .7rem; font-size: .84rem;
}
.results-count { color: var(--text-muted); margin: 0; font-weight: 600; font-size: .9rem; }
.results-count strong { color: var(--text); font-weight: 800; }
.empty-state {
  text-align: center; padding: 3.5rem 1.25rem; color: var(--text-muted);
  grid-column: 1 / -1;
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state svg { width: 100px; height: auto; margin: 0 auto 1rem; opacity: .4; }
.empty-state p { margin: 0 0 1rem; }
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .85rem; margin-top: 2rem;
}
.pagination a {
  padding: .5rem 1.05rem; border-radius: 8px; border: 1px solid var(--border);
  color: var(--text); background: var(--bg-card-solid); font-weight: 600;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.page-info { color: var(--text-muted); font-size: .85rem; font-weight: 500; }

/* ===== Detail ===== */
.detail-layout {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: start;
}
.gallery-main {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--placeholder-grad); aspect-ratio: 16/10;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .85rem; flex-wrap: wrap; }
.thumb {
  border: 2px solid var(--border); border-radius: 8px; overflow: hidden;
  padding: 0; cursor: pointer; background: none; width: 80px; height: 60px;
  opacity: .75; transition: .15s;
}
.thumb:hover, .thumb.active { border-color: var(--accent); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { position: relative; }
.detail-sticky {
  position: sticky; top: 4.75rem;
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.detail-info h1 {
  margin: 0 0 .3rem; font-size: clamp(1.25rem, 2.2vw, 1.55rem);
}
.detail-year { color: var(--text-muted); margin: 0 0 1rem; font-size: .9rem; }
.detail-price {
  margin-bottom: .85rem; padding: 1rem 1.1rem;
  background: var(--bg-alt);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.detail-price .price-label {
  font-size: .72rem; color: var(--text-muted); display: block;
  font-weight: 600; margin-bottom: .2rem;
}
.detail-price .price-value {
  font-size: 1.7rem; font-weight: 800; color: var(--price-color);
  font-variant-numeric: tabular-nums;
}
.detail-price .price-unit {
  color: var(--text-muted); margin-right: .3rem; font-size: .85rem; font-weight: 500;
}
.status-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .32rem .75rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; margin-bottom: 1.15rem;
  background: var(--accent-soft); color: var(--accent);
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.status-sold { background: rgba(239,68,68,.1); color: var(--danger); }
.status-reserved { background: rgba(245,158,11,.1); color: var(--warn); }
.specs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; margin-bottom: 1.25rem;
}
.spec {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 10px; padding: .75rem .7rem;
}
.spec-label {
  display: block; font-size: .68rem; color: var(--text-muted);
  margin-bottom: .2rem; font-weight: 600;
}
.spec strong { font-size: .85rem; }
.detail-desc {
  margin-top: 1.5rem; padding: 1.25rem;
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.detail-desc h3 { margin: 0 0 .55rem; font-size: 1rem; }
.detail-desc p { color: var(--text-muted); margin: 0; line-height: 1.8; }
.detail-ctas { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.25rem; }
.detail-tools { display: flex; gap: .45rem; margin-bottom: .9rem; flex-wrap: wrap; }

.sticky-buy-bar {
  display: none;
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 85;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: .75rem 1rem;
  padding-bottom: max(.75rem, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
.sticky-buy-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; max-width: 1200px; margin: 0 auto;
}
.sticky-buy-price { display: flex; flex-direction: column; }
.sticky-buy-price .price-label { font-size: .68rem; color: var(--text-muted); }
.sticky-buy-price .price-value { font-size: 1.05rem; font-weight: 800; color: var(--price-color); }
.sticky-buy-actions { display: flex; gap: .45rem; }

.installment-box {
  margin-top: 1.5rem; padding: 1.2rem;
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.installment-box h3 { margin: 0 0 .75rem; font-size: 1rem; }
.installment-fields { display: grid; gap: .65rem; }
.installment-result {
  margin-top: .85rem; padding: .85rem 1rem;
  background: var(--accent-soft); border-radius: 10px;
  border: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: .65rem; flex-wrap: wrap;
}
.installment-result strong { font-size: 1.05rem; color: var(--accent); }

.inquiry-section { max-width: 740px; }
.inquiry-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.inquiry-card h2, .inquiry-card h3 { margin-top: 0; }

.contact-layout { display: grid; gap: 1.75rem; }
.contact-info-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem;
}
.info-card {
  background: var(--bg-card-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; text-align: center; color: inherit; box-shadow: var(--shadow-card);
  transition: transform .2s, border-color .2s;
}
.info-card:hover { border-color: var(--accent); transform: translateY(-3px); color: inherit; }
.info-icon {
  width: 48px; height: 48px; margin: 0 auto .75rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: 1.3rem;
}
.info-card h3 { margin: .3rem 0 .25rem; font-size: .95rem; }
.info-card p { margin: 0; color: var(--text-muted); font-size: .88rem; }
.map-placeholder {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-alt); min-height: 220px;
  display: grid; place-items: center; color: var(--text-muted);
}
.map-placeholder iframe { width: 100%; height: 280px; border: 0; }
.about-layout { display: grid; grid-template-columns: 1.45fr .75fr; gap: 2rem; }
.about-text { color: var(--text-muted); line-height: 1.85; }
.about-features { display: grid; gap: .85rem; margin-top: 1.75rem; }
.feature {
  display: flex; gap: .9rem; align-items: flex-start;
  padding: .9rem; border-radius: 10px;
  background: var(--bg-card-solid); border: 1px solid var(--border);
}
.feature-icon {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent); display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.feature h4 { margin: 0 0 .2rem; font-size: .92rem; }
.feature p { margin: 0; color: var(--text-muted); font-size: .85rem; }

.faq-list { display: grid; gap: .7rem; max-width: 800px; margin: 0 auto; }
.faq-item {
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card);
}
.faq-item:hover, .faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  padding: 1.05rem 1.2rem; cursor: pointer; font-weight: 700;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--accent); font-size: 1.2rem; font-weight: 300;
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent-soft); display: grid; place-items: center;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-answer {
  padding: 0 1.2rem 1.15rem; color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: .9rem; margin-top: 0; line-height: 1.8;
}

.compare-table-wrap {
  overflow-x: auto; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.compare-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.compare-table th, .compare-table td {
  padding: .95rem; text-align: center; border-bottom: 1px solid var(--border);
  background: var(--bg-card-solid);
}
.compare-table th { background: var(--bg-alt); font-size: .84rem; }
.compare-table tr:hover td { background: var(--accent-soft); }
.compare-table td:first-child, .compare-table th:first-child {
  text-align: right; font-weight: 700; color: var(--text-muted); position: sticky; right: 0;
}
.compare-selects {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .85rem; margin-bottom: 1.5rem;
  padding: 1.15rem; background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}

.cta-banner {
  padding: calc(var(--space) * 6) 0; background: var(--hero-grad); color: #fff;
  position: relative; overflow: hidden;
}
.cta-banner::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 50%, var(--mesh-1), transparent 42%),
    radial-gradient(circle at 85% 30%, var(--mesh-2), transparent 40%);
}
.cta-inner {
  position: relative; display: flex; align-items: center;
  justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.cta-banner h2 { margin: 0 0 .35rem; color: #fff; font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
.cta-banner p { margin: 0; color: rgba(255,255,255,.8); }
.cta-btns { display: flex; flex-wrap: wrap; gap: .6rem; }

.floating-cta {
  position: fixed; bottom: 1.25rem; left: 1.25rem; z-index: 90;
  display: flex; flex-direction: column; gap: .5rem;
}
.fab {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.05rem; border-radius: 999px; color: #fff !important;
  font-weight: 800; font-size: .82rem; box-shadow: var(--shadow-lg);
  transition: transform .2s;
}
.fab:hover { transform: translateY(-2px); color: #fff !important; }
.fab svg { width: 18px; height: 18px; flex-shrink: 0; }
.fab-whatsapp { background: #25d366; }
.fab-phone {
  background: var(--accent);
  color: #fff !important;
}
[data-theme="dark"] .fab-phone { color: #0b0f1a !important; }

.site-footer {
  background: var(--bg-elevated); border-top: 1px solid var(--border);
  padding-top: calc(var(--space) * 6); margin-top: calc(var(--space) * 2);
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 2rem; padding-bottom: 2.25rem;
}
.footer-brand p { color: var(--text-muted); font-size: .88rem; line-height: 1.75; }
.footer-links h4, .footer-contact h4, .footer-map h4 {
  margin: 0 0 .9rem; font-size: .9rem; position: relative; padding-bottom: .45rem;
}
.footer-links h4::after, .footer-contact h4::after, .footer-map h4::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 24px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.footer-links a {
  display: block; color: var(--text-muted); margin-bottom: .45rem; font-size: .86rem;
}
.footer-links a:hover { color: var(--accent); }
.footer-contact p { margin: 0 0 .5rem; color: var(--text-muted); font-size: .88rem; }
.footer-contact a { color: var(--text-muted); }
.footer-contact a:hover { color: var(--accent); }
.social-row { display: flex; gap: .45rem; margin-top: 1rem; flex-wrap: wrap; }
.social-link {
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); display: grid; place-items: center;
  color: var(--text-muted); background: var(--bg); font-size: .78rem; font-weight: 700;
}
.social-link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.footer-map .map-box {
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: var(--bg); min-height: 140px;
  display: grid; place-items: center; color: var(--text-muted); font-size: .84rem;
}
.footer-map .map-box iframe { width: 100%; height: 140px; border: 0; }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 1rem 0; text-align: center;
  color: var(--text-muted); font-size: .78rem;
}

.toast-stack {
  position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: .45rem; pointer-events: none;
}
.toast {
  background: var(--bg-card-solid); color: var(--text);
  border: 1px solid var(--border); padding: .7rem 1.2rem;
  border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .84rem; font-weight: 600;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card { height: 280px; border-radius: var(--radius); }

.auth-card, .panel-card {
  background: var(--bg-card-solid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow-card);
  max-width: 480px; margin: 2rem auto;
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mkt-search-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mkt-search-btn { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .list-layout, .detail-layout, .about-layout { grid-template-columns: 1fr; }
  .filters-sidebar, .detail-sticky { position: static; }
  .specs-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: var(--bg-elevated); flex-direction: column; padding: 1rem;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    gap: .15rem;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .65rem 1rem; border-radius: 8px; }
  .nav-toggle { display: flex; }
  .header-phone { display: none; }
  .header-actions .btn-sm { display: none; }
  .header-actions .btn-accent.btn-sm { display: inline-flex; }
  .header-inner { position: relative; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero { padding: 2.25rem 0 2.5rem; }
  .sticky-buy-bar { display: block; }
  .floating-cta { bottom: 5rem; }
  body.has-sticky-buy { padding-bottom: 4.5rem; }
}
@media (max-width: 600px) {
  .form-row, .filter-row, .specs-grid { grid-template-columns: 1fr; }
  .mkt-search-grid { grid-template-columns: 1fr; }
  .fab span { display: none; }
  .fab { width: 48px; height: 48px; justify-content: center; border-radius: 50%; padding: 0; }
  .car-grid, .car-grid-dense { grid-template-columns: 1fr; gap: .9rem; }
  .trust-strip .stat, .hero-stats .stat {
    min-width: 50%; border-left: 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
  }
  .hero h1 { font-size: clamp(1.45rem, 7vw, 1.9rem); }
  .section { padding: calc(var(--space) * 4.5) 0; }
  .list-toolbar-actions { width: 100%; }
  .sort-select { flex: 1; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ===== Bama-match: proportions, density, colors (no logo copy) ===== */
:root, [data-theme="light"] {
  --bg: #f5f5f5;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-solid: #ffffff;
  --bg-alt: #fafafa;
  --text: #1d1d1b;
  --text-muted: #757575;
  --border: #e0e0e0;
  --border-strong: #cacaca;
  --accent: var(--brand-accent-light, #0044e0);
  --accent-hover: #0033b0;
  --accent-soft: rgba(0, 68, 224, 0.08);
  --accent-glow: rgba(0, 68, 224, 0.18);
  --primary: var(--brand-primary-light, #1d1d1b);
  --price-color: #d32f2f;
  --radius: 4px;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --shadow-card: none;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 2px 8px rgba(0,0,0,.08);
  --header-bg: #ffffff;
  --dealer-bg: #fef0c7;
  --dealer-fg: #74300b;
  --hero-grad: linear-gradient(180deg, #eaf0ff 0%, #f5f5f5 72%);
}

body {
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.container { width: min(1024px, 96%); }

/* ----- Header (compact white bar) ----- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="light"] .site-header { background: #fff; }
.header-inner { padding: .55rem 0; gap: .75rem; }
.logo { font-size: .95rem; font-weight: 800; }
.logo-icon {
  width: 30px; height: 30px; border-radius: 6px;
  box-shadow: none;
  background: var(--accent);
}
.logo-img { height: 30px; }
.main-nav a {
  font-size: .8rem; font-weight: 600;
  padding: .35rem .55rem; border-radius: 6px;
  color: #494b4a;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--accent); background: var(--accent-soft);
}
.header-phone {
  font-size: .78rem; border-radius: 6px; padding: .3rem .55rem;
  background: #f5f5f5;
}
.theme-toggle, .icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
}
.btn { border-radius: 6px; font-size: .82rem; font-weight: 700; }
.btn-sm { padding: .32rem .7rem; font-size: .78rem; border-radius: 6px; }
.btn-accent {
  background: var(--accent);
  box-shadow: none;
}
.form-control {
  border-radius: 4px; font-size: .82rem;
  border-color: #ddd; padding: .55rem .7rem;
}

/* ----- Hero (soft blue → grey, white search) ----- */
.hero-bama, .hero-marketplace {
  background: var(--hero-grad);
  color: var(--text);
  padding: 1.5rem 0 1.75rem;
  min-height: 0;
}
.hero-bama .hero-bg::before,
.hero-bama .hero-bg::after { display: none; }
.hero-bama .hero-eyebrow {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-size: .72rem;
}
.hero-bama .hero-eyebrow::before { background: var(--accent); box-shadow: none; }
.hero-bama h1 {
  color: var(--text);
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  max-width: none;
  margin: 0 auto .4rem;
  font-weight: 800;
}
.hero-bama h1 .accent {
  color: var(--accent);
  background: none;
  -webkit-text-fill-color: unset;
}
.hero-bama .hero-sub {
  color: var(--text-muted);
  font-size: .86rem;
  margin-bottom: 1.1rem;
}
.hero-bama .trust-strip,
.hero-bama .hero-stats {
  background: #fff;
  border: 1px solid var(--border);
  max-width: 640px;
  border-radius: var(--radius-lg);
  margin-top: 1.1rem;
}
.hero-bama .trust-strip .stat,
.hero-bama .hero-stats .stat { border-left-color: var(--border); padding: .75rem .9rem; }
.hero-bama .trust-strip strong,
.hero-bama .hero-stats strong { color: var(--text); font-size: 1.05rem; }
.hero-bama .trust-strip span,
.hero-bama .hero-stats span { color: var(--text-muted); font-size: .7rem; }

.mkt-search {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: .9rem .95rem .75rem;
  max-width: 980px;
}
.mkt-search-cascade {
  grid-template-columns: 1fr 1.1fr 1fr 1.1fr .9fr auto;
  gap: .55rem;
}
.mkt-field label { font-size: .68rem; color: #757575; margin-bottom: .22rem; }
.mkt-field .form-control { padding: .55rem .65rem; font-size: .8rem; background: #fff; }
.mkt-search-btn { height: 40px; border-radius: 6px; padding-inline: 1.1rem; font-size: .84rem; }
.mkt-search-quick { margin-top: .65rem; padding-top: .6rem; }
.chip-soft {
  background: #f5f5f5 !important;
  border-radius: 4px !important;
  font-size: .72rem !important;
  padding: .25rem .6rem !important;
}

.page-hero {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: .75rem 0 .65rem;
}
.page-hero h1 {
  margin: .3rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
}
.page-hero-list p { display: none; }
.page-hero-sm { padding: .6rem 0 .55rem; }
.breadcrumb { font-size: .75rem; }
.section-list { padding: .85rem 0 2rem; }
.section { padding: 1.75rem 0; }
.section-tight { padding: 1.1rem 0; }
.section-alt { background: #eee; }
.section-header { margin-bottom: 1rem; }
.section-header h2 { font-size: 1.15rem; padding-bottom: .4rem; }
.section-header h2::after { width: 28px; height: 2px; }

/* ----- List layout: ~320px filter + main (Bama w-80 + gap) ----- */
.list-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.filters-sidebar {
  position: sticky;
  top: 3.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}
.filters-head {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f7f7f7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.filters-form h3,
.filters-head h3 {
  margin: 0;
  font-size: .9rem;
  font-weight: 800;
}
.filters-form { padding: .75rem .9rem 1rem; }
.filter-group { margin-bottom: .65rem; }
.filter-group label {
  font-size: .7rem;
  color: #757575;
  margin-bottom: .22rem;
  font-weight: 600;
}
.filters-form .form-control {
  padding: .45rem .55rem;
  font-size: .8rem;
  border-radius: 4px;
  border-color: #ddd;
  background: #fff;
}
.filter-chips { margin-bottom: .7rem; gap: .3rem; }
.filter-chips .chip {
  font-size: .72rem;
  padding: .25rem .55rem;
  border-radius: 4px;
  box-shadow: none;
  background: #fff;
}
.filter-chips .chip.active {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}

/* Sort / toolbar bar */
.list-toolbar {
  padding: .5rem .85rem;
  border-radius: var(--radius);
  box-shadow: none;
  background: #fff;
  border: 1px solid var(--border);
  margin-bottom: .5rem;
  min-height: 44px;
}
.results-count { font-size: .82rem; }
.results-count strong { font-weight: 800; }
.sort-label { font-size: .75rem; color: #757575; }
.sort-select {
  font-size: .78rem;
  padding: .32rem .5rem;
  min-width: 140px;
  border-radius: 4px;
}

/* ===== CRITICAL: Bama horizontal ad rows (image ~240×160) ===== */
.car-list-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.car-list-rows-home { margin-top: .15rem; }

.car-row {
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  transition: background .12s;
}
.car-row:last-child { border-bottom: 0; }
.car-row:hover { background: #fafafa; }
.car-row-featured { background: #fffdf5; }
.car-row-featured:hover { background: #fff8e8; }

.car-row-link {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  color: inherit;
  padding: 1.15rem 1rem;
  min-height: 160px;
}
.car-row-link:hover { color: inherit; }

/* RTL: image first = right; aside last = left (price) */
.car-row-image {
  flex: 0 0 240px;
  width: 240px;
  height: 160px;
  min-height: 160px;
  position: relative;
  background: var(--placeholder-grad);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0;
}
.car-row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s;
}
.car-row:hover .car-row-image img { transform: scale(1.03); }
.car-placeholder-row {
  min-height: 160px;
  height: 100%;
  padding: .5rem;
}
.car-placeholder-row svg { width: 78%; max-width: 160px; }
.car-row-image .badge {
  top: .4rem;
  padding: .12rem .4rem;
  font-size: .62rem;
  border-radius: 4px;
}
.car-row-image .badge-featured { right: .4rem; }
.car-row-image .badge-sold,
.car-row-image .badge-reserved { left: .4rem; right: auto; top: .4rem; }

.car-row-photocount {
  position: absolute;
  bottom: .4rem;
  left: .4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .4rem;
  border-radius: 6px;
  background: rgba(29,29,27,.72);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1;
}

.car-row-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .35rem;
}
.car-row-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #1d1d1b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.car-row-subtitle {
  margin: 0;
  font-size: .82rem;
  color: #1d1d1b;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Year / km chips */
.car-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .15rem;
}
.car-row-chips .chip-year,
.car-row-chips .chip-km,
.car-row-chips .chip-meta {
  display: inline-flex;
  align-items: center;
  padding: .15rem .45rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 600;
  background: #f5f5f5;
  border: 1px solid var(--border);
  color: #494b4a;
  line-height: 1.3;
}
.car-row-chips .chip-year {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.car-row-chips .chip-km {
  background: #fff;
}

.car-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  margin-top: .2rem;
}
.car-row-loc {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .78rem;
  color: #757575;
  font-weight: 500;
}
.car-row-loc svg { opacity: .7; flex-shrink: 0; }
.car-row-condition {
  font-size: .7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: .1rem .4rem;
  border-radius: 4px;
}

/* Aside = LEFT in RTL: dealer badge + RED price */
.car-row-aside {
  flex: 0 0 168px;
  width: 168px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: .5rem;
  text-align: left;
  border: 0;
}
.dealer-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .2rem .45rem;
  border-radius: 6px;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--dealer-bg);
  color: var(--dealer-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dealer-badge-partner { background: #e8f0fe; color: #1a4db3; }
.dealer-badge-user { background: #f0f0f0; color: #555; }

.car-row-price {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: .25rem;
  direction: ltr;
}
.car-row-price .price-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--price-color);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}
.car-row-price .price-unit {
  font-size: .75rem;
  color: #757575;
  font-weight: 500;
  direction: rtl;
}
.car-row-actions {
  display: flex;
  gap: .25rem;
  justify-content: flex-end;
}
.car-row-actions .card-action {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

/* Grid cards (home featured / related) — denser */
.car-card {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
}
.car-card:hover {
  transform: none;
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.car-card-title { font-size: .88rem; font-weight: 700; }
.car-price .price-value { color: var(--price-color); font-size: 1rem; }
.car-card-body { padding: .7rem .8rem .8rem; }
.car-card-meta { font-size: .7rem; margin-bottom: .5rem; }
.meta-chip { border-radius: 4px; padding: .12rem .35rem; background: #f5f5f5; }
.car-card-loc { font-size: .72rem; color: #9e9e9e; }

.chip, .brand-pill {
  border-radius: 4px;
  box-shadow: none;
  font-size: .76rem;
  background: #fff;
}

/* ----- Detail — denser sticky sidebar ----- */
.detail-layout {
  grid-template-columns: 1.35fr .65fr;
  gap: 1.15rem;
}
.gallery-main {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
}
.detail-sticky {
  top: 3.4rem;
  border-radius: var(--radius);
  box-shadow: none;
  padding: 1rem;
  border: 1px solid var(--border);
  background: #fff;
}
.detail-info h1 { font-size: 1.15rem; font-weight: 800; margin-bottom: .2rem; }
.detail-year { font-size: .8rem; color: #757575; margin-bottom: .55rem; }
.detail-loc { margin: -.2rem 0 .7rem; color: #9e9e9e !important; font-size: .8rem; }
.detail-price {
  padding: .75rem .8rem;
  border-radius: 4px;
  background: #fafafa;
  border: 1px solid var(--border);
  margin-bottom: .55rem;
}
.detail-price .price-label { font-size: .68rem; color: #9e9e9e; }
.detail-price .price-value {
  font-size: 1.4rem;
  color: var(--price-color);
  font-weight: 800;
}
.detail-price .price-unit { font-size: .8rem; color: #757575; }
.specs-grid { gap: .35rem; margin-bottom: .85rem; }
.spec {
  border-radius: 4px;
  padding: .5rem .45rem;
  background: #fafafa;
  border: 1px solid var(--border);
}
.spec-label { font-size: .62rem; color: #9e9e9e; }
.spec strong { font-size: .78rem; }
.detail-desc, .installment-box, .inquiry-card {
  border-radius: var(--radius);
  box-shadow: none;
  border: 1px solid var(--border);
}
.status-pill { border-radius: 4px; font-size: .7rem; margin-bottom: .7rem; }
.detail-tools .btn { font-size: .75rem; }
.detail-sticky .detail-ctas .btn { border-radius: 6px; }

.empty-state {
  border-radius: var(--radius);
  box-shadow: none;
  background: #fff;
}
.pagination a {
  border-radius: 4px;
  font-size: .8rem;
}

.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
}

/* Ensure /cars/ never falls back to grid */
.list-main .car-grid { display: none !important; }
.list-main .car-list-rows { display: flex; }

@media (max-width: 1024px) {
  .mkt-search-cascade { grid-template-columns: 1fr 1fr; }
  .container { width: min(1180px, 96%); }
  .list-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; }
}
@media (max-width: 960px) {
  .list-layout { grid-template-columns: 1fr; }
  .filters-sidebar { position: static; border-radius: var(--radius); }
  .car-row-image { flex-basis: 200px; width: 200px; height: 133px; min-height: 133px; }
  .car-row-aside { flex-basis: 140px; width: 140px; }
  .car-row-link { padding: .9rem .75rem; gap: .75rem; min-height: 0; }
}
@media (max-width: 640px) {
  .car-row-link {
    flex-wrap: wrap;
    padding: 0;
    gap: 0;
  }
  .car-row-image {
    flex: 0 0 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    min-height: 0;
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  .car-row-body {
    flex: 1 1 55%;
    padding: .75rem .85rem .5rem;
  }
  .car-row-aside {
    flex: 1 1 40%;
    width: auto;
    align-items: flex-end;
    padding: .75rem .85rem;
  }
  .mkt-search-cascade { grid-template-columns: 1fr; }
  .hero-bama, .hero-marketplace { padding: 1.1rem 0 1.25rem; }
  .car-row-title { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; }
}

/* Dark theme keep horizontal rows readable */
[data-theme="dark"] {
  --price-color: #ff6b6b;
  --dealer-bg: rgba(254, 240, 199, .15);
  --dealer-fg: #f5d78e;
}
[data-theme="dark"] .car-list-rows,
[data-theme="dark"] .car-row,
[data-theme="dark"] .filters-sidebar,
[data-theme="dark"] .list-toolbar,
[data-theme="dark"] .mkt-search,
[data-theme="dark"] .detail-sticky,
[data-theme="dark"] .site-header {
  background: var(--bg-card-solid);
  border-color: var(--border);
}
[data-theme="dark"] .car-row:hover { background: var(--bg-alt); }
[data-theme="dark"] .car-row-title,
[data-theme="dark"] .car-row-subtitle { color: var(--text); }
[data-theme="dark"] .filters-head { background: var(--bg-alt); border-color: var(--border); }
[data-theme="dark"] .car-row-chips .chip-year,
[data-theme="dark"] .car-row-chips .chip-km,
[data-theme="dark"] .car-row-chips .chip-meta {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text-muted);
}
[data-theme="dark"] .hero-bama,
[data-theme="dark"] .hero-marketplace {
  background: var(--hero-grad);
  color: #fff;
}
[data-theme="dark"] .hero-bama h1,
[data-theme="dark"] .hero-bama .hero-sub { color: #fff; }
[data-theme="dark"] .hero-bama h1 .accent {
  background: linear-gradient(135deg, var(--accent), #f5e6a3);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .hero-bama .trust-strip,
[data-theme="dark"] .hero-bama .hero-stats {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}
[data-theme="dark"] .hero-bama .trust-strip strong,
[data-theme="dark"] .hero-bama .hero-stats strong { color: #fff; }
[data-theme="dark"] .car-row-photocount { background: rgba(0,0,0,.65); }

/* =========================================================
   Round 2 polish — closer to bama.ir (header, chips, empty,
   pagination, mobile list, gallery, hover, spacing, price)
   ========================================================= */

/* ----- Header nav density ----- */
.header-inner { padding: .42rem 0; gap: .5rem; }
.logo { font-size: .9rem; gap: .5rem; }
.logo-icon { width: 28px; height: 28px; border-radius: 5px; }
.logo-img { height: 28px; }
.main-nav { gap: 0; }
.main-nav a {
  font-size: .76rem;
  font-weight: 600;
  padding: .28rem .45rem;
  border-radius: 4px;
  letter-spacing: -.01em;
}
.header-actions { gap: .35rem; }
.header-phone {
  font-size: .74rem;
  padding: .22rem .45rem;
  border-radius: 4px;
}
.theme-toggle, .icon-btn {
  width: 30px; height: 30px; border-radius: 6px;
}
.header-actions .btn-sm {
  padding: .28rem .6rem;
  font-size: .74rem;
  border-radius: 5px;
}
@media (max-width: 1100px) {
  .main-nav a:nth-child(n+5) { display: none; } /* hide FAQ/about/contact in mid */
}
@media (max-width: 960px) {
  .main-nav a:nth-child(n+5) { display: block; }
}

/* ----- Filter checkbox chips (Bama-like) ----- */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .85rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .32rem .55rem .32rem .4rem;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fff;
  color: #494b4a;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
  text-decoration: none;
  user-select: none;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.filter-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.filter-chip .chip-box {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid #bdbdbd;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: .12s;
}
.filter-chip.active .chip-box {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.filter-chip .chip-box svg {
  width: 10px;
  height: 10px;
  opacity: 0;
  display: block;
}
.filter-chip.active .chip-box svg { opacity: 1; }
.filter-chips .chip { display: none; } /* legacy pill chips replaced */

.filter-check-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .75rem;
}
.filter-check-group > .filter-check-label {
  font-size: .7rem;
  color: #757575;
  font-weight: 600;
  margin-bottom: .1rem;
}
.filter-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}

/* ----- Empty state ----- */
.empty-state {
  text-align: center;
  padding: 2.75rem 1.25rem 2.5rem;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0;
}
.empty-state-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #f5f5f5;
  display: grid;
  place-items: center;
  color: #9e9e9e;
}
.empty-state-icon svg { width: 48px; height: auto; opacity: .7; }
.empty-state h3 {
  margin: 0 0 .4rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
}
.empty-state p {
  margin: 0 0 1.15rem;
  font-size: .86rem;
  line-height: 1.7;
  max-width: 28em;
  margin-inline: auto;
}
.empty-state .empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
}
.empty-state .btn { border-radius: 6px; }

/* ----- Pagination (numbered, Bama-like) ----- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: 1.25rem;
  padding: .75rem .5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pagination a,
.pagination span.page-num,
.pagination span.page-ellipsis,
.pagination span.page-current {
  min-width: 34px;
  height: 34px;
  padding: 0 .55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: .12s;
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pagination .page-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination .page-ellipsis {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  min-width: 24px;
  font-weight: 500;
}
.pagination .page-nav {
  padding-inline: .75rem;
  font-weight: 600;
  gap: .25rem;
}
.pagination .page-nav[aria-disabled="true"],
.pagination .page-nav.is-disabled {
  opacity: .4;
  pointer-events: none;
}
.page-info { display: none; } /* replaced by numbered pages */

/* ----- Row spacing + hover ----- */
.car-list-rows {
  border-radius: var(--radius);
}
.car-row-link {
  padding: .85rem .9rem;
  gap: .85rem;
  min-height: 148px;
}
.car-row {
  transition: background .12s ease;
}
.car-row:hover {
  background: #f7f8fa;
}
.car-row:hover .car-row-title {
  color: var(--accent);
}
.car-row:hover .car-row-image {
  border-color: var(--border-strong);
}
.car-row:hover .car-row-image img {
  transform: scale(1.025);
}
.car-row-image {
  flex-basis: 220px;
  width: 220px;
  height: 146px;
  min-height: 146px;
}
.car-row-aside {
  flex-basis: 156px;
  width: 156px;
}
.car-row-title { font-size: .95rem; }
.car-row-subtitle { font-size: .78rem; color: #616161; }

/* ----- Price formatting (number + تومان tight) ----- */
.car-row-price,
.car-price,
.detail-price .price-line,
.sticky-buy-price .price-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem;
  direction: ltr;
  unicode-bidi: isolate;
}
.car-row-price {
  justify-content: flex-end;
  flex-direction: row;
}
.car-row-price .price-value,
.car-price .price-value,
.detail-price .price-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.car-row-price .price-unit,
.car-price .price-unit,
.detail-price .price-unit {
  font-size: .72rem;
  color: #757575;
  font-weight: 500;
  direction: rtl;
  margin-right: 0;
}
.car-row-price .price-value {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--price-color);
}
.detail-price .price-value {
  font-size: 1.45rem;
}
.detail-price {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.detail-price .price-line {
  justify-content: flex-start;
}

/* ----- Gallery thumbs ----- */
.gallery-thumbs {
  display: flex;
  gap: .4rem;
  margin-top: .65rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: .35rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
.thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 54px;
  border: 2px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  background: #eee;
  opacity: .85;
  transition: border-color .15s, opacity .15s, transform .15s;
  position: relative;
  outline: 1px solid var(--border);
  outline-offset: -1px;
}
.thumb:hover {
  opacity: 1;
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.thumb.active {
  border-color: var(--accent);
  opacity: 1;
  outline-color: var(--accent);
}
.thumb.active::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--accent);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-main img {
  transition: opacity .2s ease;
}

/* ----- Related ads section ----- */
.related-ads .section-header h2 {
  font-size: 1.05rem;
}
.related-ads .car-grid {
  gap: .85rem;
}

/* ----- Mobile list (compact side-by-side like Bama app) ----- */
@media (max-width: 640px) {
  .car-list-rows {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .car-row-link {
    flex-wrap: nowrap;
    padding: .7rem .75rem;
    gap: .65rem;
    min-height: 0;
    align-items: flex-start;
  }
  .car-row-image {
    flex: 0 0 112px;
    width: 112px;
    height: 84px;
    min-height: 84px;
    aspect-ratio: auto;
    border: 1px solid var(--border);
    border-radius: 2px;
  }
  .car-row-body {
    flex: 1 1 auto;
    padding: 0;
    gap: .25rem;
    min-width: 0;
  }
  .car-row-aside {
    flex: 0 0 auto;
    width: auto;
    max-width: 42%;
    align-items: flex-end;
    padding: 0;
    gap: .35rem;
    align-self: stretch;
  }
  .car-row-title {
    font-size: .84rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .car-row-subtitle { display: none; }
  .car-row-chips .chip-meta { display: none; }
  .car-row-chips .chip-year,
  .car-row-chips .chip-km {
    font-size: .66rem;
    padding: .1rem .32rem;
  }
  .car-row-price .price-value { font-size: .88rem; }
  .car-row-actions { display: none; }
  .dealer-badge { font-size: .62rem; max-width: 110px; }
  .car-row-meta { margin-top: .1rem; }
  .car-row-loc { font-size: .7rem; }
  .list-toolbar {
    padding: .45rem .65rem;
    border-radius: 0;
    margin-bottom: 0;
    border-left: 0;
    border-right: 0;
  }
  .filters-sidebar {
    border-radius: var(--radius);
    margin-bottom: .5rem;
  }
  .pagination {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    gap: .25rem;
  }
  .pagination a,
  .pagination span.page-num,
  .pagination span.page-current {
    min-width: 30px;
    height: 30px;
    font-size: .75rem;
  }
  .thumb { width: 64px; height: 48px; }
}

/* Dark theme bits for new polish */
[data-theme="dark"] .filter-chip {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .filter-chip .chip-box {
  background: var(--bg);
  border-color: var(--border-strong);
}
[data-theme="dark"] .empty-state,
[data-theme="dark"] .pagination {
  background: var(--bg-card-solid);
  border-color: var(--border);
}
[data-theme="dark"] .empty-state-icon { background: var(--bg-alt); color: var(--text-muted); }
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span.page-num {
  background: var(--bg-elevated);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .pagination .page-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0f1a;
}
[data-theme="dark"] .car-row:hover { background: var(--bg-alt); }
[data-theme="dark"] .thumb { background: var(--bg-alt); }

/* Empty state inside list chrome */
.car-list-rows:has(.empty-state) {
  border-style: dashed;
  background: #fff;
}
.car-list-rows .empty-state {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Header density: hide secondary CTAs earlier */
@media (max-width: 1200px) {
  .header-actions .btn-ghost.btn-sm { display: none; }
}
@media (max-width: 1100px) {
  .header-phone { display: none; }
}

/* Title hover cue on cards too */
.car-card:hover .car-card-title { color: var(--accent); }

/* Ensure تومان sits tight after digits (Bama: 6,700,000,000تومان) */
.car-row-price .price-unit,
.car-price .price-unit {
  margin-inline-start: .12rem;
}
