/* carscroll.ch — styles communs (d'après la maquette) */
:root {
  --brand: #0F1F3D;
  --brand-dark: #0A1630;
  --side: #1C2F54;
  --primary: #0A6BC8;
  --primary-dark: #08529A;
  --primary-light: #E6F1FA;
  --ink: #0F172A;
  --ink-soft: #334155;
  --muted: #64748B;
  --muted-dark: #475569;
  --line: #D3DDEA;
  --bg: #EAF0F7;
  --boost: #F59E0B;
  --boost-dark: #B45309;
  --success: #166534;
  --success-bg: #E7F6EC;
  --danger: #991B1B;
  --warn-bg: #FEF3C7;
  --warn: #78350F;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--primary); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Mise en page : menu à gauche, contenu à droite ---------- */
.layout { display: flex; min-height: 100vh; }
.layout.dark { background: var(--brand-dark); color: #fff; }
.content { flex: 1; min-width: 0; }

.side {
  width: 260px; flex-shrink: 0; background: var(--brand); color: #fff;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .logo { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 8px 18px; color: #fff; }
.side .logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; }
.side .logo-text { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.side .nav { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 12px; text-decoration: none; font-size: 15px; color: #D9DEE6; font-weight: 600; }
.side .nav:hover { background: var(--side); color: #fff; }
.side .nav.on { background: var(--side); color: #fff; font-weight: 800; }
.side .cta { margin-top: 14px; display: flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 12px; background: var(--primary); color: #fff; text-decoration: none; font-weight: 800; font-size: 15px; }
.side .cta:hover { background: var(--primary-dark); color: #fff; }
.side .foot { margin-top: auto; padding: 18px 8px 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.side .foot a { color: #9CC7F2; }
.side .foot span { color: #8A97AD; width: 100%; }

/* Téléphone : barre en bas */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; width: 100%; height: auto; z-index: 50; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 2px; justify-content: space-around; }
  .side .logo, .side .foot, .side .cta { display: none; }
  .side .nav { flex-direction: column; gap: 2px; min-height: 52px; padding: 4px 6px; font-size: 11px; flex: 1; justify-content: center; }
  .content { padding-bottom: 72px; }
}

/* ---------- Éléments communs ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; }
.h1 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: -0.6px; }
.lead { margin: 6px 0 0; font-size: 16px; color: var(--muted-dark); }
.card { background: #fff; border-radius: 20px; padding: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--primary); color: #fff; font: 800 15px Inter, sans-serif; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-soft); font: 700 13.5px Inter, sans-serif; cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.boost { background: var(--boost); color: #fff; }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted-dark); }
.spinner { width: 34px; height: 34px; border-radius: 999px; border: 3px solid rgba(10,107,200,0.2); border-top-color: var(--primary); animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700; font-size: 14px; z-index: 100; box-shadow: 0 8px 30px rgba(0,0,0,0.25); }
@media (max-width: 860px) { .toast { bottom: 90px; } }

/* ---------- Grille d'annonces ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { background: #fff; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15,31,61,0.12); color: var(--ink); }
.tile .ph { position: relative; aspect-ratio: 4 / 3; background: #CBD5E1; }
.tile .ph img { width: 100%; height: 100%; object-fit: cover; }
.tile .ph .tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.tile .ph .vid { position: absolute; right: 8px; bottom: 8px; background: rgba(15,23,42,0.75); color: #fff; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.tile .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.tile .price { font-size: 18px; font-weight: 900; color: var(--primary); }
.tile .price.drop { color: #DC2626; }
.tile .old { font-size: 12.5px; color: var(--muted); text-decoration: line-through; font-weight: 600; margin-left: 6px; }
.tile .title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Photo absente : dessin neutre */
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #24406E, #0A1630); color: #9CC7F2; font-weight: 800; font-size: 14px; }
