/* ============================================================
   SHOWROOM VO — identité visuelle "Affichage digital"
   Fond blanc, accent bleu vif, typographie sans-serif nette.
   Pensé pour une lisibilité maximale en plein jour sur écran
   tactile vu de loin dans le showroom.
   ============================================================ */

:root {
  --bg-0: #f7f8fa;
  --bg-1: #ffffff;
  --bg-2: #f2f4f7;
  --bg-3: #eaecf0;
  --line: #e4e7ec;
  --line-soft: #eef1f5;

  --text-hi: #1d2939;
  --text-mid: #667085;
  --text-low: #98a2b3;

  --blue: #175cd3;
  --blue-dark: #0d3f96;
  --blue-bg: #eff6ff;
  --green: #12894f;
  --green-bg: #ecfdf3;
  --line-accent: #b8d2f7;

  --radius: 14px;
  --radius-sm: 10px;

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'Inter', system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-raised: 0 4px 8px rgba(16, 24, 40, 0.06), 0 2px 4px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text-hi);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  user-select: none;
}

#app { height: 100vh; display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ================= TOPBAR ================= */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}

.brand-home {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; color: var(--text-hi);
  padding: 8px; border-radius: var(--radius-sm);
}
.brand-home:active { background: var(--bg-2); }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  background: var(--blue);
  padding: 7px 11px;
  border-radius: 8px;
  letter-spacing: 0.5px;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.2px;
  color: var(--text-hi);
}

.search-wrap { flex: 1 1 auto; max-width: 560px; }
.search-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-hi);
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 17px;
  outline: none;
}
.search-input::placeholder { color: var(--text-low); }
.search-input:focus { border-color: var(--blue); background: var(--bg-1); box-shadow: 0 0 0 4px var(--blue-bg); }

.topbar-meta { flex: 0 0 auto; margin-left: auto; }
.count-pill {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid var(--line-accent);
  padding: 8px 16px;
  border-radius: 999px;
}

/* ================= FILTERBAR ================= */
.filterbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  overflow-x: auto;
  background: var(--bg-0);
  border-bottom: 1px solid var(--line);
}
.filter-group { display: flex; gap: 10px; flex-wrap: nowrap; }
.filter-sep { width: 1px; align-self: stretch; background: var(--line); flex: 0 0 auto; }

.chip {
  flex: 0 0 auto;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-mid);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:active { transform: scale(0.97); }
.chip-active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
}

/* ================= GRID ================= */
.grid-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 28px 40px;
  background: var(--bg-0);
}
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.vcard {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.vcard:active { transform: scale(0.98); box-shadow: var(--shadow-raised); }

.vcard-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  overflow: hidden;
}
.vcard-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-photo .no-photo {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-low);
  font-size: 13px;
}
.energy-badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-mid);
}
.energy-badge.e-EL { color: var(--blue); background: var(--blue-bg); }
.energy-badge.e-HY { color: var(--green); background: var(--green-bg); }
.warranty-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
}

.vcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.vcard-brand { font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-low); font-weight: 600; }
.vcard-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-hi);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 44px;
}

.vcard-plate {
  margin-top: auto;
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.vcard-price {
  font-size: 21px;
  font-weight: 700;
  color: var(--blue);
}
.vcard-mileage {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
}

.vcard-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 500; color: var(--text-mid); background: var(--bg-2); padding: 4px 9px; border-radius: 6px; }

/* ================= EMPTY STATE ================= */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-mid); }
.empty-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--text-hi); margin-bottom: 8px; }
.empty-sub { margin-bottom: 24px; }
.btn-reset {
  background: var(--blue); color: #fff; border: none;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 16px;
}

/* ================= DETAIL VIEW ================= */
.detail-view {
  position: fixed; inset: 0;
  background: var(--bg-0);
  z-index: 50;
  display: flex;
  overflow-y: auto;
}
.detail-close {
  position: fixed; top: 20px; right: 24px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--text-hi); font-size: 20px;
  box-shadow: var(--shadow-raised);
  display: flex; align-items: center; justify-content: center;
}

.detail-gallery { flex: 1 1 58%; display: flex; flex-direction: column; background: var(--bg-1); min-width: 0; }
.gallery-main { position: relative; flex: 1 1 auto; background: var(--bg-2); display: flex; align-items: center; justify-content: center; min-height: 320px; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--text-hi); font-size: 26px;
  box-shadow: var(--shadow-raised);
}
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-counter {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 13px; font-weight: 600;
  background: var(--bg-1); border: 1px solid var(--line);
  padding: 6px 14px; border-radius: 999px; color: var(--text-mid);
  box-shadow: var(--shadow-card);
}
.gallery-thumbs { display: flex; gap: 10px; padding: 14px; overflow-x: auto; background: var(--bg-1); border-top: 1px solid var(--line-soft); }
.gallery-thumbs img {
  width: 84px; height: 60px; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; opacity: 0.55; flex: 0 0 auto;
}
.gallery-thumbs img.active { border-color: var(--blue); opacity: 1; }

.detail-info { flex: 1 1 42%; padding: 40px 44px; overflow-y: auto; min-width: 320px; background: var(--bg-0); }
.detail-eyebrow { font-size: 13px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-low); font-weight: 600; }
.detail-title { font-family: var(--font-display); font-size: 30px; font-weight: 700; line-height: 1.2; margin: 6px 0 24px; color: var(--text-hi); }

.detail-price-plate {
  display: flex; align-items: baseline; gap: 14px;
  background: var(--blue-bg); border: 1px solid var(--line-accent);
  border-radius: var(--radius-sm);
  padding: 16px 20px; margin-bottom: 28px;
}
.plate-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--blue-dark); font-weight: 600; }
.plate-value { font-size: 28px; font-weight: 700; color: var(--blue); }

.detail-specs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 28px;
}
.spec-item {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.spec-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-low); font-weight: 600; margin-bottom: 4px; }
.spec-value { font-size: 16px; font-weight: 600; color: var(--text-hi); }

.detail-warranty {
  background: var(--green-bg); border: 1px solid #a6e9c3;
  border-radius: var(--radius-sm); padding: 14px 18px; margin-bottom: 24px;
  font-size: 14px; font-weight: 500; color: var(--green);
}
.detail-warranty:empty { display: none; }

.detail-colors { display: flex; gap: 24px; font-size: 14px; color: var(--text-mid); flex-wrap: wrap; }
.detail-colors b { color: var(--text-hi); font-weight: 600; }

/* ================= SCREENSAVER ================= */
.screensaver {
  position: fixed; inset: 0; z-index: 100;
  background: var(--text-hi);
  overflow: hidden;
}
.screensaver-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: background-image 1.2s ease-in-out;
}
.screensaver-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(29,41,57,0.35) 0%, rgba(29,41,57,0.25) 45%, rgba(29,41,57,0.92) 100%);
}
.screensaver-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 60px 60px 80px;
  text-align: center;
}
.screensaver-eyebrow { font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; color: #8fbaf7; font-weight: 700; margin-bottom: 14px; }
.screensaver-title { font-family: var(--font-display); font-size: 48px; font-weight: 800; line-height: 1.15; color: #fff; margin: 0 0 14px; }
.screensaver-sub { font-size: 16px; font-weight: 500; color: #cdd5e0; }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .detail-view { flex-direction: column; }
  .detail-gallery { flex: 0 0 auto; height: 42vh; }
  .detail-info { flex: 1 1 auto; padding: 28px 22px; }
  .detail-specs { grid-template-columns: 1fr 1fr; }
  .topbar { flex-wrap: wrap; }
  .screensaver-title { font-size: 34px; }
}
