/* Baabuur website. Colors mirror constants/theme.ts (LightColors / DarkColors).
   Loaded as a same-origin stylesheet so the CSP needs no inline styles. */
:root {
  /* Side gutter grows with the screen: phone 12px, desktop up to 32px. */
  --gutter: clamp(12px, 2.6vw, 32px);
  --page-max: 1440px;
  color-scheme: light dark;
  --primary: #CC0000;
  --primary-dark: #A30000;
  --primary-light: #FDECEC;
  --reviewed: #146347;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-alt: #F0F2F5;
  --text: #202B3B;
  --text-2: #526174;
  --muted: #5F6B7F;
  --border: #E2E6EC;
  --divider: #EBEEF2;
  --success: #267258;
  --error: #CC0000;
  --price: #CC0000;
  --shadow: 0 4px 12px rgba(11, 11, 11, .06);
  --shadow-sm: 0 2px 6px rgba(11, 11, 11, .04);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #FF4D4F;
    --primary-dark: #CC0000;
    --primary-light: #2C181C;
    --reviewed: #1B7F57;
    --bg: #161A23;
    --surface: #1E2531;
    --surface-alt: #28313F;
    --text: #F3F6FB;
    --text-2: #C4CBD8;
    --muted: #8C95A6;
    --border: #323B4A;
    --divider: #252E3B;
    --success: #4CAF50;
    --error: #FF5A5C;
    --price: #FF5A5C;
    --shadow: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: clip; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
img { max-width: 100%; }
a { color: var(--primary); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.icon { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* Header: the app's red brand bar with the italic wordmark. */
.topbar { background: linear-gradient(180deg, #CC0000, #A30000); color: #fff; }
.topbar-inner { max-width: var(--page-max); margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: 44px; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 25px; line-height: 28px; font-weight: 800; font-style: italic; letter-spacing: -.6px; }
.brand-sub { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .20); }
.topnav a:hover { background: rgba(255, 255, 255, .18); }
/* Icon-only on phones; the label stays available to screen readers. */
@media (max-width: 519px) { .topnav .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }

.page { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter) 40px; }
.page-narrow { max-width: 1080px; }

/* Home hero: brand color behind the header and the top of the banner card. */
.hero { position: relative; padding-top: 4px; }
.hero::before { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: 0; height: 110px; background: linear-gradient(180deg, #A30000, var(--bg)); }
.banner { position: relative; z-index: 1; }
.banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 20px; box-shadow: var(--shadow); background: #192332; }
.banner-track::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .banner-track { scroll-behavior: smooth; } }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 16 / 9; overflow: hidden; color: #fff; text-decoration: none; display: block; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Photo banners: shade only the left side behind the copy, so the vehicle stays
   clear; a soft text shadow keeps white copy readable on bright photos. The card
   is a photo in both themes, so these colors are not theme tokens. */
.slide-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 18, 29, .62), rgba(10, 18, 29, .34) 40%, rgba(10, 18, 29, 0) 72%); }
.slide-copy { display: block; position: relative; padding: 22px 20px; max-width: 520px; }
.slide-eyebrow, .slide-title, .slide-sub { display: block; text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 12px rgba(0, 0, 0, .35); }
.slide-eyebrow { font-size: 10px; line-height: 14px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; margin-bottom: 8px; }
.slide-title { font-size: 24px; line-height: 29px; font-weight: 700; letter-spacing: -.5px; }
.slide-sub { font-size: 14px; line-height: 20px; color: #F1F3F5; font-weight: 500; margin-top: 6px; }
.slide-cta { display: inline-flex; align-items: center; gap: 14px; margin-top: 14px; min-height: 44px; padding: 0 16px; border-radius: 12px; background: #fff; color: #96172C; font-size: 13px; font-weight: 700; }
.slide-pill { position: absolute; top: 8px; left: 8px; border-radius: 8px; padding: 2px 7px; background: rgba(0, 0, 0, .45); font-size: 10px; font-weight: 600; }
.dots { display: flex; justify-content: center; align-items: center; min-height: 44px; }
.dot { width: 32px; height: 44px; border: 0; padding: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.dot::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: var(--text-2); opacity: .35; transition: width .2s; }
.dot[aria-current="true"]::before { width: 22px; opacity: 1; background: var(--primary); }
@media (min-width: 900px) {
  .slide-copy { padding: 34px 36px; }
  .slide-title { font-size: 32px; line-height: 38px; }
}

/* Buy / Rent segmented control, as ListingPurposeSwitch. */
.purpose { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-alt); max-width: 520px; }
.purpose button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: transparent; color: var(--text-2); font-size: 15px; font-weight: 700; }
.purpose button[aria-checked="true"] { background: var(--primary-dark); color: #fff; }
.filters-bar { padding: 10px 0 2px; }

/* Category strip, as the app's CategoryPill. */
.categories { display: flex; gap: 4px; padding-top: 10px; overflow-x: auto; scrollbar-width: none; }
.categories::-webkit-scrollbar { display: none; }
.cat { flex: 1 0 64px; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 70px; padding: 0 2px; border: 0; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; }
.cat-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-2); }
.cat::after { content: ""; width: 34px; height: 2px; border-radius: 1px; background: transparent; }
.cat[aria-pressed="true"] { color: var(--primary); font-weight: 800; }
.cat[aria-pressed="true"] .cat-icon { background: var(--primary-light); color: var(--primary); }
.cat[aria-pressed="true"]::after { background: var(--primary-dark); }

/* Panels and section headings. */
.panel { margin-top: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.panel-body { padding: 0 8px 8px; }
.section-head { min-height: 44px; padding: 4px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title { font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.see-all { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none; }

/* Search card. */
.search-card { margin-top: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.field-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.input, .select { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); font-size: 15px; }
.input::placeholder { color: var(--muted); }
.keyword { position: relative; }
.keyword .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; }
.keyword .input { padding-left: 42px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-error { color: var(--error); font-size: 13px; font-weight: 600; }
@media (min-width: 720px) {
  .field-row.cols-4 { grid-template-columns: 2fr 1fr 1fr 1.4fr auto; align-items: end; }
  .field-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) { .field-row.cols-adv { grid-template-columns: repeat(4, 1fr); } }

/* Buttons. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0; text-decoration: none; font-size: 15px; font-weight: 800; }
.btn-primary { background: var(--primary-dark); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline { background: var(--surface); color: var(--primary); border: 2px solid var(--primary); }
.btn-quiet { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn-narrow { max-width: 280px; margin: 12px auto 0; }
.btn[disabled] { opacity: .6; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.actions .btn { flex: 1 1 160px; }

/* Chips (type pills, sort chips). */
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 700; }

/* Vehicle cards: horizontal like the app's Home list on phones, a grid of
   vertical cards from tablet width. */
.grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.card { display: flex; flex-direction: row; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); color: inherit; text-decoration: none; min-height: 108px; }
.card:hover { box-shadow: var(--shadow); }
.card-media { position: relative; flex: 0 0 120px; aspect-ratio: 120 / 112; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.card-media .icon { font-size: 30px; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-alt); }
.card-info { flex: 1; min-width: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.card-purpose { font-size: 12px; font-weight: 700; color: var(--primary); }
.card-purpose.sale { color: var(--text-2); }
.card-price { font-size: 17px; font-weight: 800; color: var(--price); letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { font-size: 14px; font-weight: 600; line-height: 19px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.card-meta span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.card-posted { color: var(--muted); font-size: 12px; margin-top: 3px; }
.badge-featured { position: absolute; top: 6px; left: 6px; z-index: 1; background: var(--primary-dark); color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 3px 6px; }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid .card { flex-direction: column; }
  .grid .card-media { flex: none; width: 100%; aspect-ratio: 4 / 3; }
}
@media (min-width: 820px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .grid.wide { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* Featured row: small vertical cards in one horizontal row. */
.row-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 0 8px 8px; scroll-snap-type: x proximity; }
.row-scroll .card { flex: 0 0 160px; flex-direction: column; scroll-snap-align: start; min-height: 0; }
.row-scroll .card-media { flex: none; width: 100%; aspect-ratio: 3 / 2; }
.row-scroll .card-info { padding: 8px; }
.row-scroll .card-price { font-size: 16px; }
.row-scroll .card-title { font-size: 12px; line-height: 17px; }

/* Load states. */
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 36px 16px; color: var(--muted); font-weight: 600; }
.state .icon { font-size: 30px; }
.state.error .icon { color: var(--error); }
.state-title { color: var(--text); font-size: 16px; font-weight: 700; }
.skeleton { display: grid; gap: 8px; }
.skeleton div { height: 108px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--border); }
.load-more { display: flex; justify-content: center; padding: 14px 0 4px; }
.result-count { color: var(--text-2); font-size: 13px; font-weight: 600; padding: 8px 2px; min-height: 20px; }

/* App download block. */
.get-app { margin-top: 16px; padding: 20px; border-radius: 16px; background: linear-gradient(135deg, #CC0000, #A30000); color: #fff; display: flex; flex-direction: column; gap: 10px; }
.get-app h2 { font-size: 20px; }
.get-app p { color: rgba(255, 255, 255, .92); font-size: 14px; }
.get-app .so { font-style: italic; color: rgba(255, 255, 255, .8); }
.get-app .badge { align-self: flex-start; background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; }
.get-app .btn-outline { background: #fff; color: #A30000; border-color: #fff; align-self: flex-start; }

/* Footer. */
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 20px 16px 40px; text-align: center; color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-bottom: 8px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--primary); text-decoration: none; font-weight: 700; }

/* Page titles and back link. */
.page-head { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; }
.page-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.back-link { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 22px; flex: none; }

/* Vehicle detail. */
.detail { display: grid; grid-template-columns: 1fr; gap: 12px; padding-top: 8px; }
.detail-side > .box + .box, .detail-more > .box + .box { margin-top: 12px; }
@media (min-width: 900px) {
  .detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .detail-gallery { grid-column: 1; grid-row: 1; }
  .detail-more { grid-column: 1; grid-row: 2; }
  .detail-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 12px; }
}
.gallery { border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--border); }
.gallery-main { position: relative; aspect-ratio: 4 / 3; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.gallery-main > .icon { font-size: 48px; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(0, 0, 0, .5); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; z-index: 1; }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.gallery-badges { position: absolute; top: 10px; left: 10px; z-index: 1; display: flex; gap: 6px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
.thumb { flex: 0 0 72px; height: 56px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-alt); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-current="true"] { border-color: var(--primary); }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.box + .box { margin-top: 12px; }
.box-title { font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.v-purpose { color: var(--primary); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.v-price { font-size: 26px; font-weight: 800; color: var(--price); letter-spacing: -.5px; }
.v-title { font-size: 19px; font-weight: 700; margin-top: 4px; line-height: 1.3; }
.v-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.v-meta span { display: inline-flex; align-items: center; gap: 4px; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.spec-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.spec-value { font-size: 14px; font-weight: 700; margin-top: 2px; overflow-wrap: anywhere; }
.term { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.term span:first-child { color: var(--text-2); }
.term span:last-child { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.desc { white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.seller-row { display: flex; align-items: center; gap: 12px; min-height: 56px; color: inherit; text-decoration: none; }
.avatar { width: 48px; height: 48px; border-radius: 24px; flex: none; background: var(--primary-light); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; border: 2px solid rgba(204, 0, 0, .25); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.avatar.lg { width: 60px; height: 60px; border-radius: 30px; font-size: 24px; }
.seller-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.seller-name { font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.seller-link { font-size: 12px; font-weight: 700; color: var(--primary); }
.seller-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 8px; background: var(--surface-alt); color: var(--text-2); font-size: 12px; font-weight: 600; }
.seller-badge.verified { background: rgba(38, 114, 88, .12); color: var(--success); }
.protected { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 12px; }
.safety { background: var(--primary-light); border-color: rgba(204, 0, 0, .2); }
.safety ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.safety li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.safety li .icon { color: var(--success); }
.contact-note { margin-top: 8px; font-size: 12px; color: var(--muted); text-align: center; }

/* Public seller profile. */
.seller-card { margin-top: 8px; }
.seller-head { display: flex; gap: 12px; align-items: flex-start; }
.stats { display: flex; border-top: 1px solid var(--divider); margin-top: 12px; padding-top: 8px; }
.stat { flex: 1; text-align: center; }
.stat b { display: block; font-size: 18px; color: var(--primary); }
.stat span { font-size: 11px; color: var(--muted); }
.trust { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-top: 8px; }
.trust .icon { color: var(--primary); }
.verified-banner { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 14px; background: rgba(38, 114, 88, .10); border: 1px solid rgba(38, 114, 88, .25); }
.verified-banner .icon { color: var(--success); font-size: 18px; margin-top: 2px; }
.verified-title { font-size: 13px; font-weight: 700; color: var(--success); }
.verified-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.about { margin-top: 10px; font-size: 14px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }

/* ── Wide screens: use the whole width (tablet landscape, laptop, desktop). ── */
@media (min-width: 1024px) {
  /* Buy/Rent and the categories share one row instead of stacking. */
  .filters-bar { display: flex; align-items: center; gap: 20px; }
  .filters-bar .purpose { flex: 0 0 340px; }
  .filters-bar .categories { flex: 1; padding-top: 0; justify-content: flex-start; }
  /* Search: filters in a left column that stays in view, results beside it. */
  .search-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
  .search-layout > .search-card { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; margin-top: 8px; }
  .search-layout .field-row.cols-adv { grid-template-columns: 1fr 1fr; }
  .search-layout .search-card .filters-bar { display: block; }
  .search-layout .search-card .filters-bar .purpose { max-width: none; }
  .search-layout .grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* Seller: profile card on the left, ads on the right. */
  .seller-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
  .seller-layout > .seller-card { position: sticky; top: 12px; margin-top: 10px; }
  .seller-layout .grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .search-layout .grid.wide, .seller-layout .grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1380px) {
  .grid.wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .search-layout .grid.wide, .seller-layout .grid.wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Home top on wide screens: a 16:9 banner on the left (filled edge to edge by a
   16:9 image) and Buy/Rent, categories and search in a panel beside it. */
@media (min-width: 1024px) {
  .home-top { position: relative; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(340px, 1fr); grid-template-rows: auto 1fr; column-gap: 20px; align-items: start; }
  .home-top::before { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: 0; height: 110px; background: linear-gradient(180deg, #A30000, var(--bg)); }
  .home-top > * { position: relative; }
  .home-top > .hero { grid-column: 1; grid-row: 1 / span 2; }
  .home-top > .hero::before { display: none; }
  .home-top > .filters-bar, .home-top > .search-card { grid-column: 2; }
  .home-top > .filters-bar { display: block; padding-top: 14px; }
  .home-top .purpose { max-width: none; }
  .home-top .categories { padding-top: 12px; }
  .home-top .field-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .home-top .field-row.cols-4 > .keyword, .home-top .field-row.cols-4 > .split, .home-top .field-row.cols-4 > .btn { grid-column: 1 / -1; }
  /* No banner (none live): the panel takes the full width again. */
  .home-top:has(> .hero[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .home-top:has(> .hero[hidden]) > .filters-bar, .home-top:has(> .hero[hidden]) > .search-card { grid-column: 1; }
}
