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

:root {
  --bg:      #111;
  --bg2:     #1a1a1a;
  --bg3:     #222;
  --red:     #45489a;
  --text:    #e8e8e8;
  --muted:   #888;
  --border:  #333;
}

body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--red); }

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

/* Nav */
#nav { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 0 24px; display: flex; flex-wrap: wrap; }
.nav-item { position: relative; }
.nav-link {
  display: block; padding: 12px 16px; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; 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(--bg3); border: 1px solid var(--border);
  min-width: 200px; z-index: 200; box-shadow: 0 4px 16px rgba(0,0,0,.5);
}
.nav-item:hover .dropdown { display: block; }
.dropdown-brand { padding: 8px 0; border-bottom: 1px solid var(--border); }
.dropdown-brand:last-child { border-bottom: none; }
.dropdown-brand-name { padding: 6px 16px; font-size: 11px; font-weight: 700; color: var(--red); text-transform: uppercase; }
.dropdown-model { display: block; padding: 5px 24px; font-size: 13px; color: var(--text); }
.dropdown-model:hover { color: var(--red); background: rgba(69,72,154,.06); }

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

/* Grille */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; transition: border-color .15s, transform .15s; cursor: pointer; display: block;
}
.card:hover { border-color: var(--red); transform: translateY(-2px); }
.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: 13px; }
.card-body { padding: 14px; }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { font-size: 18px; font-weight: 700; color: var(--red); margin-bottom: 8px; }
.card-badges { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: rgba(69,72,154,.15); color: var(--red); text-transform: uppercase; }
.badge-shipping { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: rgba(30,180,100,.13); color: #2ec57a; border: 1px solid rgba(30,180,100,.25); text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }

/* Fiche produit */
.product-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.gallery-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; background: var(--bg3); display: block; }
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gallery-thumb { width: 70px; height: 52px; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; opacity: .65; transition: opacity .15s, border-color .15s; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--red); opacity: 1; }
.product-info { position: sticky; top: 80px; }
.product-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.product-price { font-size: 32px; font-weight: 700; color: var(--red); margin-bottom: 20px; }
.product-desc { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 24px; white-space: pre-wrap; }
.btn-buy { display: block; width: 100%; padding: 14px; background: var(--red); color: #fff; font-size: 16px; font-weight: 700; text-align: center; border-radius: 5px; border: none; cursor: pointer; transition: background .15s; }
.btn-buy:hover { background: #383b85; color: #fff; }

/* Lightbox */
#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.93); 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: 4px; }
#lb-close { position: absolute; top: 16px; right: 24px; font-size: 32px; color: #fff; cursor: pointer; line-height: 1; }

/* Breadcrumb */
.breadcrumb { margin-bottom: 24px; font-size: 13px; 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: 18px; 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: 6px; padding: 16px; margin-bottom: 16px; display: flex; gap: 16px; align-items: flex-start; }
.admin-thumb { width: 100px; height: 75px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--bg3); }
.admin-info { flex: 1; }
.admin-info h3 { font-size: 14px; margin-bottom: 4px; }
.admin-price { color: var(--red); font-weight: 700; }
.admin-meta { color: var(--muted); font-size: 12px; }
.admin-extras { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.extra-wrap { position: relative; }
.extra-wrap img { width: 70px; height: 52px; object-fit: cover; border-radius: 4px; display: block; }
.extra-del { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; 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 16px; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: #383b85; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--red); color: var(--red); }
.login-box { max-width: 340px; margin: 80px auto; padding: 32px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; }
.login-box h2 { margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.form-group input { width: 100%; padding: 10px 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 14px; }
.form-group input:focus { outline: none; border-color: var(--red); }
.alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
.alert-error   { background: rgba(69,72,154,.12); color: #8b8fe8; border: 1px solid rgba(69,72,154,.3); }
.alert-success { background: rgba(0,200,0,.1);    color: #4caf50; border: 1px solid rgba(0,200,0,.2); }

/* ── Footer ───────────────────────────────────────── */
#footer {
  margin-top: 80px;
  background: #0c0c0c;
  border-top: 3px solid var(--red);
  position: relative;
  overflow: hidden;
  background-image:
    radial-gradient(rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 22px 22px;
}
#footer::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(69,72,154,.055) 0%, transparent 60%);
  pointer-events: none;
}

/* top strip */
.footer-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.footer-wordmark { font-size: 36px; font-weight: 800; letter-spacing: -1px; color: #fff; line-height: 1; }
.footer-wordmark span { color: var(--red); }
.footer-tagline { font-size: 12px; color: #444; text-transform: uppercase; letter-spacing: 2px; margin-top: 6px; }

/* columns */
.footer-cols {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px 48px;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 40px;
  position: relative;
  z-index: 1;
}
.footer-col { display: flex; flex-direction: column; gap: 20px; }

/* label above each col */
.footer-col-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--red);
  padding-bottom: 12px;
  border-bottom: 1px solid #1e1e1e;
}

/* ── Col 1 : Vendeur ── */
.footer-seller-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-radius: 10px;
  padding: 18px;
}
.footer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 72px; height: 72px;
}
.footer-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--red);
}
.footer-avatar-ring-2 {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(69,72,154,.2);
}
.footer-photo {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e1e1e;
  display: block;
}
.footer-photo-placeholder {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
}
.footer-photo-placeholder svg { opacity: .35; }
.footer-seller-info { display: flex; flex-direction: column; gap: 5px; }
.footer-seller-name { font-size: 15px; font-weight: 700; color: #fff; }
.footer-seller-sub  { font-size: 11px; color: #555; }
.footer-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  color: var(--red);
  background: rgba(69,72,154,.1);
  border: 1px solid rgba(69,72,154,.2);
  padding: 3px 8px;
  border-radius: 20px;
  width: fit-content;
}

.footer-shipping {
  padding: 14px 16px;
  background: #141414;
  border: 1px solid #1e1e1e;
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #555;
  line-height: 1.7;
}
.footer-shipping strong { color: #888; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 4px; }

/* ── Col 2 : Carte ── */
.footer-map-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e1e1e;
  position: relative;
  height: 210px;
  flex-shrink: 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: #555;
  line-height: 1.6;
  margin-top: 4px;
}

/* ── 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: #383b85; 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: 12px;
  color: #555;
  line-height: 1.65;
}
.footer-contact-desc a { color: #555; text-decoration: underline; text-underline-offset: 2px; }
.footer-contact-desc a:hover { color: var(--red); }
.footer-cgu-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #444;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s;
}
.footer-cgu-link:hover { color: var(--red); }

/* bottom bar */
.footer-bottom {
  border-top: 1px solid #161616;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}
.footer-bottom-copy { font-size: 11px; color: #333; }

/* ── Modal CGU ── */
#cgu-modal {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  padding: 24px;
}
#cgu-modal.open { display: flex; }
.cgu-box {
  background: #141414;
  border: 1px solid #2a2a2a;
  border-top: 3px solid var(--red);
  border-radius: 10px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}
.cgu-box h2 { font-size: 18px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.cgu-box .cgu-sub { font-size: 12px; color: var(--red); margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }
.cgu-box p { font-size: 13px; color: #666; line-height: 1.75; margin-bottom: 14px; }
.cgu-box p:last-of-type { margin-bottom: 0; }
.cgu-box strong { color: #aaa; }
.cgu-close {
  position: absolute; top: 16px; right: 18px;
  font-size: 22px; color: #555; 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: 28px; }
  .footer-top { flex-direction: column; align-items: flex-start; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 768px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-info { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .nav-link { padding: 10px; font-size: 12px; }
}
