/* Animation de transition globale entre les pages */
body {
    animation: pageFadeIn 0.6s ease-in-out;
}

@keyframes pageFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}



/* ==========================================================================
   ARCHITECTURE DU DRAWER (DESIGN CONFORME AU CROQUIS)
   ========================================================================== */

/* 1. Barre de navigation principale (Fixe ou relative sur PC) */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 5%;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 2000;
}

.navbar h1 {
  font-size: 1.5rem;
  font-weight: 900;
  color: #111111;
}

.accent-text {
  color: var(--accent-color, #e60000);
}

.nav-links-desktop {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links-desktop a {
  text-decoration: none;
  color: #111111;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links-desktop a:hover {
  color: var(--accent-color, #e60000);
}

.btn-nav {
  background: #111111;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

/* Bouton Hamburger Mobile */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: #111111;
  border-radius: 2px;
}

/* ==========================================================================
   ARCHITECTURE DU DRAWER (DESIGN CONFORME AU CROQUIS)
   ========================================================================== */

/* 1. Le Fond Voilé / Flouté */
.drawer-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}

.drawer-menu.active {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 2. Le Conteneur Panneau Noir (DA Dark Mode) */
.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 340px;
  height: 100%;
  background: #111111; /* Background noir demandé */
  padding: 50px 35px 40px 35px;
  display: flex;
  flex-direction: column;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.drawer-menu.active .drawer-content {
  transform: translateX(0);
}

/* 3. Gestion de la Croix (Top Right) */
.drawer-close {
  position: absolute;
  top: 15px;
  right: 25px;
  background: transparent;
  border: none;
  font-size: 2.6rem;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  color: #ffffff; /* Croix blanche pour fond noir */
  transition: color 0.2s ease, transform 0.2s ease;
}

.drawer-close:hover {
  color: var(--accent-color, #e60000);
  transform: scale(1.1) rotate(90deg);
}

/* En-tête du Titre */
.drawer-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 15px;
  margin-bottom: 40px;
  width: 100%;
}

/* Titre (grand) et légèrement gris */
.drawer-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #8e8e93; /* Teinte grise */
  text-transform: uppercase;
  letter-spacing: -0.5px;
  position: relative;
  padding-bottom: 15px;
  width: 100%;
}

/* La petite ligne de séparation rouge */
.drawer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--accent-color, #e60000);
  border-radius: 2px;
}

/* 4. Liste des Liens (Fade-in animations) */
.drawer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-links li {
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.drawer-menu.active .drawer-links li {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay pour fade-in séquentiel */
.drawer-menu.active .drawer-links li:nth-child(1) { transition-delay: 0.1s; }
.drawer-menu.active .drawer-links li:nth-child(2) { transition-delay: 0.2s; }
.drawer-menu.active .drawer-links li:nth-child(3) { transition-delay: 0.3s; }
.drawer-menu.active .drawer-links li:nth-child(4) { transition-delay: 0.4s; }

.drawer-links a {
  text-decoration: none;
  color: #ffffff; /* Liens blancs sur fond noir */
  font-size: 1.35rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.drawer-links a:hover {
  color: var(--accent-color, #e60000);
}

/* 5. Zone Bouton Inférieur (Pop-up animation) */
.drawer-footer {
  margin-top: auto;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.drawer-menu.active .drawer-footer {
  opacity: 1;
  transform: scale(1);
}

.btn-drawer {
  width: 100%;
  background: var(--accent-color, #e60000); /* Rouge pour le bouton */
  color: #ffffff;
  border: none;
  padding: 16px;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-drawer:hover {
  background: #a60000;
}

/* État normal des cartes */
.vehicle-card {
  transition: all 0.3s ease;
  border: 2px solid transparent; /* Contour invisible au repos */
}

/* État sélectionné (quand tu ajouteras la classe "selected" via JS) */
.vehicle-card.selected {
  border: 2px solid #e60000;         /* Contour rouge */
  box-shadow: 0 10px 25px rgba(230, 0, 0, 0.2); /* Ombre portée rouge */
  transform: translateY(-5px);       /* Élévation */
}

/* Optionnel : Contour rouge simple au survol */
.vehicle-card:hover {
  border: 2px solid #e60000;
}

.card-img-wrapper {
    width: 100% !important; /* Force l'écrasement */
    height: 200px !important; 
    overflow: hidden !important;
    position: relative;
}

.vehicle-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Force le remplissage */
    object-position: center !important;
}

/* Affichage Responsive Switch Navbar */
@media (max-width: 992px) {
  .nav-links-desktop, .nav-actions-desktop {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}

/* Animation fade-in smooth */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Appliquer l'animation aux textes, images et cartes */
h1, h2, h3, p, .vehicle-card, .vehicle-img {
  animation: fadeIn 0.8s ease-out forwards;
}
