*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  font-size: 14px;
  background: #f0f0f0;
  color: #222;
  min-height: 100vh;
}

/* ── Header ── */
.header {
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 48px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
}
.brand { font-size: 16px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }

.site-nav { display: flex; gap: 4px; }
.site-btn {
  background: transparent;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.site-btn:hover, .site-btn.active { background: #fff; color: #000; border-color: #fff; }

/* ── Filtres ── */
.filters-bar {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 48px;
  z-index: 40;
}
.search-input {
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 7px 12px;
  font-size: 13px;
  width: 220px;
}
.search-input:focus { outline: none; border-color: #000; }
.filters-bar select {
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
}
.demo-check { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.count-label { margin-left: auto; font-size: 12px; color: #666; }

/* ── Contenu ── */
.app-content { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* ── Section marque ── */
.brand-section { margin-bottom: 28px; }
.brand-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
}
.brand-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.brand-count {
  background: #000;
  color: #fff;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.brand-toggle { font-size: 12px; color: #999; margin-left: auto; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ── Card véhicule ── */
.card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow .15s, transform .1s;
  position: relative;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); transform: translateY(-1px); }

/* ── Card header ── */
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.badge-marque {
  background: #000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}
.badge-demo {
  background: #e67e22;
  color: #fff;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
}
.badge-statut {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.statut-dispo  { background: #eafaf1; color: #1a7a35; }
.statut-res    { background: #fef5e7; color: #c87000; }

/* ── Card body ── */
.card-model { font-size: 15px; font-weight: 700; line-height: 1.3; }
.card-version { font-size: 12px; color: #777; margin-top: 1px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #666;
}
.badge-vieill {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.vieill-ok   { background: #eafaf1; color: #1a7a35; }
.vieill-warn { background: #fef5e7; color: #c87000; }
.vieill-crit { background: #fee;    color: #c0392b; }

.card-couleur { display: flex; align-items: center; gap: 4px; }
.color-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15);
  display: inline-block;
  flex-shrink: 0;
}
.card-parc { font-size: 11.5px; color: #888; }
.card-km { font-size: 12px; color: #e67e22; font-weight: 600; }
.card-etat { font-size: 11px; color: #aaa; }

/* ── Prix ── */
.card-prix { margin-top: 4px; }
.prix-bloc { display: flex; flex-direction: column; gap: 2px; }
.prix-barre { font-size: 12px; color: #aaa; text-decoration: line-through; }
.prix-destock { font-size: 18px; font-weight: 700; color: #1a7a35; }
.prix-unique  { font-size: 16px; font-weight: 700; color: #222; }
.prix-vide    { font-size: 13px; color: #aaa; font-style: italic; }
.remise-badge {
  display: inline-block;
  background: #1a7a35;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}

/* ── Card footer ── */
.card-footer { margin-top: auto; padding-top: 8px; border-top: 1px solid #f0f0f0; display: flex; gap: 6px; }
.btn-galerie {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background .1s;
}
.btn-galerie:hover { background: #000; color: #fff; border-color: #000; }

/* ── Vide / chargement ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 15px;
}
.loading-state { text-align: center; padding: 60px 20px; color: #888; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .header { padding: 0 12px; }
  .filters-bar { padding: 8px 12px; }
  .app-content { padding: 12px; }
  .search-input { width: 100%; }
  .cards-grid { grid-template-columns: 1fr; }
}
