/* ===== RESET ===== */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family: Arial, Helvetica, sans-serif;
}

:root{
  --bg: #0f0f0f;
  --panel: #111;
  --card: #1c1c1c;
  --muted: #bdbdbd;
  --text: #f2f2f2;
  --red: #d40000;
  --redDark: #a80000;
  --border: #2a2a2a;
}

body{
  background: var(--bg);
  color: var(--text);
}

/* ===== CONTAINER ===== */
.container{
  width: 90%;
  max-width: 1200px;
  margin: auto;
}

/* ===== HEADER ===== */
header{
  background: var(--panel);
  padding: 15px 0;
  border-bottom: 2px solid var(--red);
  position: relative;
  z-index: 10; /* ok, le modal est au-dessus */
}

nav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 20px;
}

.logo-img{
  width: 390px;
  height: auto;
}

nav ul{
  list-style:none;
  display:flex;
  gap: 25px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a{
  text-decoration:none;
  color:#ccc;
  font-weight:600;
  transition:0.25s;
}

nav a:hover{
  color: var(--red);
}

/* ===== TITRES ===== */
.section-title{
  text-align:center;
  margin: 60px 0 30px;
  font-size: 32px;
  color:#fff;
}

/* ===== CARDS ===== */
.card-container{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 60px;
}

.card{
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  text-align:center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.6);
  transition: 0.25s;
  border: 1px solid transparent;
}

.card:hover{
  transform: translateY(-8px);
  border-color: var(--red);
}

.card img{
  width:100%;
  border-radius: 8px;
  display:block;
}

.card h3{
  margin-top: 12px;
  margin-bottom: 6px;
}

.card p{
  color: #cfcfcf;
  margin: 6px 0;
}

.card strong{
  color: var(--red);
  font-size: 18px;
}

/* Clic véhicule */
.car-card{ cursor:pointer; }

/* ===== FOOTER ===== */
footer{
  text-align:center;
  padding: 25px 0;
  background: var(--panel);
  border-top: 1px solid #333;
  margin-top: 50px;
  color:#aaa;
}

/* ===================================================================== */
/* ======================= MODAL / POPUP VEHICULES ====================== */
/* ===================================================================== */

.modal{
  display:none;
  position:fixed;
  inset:0;
  z-index: 99999; /* AU-DESSUS DE TOUT */
}

.modal.is-open{ display:block; }

.modal__overlay{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(2px);
}

.modal__content{
  position:relative;
  width: min(980px, calc(100% - 24px));
  margin: 40px auto;
  background: #121212;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: 0 20px 70px rgba(0,0,0,0.65);
}

.modal__close{
  position:absolute;
  top: 12px;
  right: 12px;
  border: 1px solid #333;
  background: #1c1c1c;
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor:pointer;
}

.modal__body{
  display:grid;
  grid-template-columns: 1.2fr 1fr;  /* photo gauche / infos droite */
  gap: 18px;
  padding: 18px;
}

.modal__media{ min-width: 0; }
.modal__info{ min-width: 0; }

.modal__mainimg{
  width:100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 12px;
  display:block;
}

/* Miniatures */
.modal__thumbs{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  overflow:auto;
  padding-bottom: 4px;
}

.modal__thumbs img{
  width: 92px;
  height: 62px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor:pointer;
  flex: 0 0 auto;
}

.modal__thumbs img.is-active{
  border-color: var(--red);
}

/* Texte infos */
.modal__title{
  font-size: 26px;
  margin: 0 0 6px;
  color: #fff;
}

.modal__price{
  font-size: 20px;
  font-weight: 800;
  color: var(--red);
  margin: 0 0 14px;
}

.modal__specs{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap: 10px;
}

.modal__specs li{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  border-bottom: 1px dashed var(--border);
  padding: 8px 0;
  color: #ddd;
}

.modal__specs span:first-child{
  color: var(--muted);
}

.modal__specs span:last-child{
  font-weight: 700;
  color: #fff;
}

/* Boutons CTA */
.modal__cta{
  margin-top: 16px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal__cta a{
  display:inline-block;
  background: var(--red);
  color:#fff;
  text-decoration:none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  transition: 0.2s;
}

.modal__cta a:hover{
  background: var(--redDark);
}

.modal__cta a.secondary{
  background: #1c1c1c;
  border: 1px solid #333;
}

.modal__cta a.secondary:hover{
  background: #222;
}

/* Responsive */
@media (max-width: 860px){
  .modal__body{ grid-template-columns: 1fr; }
  .modal__content{ margin: 16px auto; }
  .logo-img{ width: 240px; }
}