/* --- CONFIGURATION DE BASE --- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #0e0f11;
    font-family: 'Open Sans', sans-serif;
}

main {
    flex: 1;
    margin-top: 110px;
}

/* --- HEADER MAQUETTE RÉALIGNÉ --- */
header {
    background: linear-gradient(180deg, rgba(14, 15, 17, 0.98) 0%, rgba(22, 23, 26, 0.98) 100%);
    backdrop-filter: blur(5px);
    border-bottom: 3px solid #ce3636;
    width: 100%;
    height: 110px;
    min-height: 110px;
    max-height: 110px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

/* --- BARRE DE NAVIGATION GLOBALE --- */
.navbar {
    width: 100%;
    height: 100%;
    max-width: 100% !important; 
    margin: 0;
    display: flex !important;
    justify-content: space-between !important; 
    align-items: center !important;
    padding: 0 13% !important; /* Padding conservé à 13% comme demandé */
}

/* LOGO : Poussé à fond à gauche avec flex: 1 */
.nav-section.nav-left {
    position: static !important; 
    transform: none !important;
    margin-left: 0 !important;
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-start !important;
}

.nav-left img {
    height: 95px; 
    width: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0px 5px 15px rgba(0,0,0,0.6));
    transition: transform 0.3s ease;
}

.nav-left img:hover {
    transform: scale(1.04);
}

/* MENU : Parfaitement coincé au centre avec flex: 2 */
.nav-section.nav-center {
    position: static !important; 
    transform: none !important;
    flex: 2 !important;
    display: flex !important;
    justify-content: center !important;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding: 0;
    align-items: center;
}

/* Liens du menu */
.nav-links a.nav-item {
    font-family: 'Montserrat', sans-serif !important; 
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500; 
    text-transform: none !important; 
    letter-spacing: 0.5px;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.nav-links a.nav-item:hover {
    color: #ce3636;
}

/* Ligne d'animation sous les liens */
.nav-links a.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -2px;
    left: 50%;
    background-color: #ce3636;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a.nav-item:hover::after {
    width: 100%;
}

/* BOUTON CONTACT EN HAUT */
.btn-contact-header {
    font-family: 'Montserrat', sans-serif !important;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    text-transform: none !important; 
    letter-spacing: 0.5px;
    border: 1px solid #ce3636 !important;
    padding: 8px 22px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    white-space: nowrap;
}

.btn-contact-header:hover {
    background-color: #ce3636 !important;
    color: #ffffff !important;
    box-shadow: 0 0 15px rgba(206, 54, 54, 0.3) !important;
}

/* ZONE DROITE : Contrepoids invisible (flex: 1) pour centrer le menu */
.nav-section.nav-right {
    flex: 0.15 !important;
    display: block !important; 
}

/* RESPONSIVE SMARTPHONE (Existant) */
@media (max-width: 850px) {
    header {
        height: auto;
        min-height: auto;
        max-height: none;
        position: relative;
        padding: 15px 0;
    }
    main { margin-top: 0; }
    .navbar {
        flex-direction: column !important;
        gap: 15px;
        padding: 0 20px !important;
    }
    .nav-left img { height: 80px; margin: 0 auto; }
    .nav-links { gap: 20px; flex-wrap: wrap; justify-content: center; }
    .nav-links a.nav-item, .btn-contact-header { font-size: 0.95rem; }
}

/* =========================================
   MENU HAMBURGER ET RESPONSIVE MOBILE
   ========================================= */

.hamburger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
    
    /* On change les marges pour le pousser à droite */
    margin-left: auto;   /* Pousse le bouton vers la droite */
    margin-right: 20px;  /* Espace pour ne pas qu'il colle le bord droit */
}

/* Style des 3 barres blanches */
.hamburger-menu .bar {
    width: 30px;
    height: 3px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* --- ANIMATION DE LA CROIX QUAND LE MENU EST OUVERT --- */
.hamburger-menu.open .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: #ce3636; 
}
.hamburger-menu.open .bar:nth-child(2) {
    opacity: 0; 
}
.hamburger-menu.open .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: #ce3636;
}

/* --- RÈGLES QUAND L'ÉCRAN EST PETIT (TÉLÉPHONE / TABLETTE) --- */
@media (max-width: 992px) {
    .nav-section.nav-right {
        display: none !important; /* Désactive le contrepoids sur mobile pour ne pas écraser le menu */
    }

    .hamburger-menu {
        display: flex; 
    }

    /* On cache le conteneur classique */
    .nav-center {
        position: absolute;
        width: 100%;
        top: 0;
        right: 0;
    }

    /* Le menu devient un grand panneau noir caché sur le côté droit */
    .nav-links {
        position: fixed;
        top: 110px; 
        right: -100%; 
        width: 100%;
        height: calc(100vh - 110px);
        background-color: #0e0f11;
        flex-direction: column; 
        justify-content: flex-start;
        padding-top: 60px; 
        gap: 40px; 
        transition: right 0.4s ease-in-out; 
        border-top: 2px solid #ce3636;
    }

    /* QUAND ON CLIQUE : Le panneau glisse vers la gauche pour apparaître à l'écran */
    .nav-links.active {
        right: 0; 
    }

    .nav-item {
        font-size: 1.4rem !important;
    }

    .btn-contact-header {
        font-size: 1.2rem !important;
        padding: 12px 30px !important;
    }
}