/* ==========================================================================
   SABO CARS — global stylesheet
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Brand palette — --brand is the header color (also used by the footer and the main buttons) */
  --brand: #030164;
  --brand-600: #363199;   /* menu bar under the header */
  --brand-900: #02013F;   /* bottom strip of the footer */
  --brand-100: #D9D9F0;
  --brand-tint: #EDEDF8;
  --paper: #F3F4F7;       /* page background: a slightly darker white */
  --turquoise: #1DCED8;
  --green: #55E07E;

  /* Derived shades: hover states, tints, and text-safe (4.5:1) variants */
  --turquoise-300: #4FDCE3;
  --turquoise-600: #14AEB7;
  --turquoise-ink: #0B7E86;
  --green-600: #3FCF6B;
  --green-ink: #177A37;
  --green-tint: #E3F9E9;
  --paper-100: #F9FAFB;
  --paper-300: #E2E4EA;
  --paper-400: #C8CCD6;
  --amber: #F5A524;
  --warn-ink: #A64B08;
  --danger: #C2410C;      /* form errors */
  --danger-tint: #FDEEE7;

  /* Neutrals */
  --ink: #173134;
  --ink-700: #2E4447;
  --ink-muted: #5E6F71;
  --white: #FFFFFF;
  --on-brand-muted: rgba(255, 255, 255, .72);

  /* Semantic roles */
  --bg-page: var(--paper);
  --surface: var(--white);
  --surface-muted: var(--paper-100);
  --chip: var(--paper);
  --border: var(--paper-300);
  --border-strong: var(--paper-400);
  --text-primary: var(--ink);
  --text: var(--ink-700);
  --muted: var(--ink-muted);
  --primary: var(--brand);
  --primary-hover: var(--brand-600);
  --accent: var(--turquoise);
  --accent-ink: var(--turquoise-ink);
  --success: var(--green);
  --success-hover: var(--green-600);
  --success-ink: var(--green-ink);
  --header-bg: var(--brand);
  --nav-bg: var(--brand-600);
  --footer-bg: var(--header-bg);
  --footer-bottom: var(--brand-900);

  --shadow-card: 0 2px 8px rgba(23, 49, 52, .08);
  --shadow-hover: 0 8px 20px rgba(23, 49, 52, .14);
  --shadow-pop: 0 12px 32px rgba(23, 49, 52, .18);
  --focus-ring: 0 0 0 3px rgba(29, 206, 216, .4);
  --gutter: 60px;

  /* Lato for Latin text; Noto Sans covers Russian and Ukrainian (Cyrillic); Chinese uses the system's Chinese font */
  --font: Lato, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
/* While Russian/Chinese text loads, hide the page so English doesn't flash first (see js/i18n.js) */
.i18n-pending body { visibility: hidden; }
.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; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.container { max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.grow { flex: 1; }

/* ---------- Icons ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic.xs { width: 12px; height: 12px; }
.ic.sm { width: 14px; height: 14px; }
.ic.lg { width: 20px; height: 20px; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 20px; border-radius: 6px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn-lg { height: 48px; padding: 0 28px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 12px; }
.btn-pill { border-radius: 999px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: var(--ink); }
.btn-success:hover { background: var(--success-hover); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--ink-muted); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.is-disabled { opacity: .55; pointer-events: none; }

/* ---------- Logo ---------- */
/* The logo sits on the brand color (header, footer, admin bar), so it is white */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--white); font: italic 900 26px/1 var(--font); letter-spacing: .5px; white-space: nowrap; }
.logo .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--white); color: var(--brand); display: grid; place-items: center; }
.logo .mark img { width: 72%; height: auto; display: block; }   /* the SB logo (images/logo-mark.png) */
.logo b { color: inherit; font-weight: 900; }
.logo--light b { color: var(--turquoise); }

/* ---------- Header ---------- */
.topbar { background: var(--header-bg); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.auth { display: flex; gap: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 22px; border-radius: 20px; font-weight: 700; transition: filter .15s, background .15s; }
.pill:hover { filter: brightness(.96); }
.pill.light { background: var(--white); color: var(--brand); }
.pill.ink { background: rgba(255, 255, 255, .1); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45); }
.pill.ink:hover { background: rgba(255, 255, 255, .2); filter: none; }
.pill[aria-current="page"] { box-shadow: inset 0 0 0 2px var(--turquoise); }

.navbar { background: var(--nav-bg); }
.navbar .container { display: flex; align-items: stretch; height: 48px; padding: 0 calc(var(--gutter) - 18px); overflow-x: auto; scrollbar-width: none; }
.navbar .container::-webkit-scrollbar { display: none; }
.nav-item { display: flex; align-items: center; gap: 6px; padding: 0 18px; color: var(--white); font-weight: 700; font-size: 14px; white-space: nowrap; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, .1); }
.nav-item[aria-current="page"] { background: rgba(255, 255, 255, .14); box-shadow: inset 0 -3px 0 var(--turquoise); }
.nav-item .ic.xs { color: var(--on-brand-muted); }
.vdiv { width: 1px; flex: none; background: rgba(255, 255, 255, .2); }

/* Phone menu: the ☰ button only shows on phones, where the menu bar folds into it (see the 640px rules below) */
.site-header { position: relative; z-index: 40; }
.menu-toggle {
  display: none; width: 40px; height: 40px; flex: none; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: var(--white); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}
.menu-toggle:hover { background: rgba(255, 255, 255, .2); }
.menu-toggle .ic { width: 22px; height: 22px; }
.menu-toggle .close-icon, .nav-open .menu-toggle .open-icon { display: none; }
.nav-open .menu-toggle .close-icon { display: block; }

/* Language menu (header and footer) */
.lang-select { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lang-select select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit;
  font-weight: 700; padding: 0 18px 0 0; cursor: pointer;
}
.lang-select select:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
.lang-select select option { color: var(--ink); }
.lang-select .ic.xs { position: absolute; right: 18px; pointer-events: none; }
.lang-select--footer .ic.xs { right: 0; color: var(--on-brand-muted); }

/* ---------- Hero (car search) ---------- */
.hero {
  position: relative; overflow: hidden; padding: 64px 0 72px;
  background:
    repeating-linear-gradient(90deg, rgba(23, 49, 52, .05) 0 6px, transparent 6px 18px),
    linear-gradient(160deg, var(--turquoise-300) 0%, var(--turquoise) 45%, var(--turquoise-600) 100%);
}
.hero .painted, .page-hero .painted {
  position: absolute; left: 34%; top: 40px; transform: rotate(4deg);
  font: italic 900 250px/1 var(--font); color: rgba(255, 255, 255, .22); white-space: nowrap; user-select: none; pointer-events: none;
}
.search-panel {
  position: relative; max-width: 1000px; margin: 0 auto;
  background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.panel-head .ic { width: 22px; height: 22px; color: var(--accent-ink); }
.panel-head h1 { color: var(--text-primary); font-size: 20px; line-height: 26px; font-weight: 900; }
.search-body { padding: 20px 24px 24px; }

/* Car search in the home page hero: make, model, generation and years — or a VIN */
.car-search {
  display: grid; gap: 12px; align-items: center;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .6fr) minmax(0, .6fr) auto minmax(0, 2fr);
  grid-template-areas:
    "make model model or  vin"
    "gen  from  to    .   actions";
}
.cs-make { grid-area: make; }
.cs-model { grid-area: model; }
.cs-gen { grid-area: gen; }
.cs-from { grid-area: from; }
.cs-to { grid-area: to; }
.cs-or { grid-area: or; padding: 0 8px; color: var(--muted); text-align: center; }
.cs-vin { grid-area: vin; padding-right: 4px; }
.cs-vin input { letter-spacing: .3px; }
.cs-vin input::placeholder { letter-spacing: 0; }
.cs-vin-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--accent-ink); }
.cs-vin-btn:hover { background: var(--paper); }
.cs-vin-btn .ic { width: 20px; height: 20px; }
.cs-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0; }
.cs-actions .btn { height: 44px; min-width: 220px; }
.cs-reset { padding: 4px 0; border: 0; background: none; color: var(--accent-ink); font-weight: 700; }
.cs-reset:hover { text-decoration: underline; }
/* VIN search in the header, on car pages (between the logo and the Log In / Admin panel buttons) */
.header-search {
  flex: 1; max-width: 560px; height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 18px;
  border-radius: 21px; background: var(--white); transition: box-shadow .15s;
}
.header-search:focus-within { box-shadow: 0 0 0 3px rgba(29, 206, 216, .6); }
.header-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text-primary); letter-spacing: .3px; }
.header-search input::placeholder { color: var(--muted); letter-spacing: 0; }
.header-search button { width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: var(--white); }
.header-search button:hover { background: var(--brand-600); }
.select {
  width: 100%; height: 44px; padding: 0 36px 0 14px; appearance: none; -webkit-appearance: none;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface) no-repeat right 12px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E6F71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
}
.select:disabled { opacity: .55; cursor: not-allowed; }
.select:focus, .field:focus-within { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.field { display: flex; align-items: center; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); }
.field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.field input::placeholder { color: var(--muted); }
.field .ic { color: var(--accent-ink); width: 18px; height: 18px; }

/* ---------- Showcase ---------- */
.listings { padding-top: 40px; padding-bottom: 64px; scroll-margin-top: 16px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-head h2 { color: var(--text-primary); font-size: 22px; line-height: 28px; font-weight: 700; }
.count { padding: 1px 9px; border: 1px solid var(--accent-ink); border-radius: 999px; color: var(--accent-ink); font-size: 12px; font-weight: 700; line-height: 16px; }
.section-head [data-show-all] { margin-left: auto; }
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }

.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-card); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-body { display: grid; gap: 10px; padding: 12px; }
.card h3 { color: var(--text-primary); font-size: 16px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-radius: 6px; background: var(--green-tint); }
.price-row span { color: var(--muted); font-size: 12px; }
.price-row strong { color: var(--success-ink); font-size: 16px; line-height: 20px; }
.card-media { position: relative; }
.card-media .status-tag { position: absolute; top: 10px; left: 10px; z-index: 3; }

.status-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-tag--available { background: var(--green-tint); color: var(--success-ink); }
.status-tag--reserved { background: var(--brand-tint); color: var(--brand); }
.status-tag--sold { background: var(--ink); color: var(--white); }

.empty-state {
  display: grid; justify-items: center; gap: 16px; padding: 72px 24px; text-align: center;
  background: var(--surface); border: 2px dashed var(--border-strong); border-radius: 16px;
}
.empty-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--accent-ink); }
.empty-icon .ic { width: 38px; height: 38px; stroke-width: 1.75; }
.empty-state h2 { color: var(--text-primary); font-size: 32px; line-height: 40px; font-weight: 900; }

/* Photo: real image, or a placeholder until photos are added */
.photo { position: relative; aspect-ratio: 248 / 170; overflow: hidden; background: linear-gradient(180deg, var(--g1), var(--g2)); }
.photo::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 33%; background: rgba(23, 49, 52, .12); }
.photo::after { content: ""; position: absolute; left: 50%; bottom: 20%; width: 55%; height: 6%; transform: translateX(-50%); border-radius: 50%; background: rgba(23, 49, 52, .22); }
.photo .car { position: absolute; left: 50%; bottom: 21%; width: 56%; height: auto; aspect-ratio: 2 / 1; transform: translateX(-50%); opacity: .92; z-index: 1; }
.photo .wm { position: absolute; left: 10px; bottom: 8px; z-index: 2; color: rgba(255, 255, 255, .9); font: italic 900 11px/1 var(--font); }
.photo.has-img { background: var(--paper-300); }
.photo.has-img::before, .photo.has-img::after { display: none; }
.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.t-sky { --g1: #BDF1F4; --g2: var(--turquoise-600); }
.t-sunset { --g1: #FFD2AE; --g2: #E8803A; }
.t-dusk { --g1: #7FD9DF; --g2: #0E6E75; }
.t-sand { --g1: #FFF1C2; --g2: #C9A96A; }
.t-forest { --g1: #B6F2C8; --g2: #2FA85A; }
.t-studio { --g1: #F7F8FB; --g2: #B9BFCC; }
.t-night { --g1: #2A5A5E; --g2: #102426; }

/* ---------- Popular makes ---------- */
.makes { background: var(--surface); padding: 44px 0 52px; }
.makes .section-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.make-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.make {
  width: 104px; height: 100px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; line-height: 16px; transition: border-color .15s, box-shadow .15s;
}
.make:hover { border-color: var(--brand); box-shadow: var(--shadow-card); }
/* Logos keep their own shape: round ones fill the height, wide ones (e.g. Dodge) use the full width */
.make-logo { width: 72px; height: 40px; object-fit: contain; transition: transform .15s; }
.make:hover .make-logo { transform: scale(1.08); }
.make .mono { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--paper); color: var(--ink); font-weight: 700; }

/* ---------- Car details page ---------- */
.bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.crumbs .container { display: flex; align-items: center; gap: 8px; min-height: 44px; flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--muted); }
.crumbs a { color: var(--text); font-weight: 700; }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs .current { color: var(--accent-ink); }

.titlebar .container { display: flex; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.name-row h1 { color: var(--text-primary); font-size: 26px; line-height: 32px; font-weight: 900; text-transform: uppercase; }
.vin-chip { padding: 3px 8px; border-radius: 4px; background: var(--chip); font-size: 12px; line-height: 16px; font-weight: 700; }
.meta { display: flex; gap: 24px; margin-top: 8px; font-size: 12px; line-height: 16px; }
.meta em { font-style: normal; color: var(--muted); margin-right: 6px; }
.watch { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); font-weight: 700; }
.watch[aria-pressed="true"] { color: var(--brand); border-color: var(--brand); background: var(--brand-tint); }
.watch[aria-pressed="true"] .ic { fill: currentColor; }

/* Car page: photos on the left (they stay in view while you scroll), everything else on the right */
.lot-main { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, 1fr); gap: 20px; align-items: start; padding-top: 20px; padding-bottom: 48px; }
.lot-gallery { position: sticky; top: 16px; }
.lot-details { display: grid; gap: 16px; min-width: 0; }
.stack { display: grid; gap: 16px; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.box-pad { padding: 16px; }
.box h3 { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 16px; line-height: 22px; font-weight: 700; }
.box-head { padding: 14px 16px 0; }

.gallery { padding: 12px; display: grid; gap: 10px; min-width: 0; }
.main-photo-wrap { position: relative; touch-action: pan-y; }
.main-photo { aspect-ratio: 4 / 3; border-radius: 8px; }
.gallery-nav {
  position: absolute; top: 50%; z-index: 4; width: 44px; height: 44px; margin-top: -22px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: var(--shadow-card); transition: background .15s, color .15s;
}
.gallery-nav:hover { background: var(--white); color: var(--brand); }
.gallery-nav .ic { width: 24px; height: 24px; }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px; z-index: 4; padding: 3px 10px; border-radius: 999px;
  background: rgba(23, 49, 52, .75); color: var(--white); font-size: 12px; line-height: 18px; font-weight: 700;
}
.main-photo-wrap .photo.has-img { cursor: zoom-in; }
.gallery-expand {
  position: absolute; top: 12px; right: 12px; z-index: 4; width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 10px; background: rgba(255, 255, 255, .92); color: var(--ink); box-shadow: var(--shadow-card); transition: background .15s, color .15s;
}
.gallery-expand:hover { background: var(--white); color: var(--brand); }
.gallery-expand .ic { width: 20px; height: 20px; }

/* Full-screen photo viewer (js/home.js) */
html.viewer-open { overflow: hidden; }
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0B0B14; color: var(--white);
}
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer::backdrop { background: #0B0B14; }
.viewer-top { display: flex; align-items: center; gap: 16px; padding: 12px 16px; }
.viewer-count { min-width: 48px; color: rgba(255, 255, 255, .75); font-weight: 700; }
.viewer-title { flex: 1; min-width: 0; text-align: center; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-btn, .viewer-nav {
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: var(--white); transition: background .15s;
}
.viewer-btn:hover, .viewer-nav:hover { background: rgba(255, 255, 255, .24); }
.viewer-btn { width: 44px; height: 44px; flex: none; }
.viewer-btn .ic { width: 22px; height: 22px; }
.viewer-stage { position: relative; min-height: 0; }
/* The photo fills the space between the arrows and is scaled to fit without cropping */
.viewer-img { position: absolute; top: 0; left: 84px; width: calc(100% - 168px); height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.viewer-nav { position: absolute; top: 50%; width: 56px; height: 56px; margin-top: -28px; }
.viewer-nav .ic { width: 28px; height: 28px; }
.viewer-nav.prev { left: 16px; }
.viewer-nav.next { right: 16px; }
.viewer-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 16px; scrollbar-width: thin; }
.viewer-thumbs > :first-child { margin-left: auto; }   /* centred while they fit, scrollable when they don't */
.viewer-thumbs > :last-child { margin-right: auto; }
.viewer-thumbs button { flex: 0 0 76px; height: 56px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: none; opacity: .5; outline: 2px solid transparent; outline-offset: -2px; transition: opacity .15s; }
.viewer-thumbs button:hover { opacity: .85; }
.viewer-thumbs button[aria-current] { opacity: 1; outline-color: var(--turquoise); }
.viewer-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Thumbnails: one row that scrolls sideways */
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.thumb { flex: 0 0 96px; padding: 0; border: 3px solid transparent; background: none; border-radius: 8px; overflow: hidden; transition: border-color .15s; }
.thumb .photo { aspect-ratio: 104 / 72; border-radius: 5px; }
.thumb .photo .wm { display: none; }
.thumb:hover { border-color: var(--brand-100); }
.thumb.active { border-color: var(--brand); }   /* the photo you're looking at, in the header colour */

.kv-list { padding: 4px 16px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); }
.kv b { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 65%; color: var(--text-primary); font-weight: 700; text-align: right; }
.kv .good { color: var(--success-ink); }
.kv .warn { color: var(--warn-ink); }
.copy { display: inline-flex; padding: 0; border: 0; background: none; color: var(--muted); }
.copy:hover { color: var(--accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; background: var(--chip); font-size: 12px; line-height: 16px; font-weight: 700; }
.chip.ok { background: var(--green-tint); color: var(--success-ink); }
.chip.ok .ic { color: var(--turquoise-ink); }
.description p { padding: 10px 16px 16px; white-space: pre-line; line-height: 22px; }

.price-card { display: grid; gap: 14px; }
.price-card .label { color: var(--muted); font-size: 12px; line-height: 16px; }
.price-card .amount { color: var(--text-primary); font-size: 30px; line-height: 36px; font-weight: 900; }
.price-card .actions { display: grid; gap: 10px; }
.not-found { padding-top: 48px; padding-bottom: 64px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--white); }
.footer-main { display: flex; gap: 48px; padding: 44px 0; }
.footer-brand { display: grid; gap: 20px; align-content: start; padding-right: 48px; border-right: 1px solid rgba(255, 255, 255, .15); }
.socials { display: flex; gap: 8px; flex-wrap: wrap; }
.socials a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); font-size: 12px; }
.socials a:hover { background: rgba(255, 255, 255, .2); }
.link-cols { flex: 1; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.link-cols h4 { margin: 0 0 12px; color: var(--white); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.link-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.link-cols a:hover { color: var(--turquoise); }
.footer-bottom { background: var(--footer-bottom); font-size: 12px; }
.footer-bottom .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--turquoise); }

/* ---------- Auth pages (login / register) ---------- */
.auth-main { padding: 48px 0 72px; }
.auth-card {
  display: grid; grid-template-columns: 400px minmax(0, 1fr); max-width: 980px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-pop);
}
.auth-aside {
  display: flex; flex-direction: column; gap: 28px; padding: 40px; color: var(--ink);
  background:
    repeating-linear-gradient(90deg, rgba(23, 49, 52, .05) 0 6px, transparent 6px 18px),
    linear-gradient(160deg, var(--turquoise-300) 0%, var(--turquoise) 45%, var(--turquoise-600) 100%);
}
.auth-intro { display: grid; gap: 8px; }
.auth-intro h2 { font-size: 28px; line-height: 34px; font-weight: 900; }
.auth-intro p { color: var(--ink-700); font-size: 15px; line-height: 22px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.perks li { display: flex; align-items: flex-start; gap: 12px; }
.perks .tick { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--white); color: var(--turquoise-ink); }
.perks b { display: block; color: var(--ink); }
.perks small { display: block; color: var(--ink-700); font-size: 13px; line-height: 18px; }
.auth-aside .photo { margin-top: auto; border-radius: 12px; aspect-ratio: 16 / 10; box-shadow: var(--shadow-card); }

.auth-form { display: grid; gap: 20px; align-content: start; padding: 40px 48px 44px; }
.auth-form h1 { color: var(--text-primary); font-size: 28px; line-height: 34px; font-weight: 900; }
.auth-form .sub { margin-top: 6px; color: var(--muted); }
.link { color: var(--accent-ink); font-weight: 700; }
.link:hover { text-decoration: underline; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: grid; gap: 6px; align-content: start; }
.form-field > label:not(.check), .form-label-row label { color: var(--text-primary); font-size: 13px; line-height: 18px; font-weight: 700; }
.form-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.form-label-row .link { font-size: 13px; }
.optional { color: var(--muted); font-weight: 400; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .ic { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.input {
  width: 100%; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text-primary); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.input.has-toggle { padding-right: 48px; }
.reveal { position: absolute; right: 6px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.reveal:hover { background: var(--paper); color: var(--ink); }
.hint { color: var(--muted); font-size: 12px; line-height: 16px; }
.field-error { display: none; color: var(--danger); font-size: 12px; line-height: 16px; font-weight: 700; }
.form-field.invalid .input { border-color: var(--danger); }
.form-field.invalid .input:focus { box-shadow: 0 0 0 3px rgba(194, 65, 12, .2); }
.form-field.invalid .field-error { display: block; }
.form-field.invalid .hint { display: none; }

.strength { display: flex; align-items: center; gap: 10px; }
.strength .bars { flex: 1; display: flex; gap: 4px; }
.strength .bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .2s; }
.strength-label { min-width: 44px; text-align: right; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 700; }
.strength[data-level="1"] .bars i:nth-child(-n+1) { background: var(--danger); }
.strength[data-level="2"] .bars i:nth-child(-n+2) { background: var(--amber); }
.strength[data-level="3"] .bars i:nth-child(-n+3) { background: var(--turquoise); }
.strength[data-level="4"] .bars i { background: var(--green); }

.check { display: flex; align-items: flex-start; gap: 10px; line-height: 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--turquoise-ink); cursor: pointer; }
.form-status { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 8px; background: var(--green-tint); color: var(--success-ink); font-weight: 700; }
.form-status .ic { margin-top: 2px; }

/* ---------- Admin panel ---------- */
.admin-bar { background: var(--brand); color: var(--white); }
.admin-bar .container { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.admin-bar .logo { font-size: 22px; }
.admin-bar .logo .mark { width: 34px; height: 34px; border-radius: 8px; }
.admin-tag { padding: 2px 8px; border-radius: 4px; background: var(--turquoise); color: var(--ink); font-size: 12px; font-weight: 700; }
.admin-bar a:not(.logo):hover { color: var(--turquoise); }
.admin-user { color: var(--on-brand-muted); font-size: 13px; }
.btn-on-dark { border-color: rgba(255, 255, 255, .45); background: transparent; color: var(--white); }
.btn-on-dark:hover { background: rgba(255, 255, 255, .12); }

.admin-main { display: grid; gap: 20px; padding-top: 32px; padding-bottom: 64px; }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); }
.admin-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 12px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font-weight: 700; }
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--text-primary); border-bottom-color: var(--brand); }
.message-list { display: grid; gap: 12px; }
.message { padding: 16px 20px; display: grid; gap: 10px; }
.message-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.message-head > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.message-head b { color: var(--text-primary); font-size: 16px; }
.message-head small { color: var(--muted); }
.message-meta { display: flex; gap: 8px 20px; flex-wrap: wrap; }
.message-meta a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 700; }
.message-meta a:hover { text-decoration: underline; }
.message-body { white-space: pre-line; line-height: 22px; color: var(--text-primary); }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-head h1 { display: flex; align-items: center; gap: 10px; color: var(--text-primary); font-size: 26px; line-height: 32px; font-weight: 900; }

/* Search and filters above the car list and the messages */
.admin-toolbar {
  display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(0, 200px)) auto; gap: 10px; align-items: center; margin-bottom: 12px;
}
#messageTools { grid-template-columns: minmax(220px, 1fr) minmax(0, 240px) auto; }
.admin-search { gap: 10px; background: var(--surface); }
.admin-results { margin: -4px 0 12px; color: var(--muted); font-weight: 700; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent-ink); font-weight: 700; }
.link-btn:hover { text-decoration: underline; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--surface-muted); }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.table-thumb { width: 84px; border-radius: 6px; overflow: hidden; }
.table-thumb .photo { aspect-ratio: 4 / 3; }
.table-thumb .photo .wm { display: none; }
.table-empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; }
.icon-btn { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

.editor { display: grid; gap: 20px; }
.form-section { display: grid; gap: 16px; }
.form-section.invalid > .field-error { display: block; }
.form-section h2 { color: var(--text-primary); font-size: 18px; line-height: 24px; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.req { color: var(--danger); }
.input--plain { height: 44px; padding: 0 14px; }
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 20px; resize: vertical; }
.input-group { display: flex; gap: 8px; }
.input-group .select { width: 88px; flex: none; }
.form-field.invalid .select { border-color: var(--danger); }
.form-alert { padding: 12px 14px; border-radius: 8px; background: var(--danger-tint); color: var(--danger); font-weight: 700; }

.dropzone {
  display: grid; justify-items: center; gap: 6px; padding: 28px 20px; text-align: center; cursor: pointer;
  border: 2px dashed var(--border-strong); border-radius: 10px; background: var(--surface-muted); transition: border-color .15s, background .15s;
}
.dropzone .ic { width: 32px; height: 32px; color: var(--accent-ink); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #E9FAFB; }
.dropzone:focus-within { box-shadow: var(--focus-ring); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.photo-grid:empty { display: none; }
.photo-item { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--paper); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .cover-tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: var(--brand); color: var(--white); font-size: 11px; font-weight: 700; }
.photo-item .tools { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.photo-item .tools button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: rgba(23, 49, 52, .8); color: var(--white); }
.photo-item .tools button:hover:not(:disabled) { background: var(--ink); }
.photo-item .tools button:disabled { opacity: .35; cursor: default; }
.photo-item.uploading img { opacity: .5; }
.photo-item .spinner { position: absolute; top: 50%; left: 50%; margin: -14px 0 0 -14px; }
.photo-item.failed { border: 2px solid var(--danger); }
.photo-item .photo-error { position: absolute; left: 0; right: 0; top: 0; padding: 6px 8px; background: var(--danger); color: var(--white); font-size: 11px; font-weight: 700; line-height: 14px; }

.spinner { width: 28px; height: 28px; border: 3px solid rgba(23, 49, 52, .2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.editor-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 12px; padding: 14px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 -6px 20px rgba(23, 49, 52, .08);
}
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translateX(-50%); max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 8px; background: var(--ink); color: var(--white); font-weight: 700; box-shadow: var(--shadow-pop);
  animation: toast-in .18s ease-out;
}
.toast .ic { color: var(--green); }
.toast.error { background: var(--danger); color: var(--white); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- Content pages (How it works, Help, About, Contact, Follow us) ---------- */
.page-hero {
  position: relative; overflow: hidden; padding: 56px 0 60px;
  background:
    repeating-linear-gradient(90deg, rgba(23, 49, 52, .05) 0 6px, transparent 6px 18px),
    linear-gradient(160deg, var(--turquoise-300) 0%, var(--turquoise) 45%, var(--turquoise-600) 100%);
}
.page-hero .painted { top: -20px; }
.page-hero h1 { position: relative; color: var(--ink); font-size: 40px; line-height: 48px; font-weight: 900; }
.page-hero p { position: relative; max-width: 680px; margin-top: 12px; color: var(--ink-700); font-size: 17px; line-height: 26px; }
.page-section { padding: 56px 0; }
.page-section.alt { background: var(--surface); }
.container.narrow { max-width: calc(960px + 2 * var(--gutter)); }
.section-intro { display: grid; gap: 8px; margin-bottom: 28px; }
.section-intro h2 { color: var(--text-primary); font-size: 26px; line-height: 32px; font-weight: 900; }
.section-intro p { color: var(--muted); font-size: 16px; line-height: 24px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.step, .value, .social-card {
  position: relative; display: grid; gap: 10px; align-content: start; padding: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-card);
}
.step-num { position: absolute; top: 14px; right: 18px; color: var(--paper-300); font: 900 44px/1 var(--font); }
.step-icon, .value-icon, .social-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
.step-icon .ic, .value-icon .ic, .social-icon .ic { width: 24px; height: 24px; }
.step-icon { background: var(--brand); color: var(--white); }
.value-icon { background: var(--turquoise); }
.step h2, .value h3, .social-card h2 { color: var(--text-primary); font-size: 18px; line-height: 24px; font-weight: 900; }
.step p, .value p { line-height: 22px; }

.glossary { margin: 0; overflow: hidden; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; }
.glossary > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.glossary > div:last-child { border-bottom: 0; }
.glossary dt { color: var(--text-primary); font-weight: 900; }
.glossary dd { margin: 0; line-height: 22px; }

.status-list { display: grid; gap: 12px; }
.status-item { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.status-item .status-tag { flex: none; min-width: 112px; justify-content: center; }

.cta-band { padding: 56px 0; background: var(--brand); color: var(--white); }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band h2 { font-size: 28px; line-height: 34px; font-weight: 900; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Help: FAQ */
.faq-group { margin: 36px 0 12px; color: var(--text-primary); font-size: 20px; line-height: 26px; font-weight: 900; }
.faq-group:first-child { margin-top: 0; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.faq details[open] { border-color: var(--border-strong); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px;
  color: var(--text-primary); font-weight: 700; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; color: var(--accent-ink); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 18px; line-height: 22px; }
.help-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 40px; padding: 24px;
  background: var(--brand-tint); border: 1px solid var(--brand-100); border-radius: 12px;
}
.help-cta h2 { color: var(--text-primary); font-size: 20px; line-height: 26px; font-weight: 900; }
.help-cta p { margin-top: 4px; }

/* About */
.values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 28px; }
.check-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 22px; }
.check-list .ic { margin-top: 3px; color: var(--success-ink); }

/* Contact */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.contact-form { display: grid; gap: 18px; padding: 28px; }
.contact-form h2, .contact-info h2 { color: var(--text-primary); font-size: 20px; line-height: 26px; font-weight: 900; }
.contact-form .btn { justify-self: start; }
.select--lg { height: 48px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status.error { background: var(--danger-tint); color: var(--danger); }
.contact-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; }
.contact-list li { display: flex; align-items: flex-start; gap: 12px; }
.contact-list small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.contact-list a, .contact-list span { color: var(--text-primary); font-weight: 700; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent-ink); }
.ci-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--paper); color: var(--accent-ink); }
.follow-teaser { display: flex; align-items: center; gap: 12px; transition: border-color .15s; }
.follow-teaser:hover { border-color: var(--accent); }
.follow-teaser div { flex: 1; }
.follow-teaser b { display: block; color: var(--text-primary); }
.follow-teaser small { color: var(--muted); }

/* Follow us */
.social-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 820px; }
.social-card { justify-items: start; }
.social-card p { min-height: 44px; line-height: 22px; overflow-wrap: anywhere; }
.social-card .btn { margin-top: 4px; }
.social-icon--telegram { background: var(--turquoise); }
.social-icon--email { background: var(--brand); color: var(--white); }

/* ---------- Legal pages (Privacy, Terms, Cookies) ---------- */
.legal { max-width: 760px; color: var(--text-primary); font-size: 15px; line-height: 24px; }
.legal-intro { font-size: 17px; line-height: 27px; }
.legal h2 { margin: 36px 0 10px; font-size: 20px; line-height: 26px; font-weight: 900; }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0 0 12px; padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal-contact { list-style: none; padding: 0 !important; }
.legal-contact b { display: inline-block; min-width: 90px; }
.legal .link, .legal-contact a { color: var(--accent-ink); font-weight: 700; }
.table-scroll { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.legal-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.legal-table th, .legal-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table th { background: var(--surface-muted); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.legal code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--chip); padding: 2px 6px; border-radius: 4px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 24px; bottom: 24px; z-index: 60; width: min(480px, calc(100% - 32px));
  display: grid; gap: 10px; padding: 20px 22px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow-pop);
}
.cookie-banner h2 { color: var(--text-primary); font-size: 18px; line-height: 24px; font-weight: 900; }
.cookie-banner p { line-height: 21px; }
.cookie-banner .link { justify-self: start; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.cookie-actions .btn { flex: 1; }

/* ---------- Header while the admin is logged in ---------- */
button.pill { border: 0; cursor: pointer; }
button.pill:disabled { opacity: .7; cursor: default; }

/* ---------- "Remove listing" button and pop-up ---------- */
.btn-remove { background: var(--surface); border-color: rgba(194, 65, 12, .35); color: var(--danger); }
.btn-remove:hover { background: var(--danger-tint); border-color: var(--danger); }
.modal {
  width: min(460px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
.modal::backdrop { background: rgba(23, 49, 52, .55); }
.modal-body { position: relative; display: grid; gap: 14px; justify-items: start; padding: 28px; }
.modal-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--danger-tint); color: var(--danger); }
.modal-icon .ic { width: 24px; height: 24px; }
.modal h2 { color: var(--text-primary); font-size: 22px; line-height: 28px; font-weight: 900; }
.modal p { font-size: 15px; line-height: 23px; }
.modal-car { display: grid; gap: 2px; width: 100%; padding: 12px 14px; border-radius: 10px; background: var(--paper); }
.modal-car b { color: var(--text-primary); }
.modal-car span { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.modal-options { display: grid; gap: 10px; width: 100%; }
.modal-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); color: var(--text-primary); transition: border-color .15s, background .15s;
}
.modal-option:hover { border-color: var(--brand); background: var(--brand-tint); }
.modal-option > .ic { color: var(--muted); }
.opt-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--turquoise); color: var(--ink); }
.modal-option--email .opt-icon { background: var(--brand); color: var(--white); }
.opt-text { flex: 1; min-width: 0; display: grid; }
.opt-text small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.modal-actions { display: flex; gap: 10px; justify-self: stretch; justify-content: flex-end; flex-wrap: wrap; }
.modal-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.modal-x:hover { background: var(--paper); color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  :root { --gutter: 32px; }
  .lot-main { grid-template-columns: 1fr; }
  .lot-gallery { position: static; }
  .steps, .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  /* The header search moves to its own row under the logo and buttons */
  .topbar-inner { flex-wrap: wrap; }
  .topbar-inner:has(.header-search:not([hidden])) { row-gap: 12px; padding-top: 14px; padding-bottom: 14px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-main { flex-direction: column; }
  .footer-brand { border-right: 0; padding-right: 0; }
  .titlebar .container { flex-wrap: wrap; }
  .auth-card { grid-template-columns: 1fr; max-width: 560px; }
  .auth-aside { display: none; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .glossary > div { grid-template-columns: 1fr; gap: 4px; }
  .admin-toolbar, #messageTools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .car-search {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "make model" "gen gen" "from to" "actions actions" "or or" "vin vin";
  }
  .cs-or { padding: 0; }
  .cs-actions .btn { flex: 1; min-width: 0; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  /* Phone menu: the menu bar becomes a list that opens under the header from the ☰ button */
  .topbar-inner { gap: 10px; }
  .auth { margin-left: auto; gap: 8px; }
  .menu-toggle { display: grid; }
  .navbar { display: none; position: absolute; top: 100%; left: 0; right: 0; box-shadow: 0 14px 28px rgba(3, 1, 100, .35); }
  .nav-open .navbar { display: block; }
  .navbar .container { flex-direction: column; align-items: stretch; height: auto; padding: 6px 0 10px; overflow: visible; }
  .navbar .vdiv, .navbar .grow { display: none; }
  .nav-item { min-height: 50px; padding: 0 var(--gutter); font-size: 16px; }
  .nav-item[aria-current="page"] { box-shadow: inset 4px 0 0 var(--turquoise); }
  .navbar .lang-select { margin-top: 6px; border-top: 1px solid rgba(255, 255, 255, .15); }
  .navbar .lang-select select { flex: 1; min-height: 50px; }
  .navbar .lang-select .ic.xs { right: var(--gutter); }
  .page-hero { padding: 36px 0 40px; }
  .page-hero h1 { font-size: 30px; line-height: 36px; }
  .page-hero .painted { font-size: 140px; }
  .page-section { padding: 40px 0; }
  .steps, .values, .social-grid, .check-list { grid-template-columns: 1fr; }
  .status-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cta-band h2 { font-size: 22px; line-height: 28px; }
  .contact-form { padding: 20px; }
  .logo { font-size: 22px; }
  .logo .mark { width: 36px; height: 36px; }
  .pill span { display: none; }
  .pill { padding: 0 12px; }
  .hero { padding: 32px 0 40px; }
  .hero .painted { font-size: 140px; }
  .search-body { padding: 16px; }
  .gallery-nav { width: 38px; height: 38px; margin-top: -19px; }
  .gallery-expand { width: 36px; height: 36px; top: 10px; right: 10px; }
  /* Full-screen viewer on phones: the photo uses the whole width, arrows sit on top of it */
  .viewer-img { left: 0; width: 100%; }
  .viewer-nav { width: 44px; height: 44px; margin-top: -22px; background: rgba(0, 0, 0, .45); }
  .viewer-nav.prev { left: 8px; }
  .viewer-nav.next { right: 8px; }
  .viewer-thumbs button { flex-basis: 64px; height: 48px; }
  .thumb { flex-basis: 76px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .empty-state { padding: 48px 20px; }
  .empty-state h2 { font-size: 26px; line-height: 32px; }
  .section-head h2 { font-size: 18px; line-height: 24px; }
  .meta { flex-wrap: wrap; gap: 8px 16px; }
  .footer-bottom .container { justify-content: center; text-align: center; }
  .cookie-banner { left: 16px; bottom: 16px; padding: 18px; }
  .legal-contact b { display: block; }
  .auth-main { padding: 24px 0 48px; }
  .auth-form { padding: 28px 20px 32px; }
  .form-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .table .hide-sm { display: none; }
  .admin-head h1 { font-size: 22px; line-height: 28px; }
}
@media (max-width: 420px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .logo { font-size: 19px; gap: 8px; }
  .logo .mark { width: 32px; height: 32px; }
}
