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

:root {
  --bg:      #fafafa;
  --bg2:     #fff;
  --bg3:     #f5f5f5;
  --red:     #d32f2f;
  --text:    #1a1a1a;
  --muted:   #999;
  --border:  #e0e0e0;
}

body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.6; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--red); }

/* Header */
#header {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center;
  justify-content: space-between; height: 52px;
  position: sticky; top: 0; z-index: 100;
}
.logo { font-size: 18px; font-weight: 700; color: #000; letter-spacing: 0.5px; }
.logo span { color: var(--red); }

/* Nav */
#nav { background: var(--bg2); border-bottom: none; padding: 0 24px; display: flex; flex-wrap: wrap; gap: 0; }
.nav-item { position: relative; }
.nav-link {
  display: block; padding: 10px 14px; font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: 0; color: var(--text);
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.nav-link:hover, .nav-link.active { color: var(--red); border-bottom-color: var(--red); }
.dropdown {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--bg2); border: 1px solid var(--border);
  min-width: 180px; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.nav-item:hover .dropdown { display: block; }
.dropdown-brand { padding: 6px 0; border-bottom: 1px solid var(--border); }
.dropdown-brand:last-child { border-bottom: none; }
.dropdown-brand-name { padding: 5px 14px; font-size: 11px; font-weight: 600; color: var(--red); text-transform: uppercase; }
.dropdown-model { display: block; padding: 5px 20px; font-size: 13px; color: var(--text); transition: background .1s; }
.dropdown-model:hover { color: var(--red); background: #f5f5f5; }

/* Main */
#main { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }

/* Grille */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; transition: border-color .2s, box-shadow .2s; cursor: pointer; display: block;
}
.card:hover { border-color: var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg3); display: block; }
.card-placeholder { width: 100%; aspect-ratio: 4/3; background: var(--bg3); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.card-body { padding: 12px; }
.card-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-size: 16px; font-weight: 600; color: var(--red); margin-bottom: 8px; }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-block; font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 2px; background: #f0f0f0; color: var(--text); text-transform: uppercase; border: 1px solid var(--border); }
.badge-shipping { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 500; padding: 2px 6px; border-radius: 2px; background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; text-transform: uppercase; letter-spacing: 0; white-space: nowrap; }

/* Fiche produit */
.product-layout { display: block; }
.gallery-main { width: 100%; max-width: 600px; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; border: 1px solid var(--border); cursor: zoom-in; background: var(--bg3); display: block; margin-bottom: 20px; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; margin-bottom: 32px; }
.gallery-thumb { width: 60px; height: 45px; object-fit: cover; border-radius: 2px; border: 1px solid var(--border); cursor: pointer; opacity: 0.6; transition: opacity .15s, border-color .15s; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--red); opacity: 1; }
.product-info { max-width: 600px; }
.product-title { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.product-price { font-size: 28px; font-weight: 700; color: var(--red); margin-bottom: 24px; }
.product-desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin-bottom: 28px; white-space: pre-wrap; }
.btn-buy { display: inline-block; padding: 12px 28px; background: var(--red); color: #fff; font-size: 14px; font-weight: 600; text-align: center; border-radius: 2px; border: none; cursor: pointer; transition: background .15s; }
.btn-buy:hover { background: #b71c1c; color: #fff; }

/* Lightbox */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; justify-content: center; align-items: center; cursor: zoom-out; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 95vw; max-height: 92vh; object-fit: contain; border-radius: 2px; }
#lb-close { position: absolute; top: 16px; right: 24px; font-size: 28px; color: #fff; cursor: pointer; line-height: 1; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 24px; font-size: 12px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span { margin: 0 6px; }

/* Vide */
.empty { text-align: center; padding: 80px 0; color: var(--muted); }
.empty p { font-size: 16px; margin-bottom: 8px; }

/* Admin */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 3px; padding: 14px; margin-bottom: 14px; display: flex; gap: 14px; align-items: flex-start; }
.admin-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 2px; flex-shrink: 0; background: var(--bg3); }
.admin-info { flex: 1; }
.admin-info h3 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.admin-price { color: var(--red); font-weight: 600; }
.admin-meta { color: var(--muted); font-size: 11px; }
.admin-extras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.extra-wrap { position: relative; }
.extra-wrap img { width: 60px; height: 45px; object-fit: cover; border-radius: 2px; display: block; }
.extra-del { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border: none; border-radius: 50%; width: 16px; height: 16px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.upload-row { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type="file"] { color: var(--muted); font-size: 13px; }
.btn { display: inline-block; padding: 8px 14px; border-radius: 2px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #b71c1c; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.login-box { max-width: 320px; margin: 60px auto; padding: 28px; background: var(--bg2); border: 1px solid var(--border); border-radius: 3px; }
.login-box h2 { margin-bottom: 20px; font-size: 18px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.form-group input { width: 100%; padding: 9px 11px; background: var(--bg3); border: 1px solid var(--border); border-radius: 2px; color: var(--text); font-size: 14px; }
.form-group input:focus { outline: none; border-color: var(--red); }
.alert { padding: 10px 12px; border-radius: 2px; margin-bottom: 16px; font-size: 12px; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ef5350; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #81c784; }

/* ── Footer ───────────────────────────────────────── */
#footer {
  margin-top: 80px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* top strip */
.footer-top {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.footer-wordmark { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; color: #000; line-height: 1; }
.footer-wordmark span { color: var(--red); }
.footer-tagline { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }

/* columns */
.footer-cols {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.footer-col { display: flex; flex-direction: column; gap: 12px; }

/* label above each col */
.footer-col-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  padding-bottom: 0;
  border-bottom: none;
}

/* ── Col 1 : Vendeur ── */
.footer-seller-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
.footer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px; height: 48px;
}
.footer-avatar-ring {
  display: none;
}
.footer-avatar-ring-2 {
  display: none;
}
.footer-photo {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg3);
  display: block;
  border: 1px solid var(--border);
}
.footer-photo-placeholder {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.footer-photo-placeholder svg { opacity: 0.3; }
.footer-seller-info { display: flex; flex-direction: column; gap: 3px; }
.footer-seller-name { font-size: 14px; font-weight: 600; color: var(--text); }
.footer-seller-sub  { font-size: 11px; color: var(--muted); }
.footer-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 600;
  color: var(--red);
  background: #ffebee;
  border: 1px solid #ef9a9a;
  padding: 2px 6px;
  border-radius: 12px;
  width: fit-content;
}

.footer-shipping {
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.footer-shipping strong { color: var(--text); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 4px; font-weight: 600; }

/* ── Col 2 : Carte ── */
.footer-map-wrap {
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  height: 160px;
  flex-shrink: 0;
  margin-top: 0;
}
.footer-map-wrap iframe {
  width: 100%; height: 100%;
  display: block;
  border: none;
  filter: grayscale(1) invert(1) brightness(.7) contrast(1.1);
}
.footer-map-pin {
  position: absolute;
  bottom: 12px; left: 12px;
  background: rgba(12,12,12,.9);
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  color: #ccc;
  display: flex; align-items: center; gap: 6px;
  backdrop-filter: blur(4px);
}
.footer-map-pin svg { color: var(--red); flex-shrink: 0; }
.footer-map-area {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

/* ── Col 3 : Contact ── */
.footer-contact-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--red);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s, transform .12s;
  line-height: 1.2;
}
.footer-contact-btn:hover { background: #c50c0c; color: #fff; transform: translateY(-2px); }
.footer-contact-btn-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.footer-contact-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}
.footer-contact-desc a { color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); }
.footer-contact-desc a:hover { color: var(--red); border-color: var(--red); }
.footer-cgu-link {
  display: inline;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: none;
  transition: color .15s;
}
.footer-cgu-link:hover { color: var(--red); }

/* bottom bar */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
}
.footer-bottom-copy { font-size: 10px; color: var(--muted); }

/* ── Modal CGU ── */
#cgu-modal {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  align-items: center; justify-content: center;
  padding: 20px;
}
#cgu-modal.open { display: flex; }
.cgu-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 2px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}
.cgu-box h2 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cgu-box .cgu-sub { font-size: 11px; color: var(--red); margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.cgu-box p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 12px; }
.cgu-box p:last-of-type { margin-bottom: 0; }
.cgu-box strong { color: var(--text); }
.cgu-close {
  position: absolute; top: 12px; right: 16px;
  font-size: 20px; color: var(--muted); cursor: pointer;
  background: none; border: none; line-height: 1;
  transition: color .15s;
}
.cgu-close:hover { color: var(--red); }

@media (max-width: 900px) {
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}