/* Variables de base */
:root {
    --color-primary: #a87f5d; /* Marron Moka/Pain */
    --color-secondary: #f4e9d9; /* Crème claire (pour le fond du body) */
    --color-text: #333;
    --color-white: #fff;
    --font-brand: 'Playfair Display', serif; /* Expressive */
    --font-body: 'Helvetica Neue', Arial, sans-serif; /* Minimaliste/Clair */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-secondary); 
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------------------------------------------------- */
/* Correction du chevauchement de la navbar */
/* ---------------------------------------------------- */
#main-content {
    /* Le padding compense la hauteur de la navbar desktop (env. 70px) + marge (20px) */
    padding-top: 90px; 
    text-align: center;
}

/* ---------------------------------------------------- */
/* Conteneur de la Navbar (FIXE & Glassmorphism) */
/* ---------------------------------------------------- */
.navbar-container {
    /* Retrait des animations de masquage - Reste toujours fixe */
    position: fixed;
    top: 20px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90%; 
    max-width: 1200px;
    z-index: 1000;
    
    /* GLASSMORPHISM */
    background: rgba(255, 255, 255, 0.5); 
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-radius: 25px; 
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); 
    padding: 15px 30px;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre le hamburger et la marque sur mobile */
}

/* ---------------------------------------------------- */
/* Marque de la Boulangerie (Desktop) */
/* ---------------------------------------------------- */
.navbar-brand {
    font-family: var(--font-brand);
    font-size: 1.8rem; 
    font-weight: 700;
    color: var(--color-text);
    transition: color 0.3s;
    letter-spacing: 1px;
}

/* ---------------------------------------------------- */
/* Liens de navigation (Desktop uniquement) */
/* ---------------------------------------------------- */
.nav-links-desktop-wrapper {
    /* Flexbox est déjà défini dans .navbar */
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px; 
    align-items: center;
}

.nav-links a:not(.cta-button) {
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: color 0.3s;
}

/* Micro-interaction (soulignement) */
.nav-links a:not(.cta-button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.3s ease-out;
}

.nav-links a:not(.cta-button):hover::after {
    width: 100%;
}
.nav-links a:not(.cta-button):hover {
    color: var(--color-primary);
}

/* ---------------------------------------------------- */
/* CTA - Call to Action ("Passer Commande") */
/* ---------------------------------------------------- */
.cta-button {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    padding: 10px 20px;
    border-radius: 50px; 
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    background-color: #8c6a4f; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ---------------------------------------------------- */
/* Icônes (Panier & Compte) */
/* ---------------------------------------------------- */
.nav-icons {
    display: flex;
    gap: 20px;
}

.nav-icon i {
    font-size: 1.4rem;
    color: var(--color-text);
    transition: color 0.3s, transform 0.2s;
}

.nav-icon:hover i {
    color: var(--color-primary);
    transform: scale(1.1); 
}

/* ---------------------------------------------------- */
/* Menu Hamburger (Masqué sur Desktop) */
/* ---------------------------------------------------- */
.menu-toggle {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.8rem; /* Plus gros comme demandé */
    color: var(--color-text);
    padding: 5px;
    transition: color 0.3s;
    z-index: 1010; 
}

/* ---------------------------------------------------- */
/* RESPONSIVE (Mobile-First) */
/* ---------------------------------------------------- */
@media (max-width: 768px) {
    
    /* 1. Navbar pleine largeur et fixe */
    .navbar-container {
        position: fixed;
        top: 0; 
        left: 0;
        transform: none; /* Annule le translateX(-50%) desktop */
        width: 100%;
        max-width: none;
        border-radius: 0;
        padding: 10px 15px;
        /* Rendre plus opaque pour la couverture */
        background: rgba(255, 255, 255, 0.9); 
    }
    
    /* 2. Layout Grid pour le Header mobile (Hamburger | Marque | Icônes) */
    .navbar {
        display: grid;
        grid-template-columns: auto 1fr auto; 
        gap: 10px;
    }
    
    /* 3. Masquer les liens du desktop */
    .nav-links-desktop-wrapper {
        display: none;
    }
    
    /* 4. Ordre des éléments (Hamburger, Marque, Icônes) */
    .nav-left {
        order: 1; /* Hamburger à gauche */
        grid-column: 1 / 2;
    }

    .navbar-brand {
        /* La marque est centrée dans le nav-left */
        margin: 0;
    }

    .nav-icons {
        order: 3; /* Icônes à droite */
        grid-column: 3 / 4;
        gap: 15px;
        align-self: center;
    }
    
    /* Afficher le bouton hamburger et le mettre à gauche dans la grille */
    .menu-toggle {
        display: block; 
    }

    /* 5. Nouveau padding-top pour le contenu principal mobile */
    #main-content {
        padding-top: 70px; /* Ajusté pour la navbar collée au haut */
    }

    /* ---------------------------------------------------- */
    /* Menu Coulissant (Overlay) */
    /* ---------------------------------------------------- */
    .mobile-menu-overlay {
        position: fixed;
        top: 60px; /* Commence juste en dessous de la navbar mobile */
        left: 0;
        width: 100%;
        height: calc(100vh - 60px); 
        background: rgba(255, 255, 255, 0.98); 
        backdrop-filter: blur(8px);
        z-index: 999;
        
        /* État initial caché (coulisse de la gauche) */
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.4s ease-out, visibility 0.4s;
        
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 30px;
    }

    /* État affiché du menu (activé par la classe .menu-open en JS) */
    .mobile-menu-overlay.menu-open {
        transform: translateX(0); /* Fait coulisser le menu */
        visibility: visible;
    }

    /* Styles des liens dans le menu mobile */
    .mobile-menu-overlay .nav-links {
        display: flex;
        flex-direction: column;
        gap: 30px;
        width: 80%;
    }
    
    .mobile-menu-overlay .nav-links a {
        font-size: 1.5rem;
        font-weight: 600;
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }

    /* CTA dans le menu coulissant */
    .mobile-menu-overlay .cta-button {
        margin-top: 20px;
        font-size: 1.1rem;
    }
}