/* --- 0. Layout global du menu --- */

/* --- Correction de la Bannière du Header pour le Menu --- */

/* Utilisation du blanc pur pour un look très épuré, ou var(--color-light) si vous avez une texture */
.page-header {
    background-color: var(--color-white); 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* Ombre très légère */
    padding: 15px 0; /* Plus de padding pour un look premium */
}

/* Forcer le texte en Vert Émeraude pour la lisibilité sur fond blanc */
.page-header .navbar ul li a {
    color: var(--color-primary); /* Vert Émeraude */
    font-weight: 600;
    /* Retirer la bordure pour un look plus "clean" */
    border-bottom: 1px solid transparent; 
    transition: all 0.3s ease;
}

.page-header .navbar ul li a:hover,
.page-header .navbar ul li a.active {
    color: var(--color-secondary); /* Beige Doré au survol/actif */
    border-color: var(--color-secondary);
    background-color: transparent;
    border-bottom: 2px solid var(--color-secondary); /* Soulignement subtil */
}

/* Le bouton Réserver */
.page-header .btn-reservation {
    background-color: var(--color-secondary); /* Fond Beige Doré (comme dans votre image) */
    color: var(--color-white) !important;
    border: none;
    transition: background-color 0.3s;
}

.page-header .btn-reservation:hover {
    background-color: var(--color-primary); /* Vert Émeraude au survol */
}

/* Le logo (s'il est en PNG transparent, il s'adaptera) */
.page-header .logo-img {
    /* Le logo est très important pour la lisibilité */
    transform: scale(1.2); /* Agrandissement du logo pour l'impact */
    /* Assurez-vous que l'image PNG de votre logo contient les lignes en Beige Doré */
}

.menu-complete {
    padding: 60px 0 90px;
    background-color: var(--color-light);
    /* léger motif de fond pour casser le vide */
    background-image:
        radial-gradient(circle at top left, rgba(0, 0, 0, 0.03), transparent 55%),
        radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.02), transparent 55%);
    position: relative;
}

/* petit voile décoratif en haut */
.menu-complete::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.8) 0,
        rgba(255, 255, 255, 0) 200px
    );
    z-index: 0;
}

.menu-complete > * {
    position: relative;
    z-index: 1;
}

/* --- 1. Titre principal & sous-titre --- */

.menu-complete h1 {
    font-size: 3.2rem;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.menu-complete h2 {
    font-size: 1.4rem;
    color: var(--color-text);
    font-weight: 300;
    margin-bottom: 40px;
    text-align: center;
    opacity: 0.9;
}

/* petite ligne décorative sous le titre */
.menu-title-divider {
    width: 120px;
    height: 3px;
    margin: 0 auto 40px;
    border-radius: 999px;
    background: linear-gradient(
        to right,
        var(--color-secondary),
        var(--color-primary),
        var(--color-secondary)
    );
}

/* --- NOUVEAU : CHEMIN DU MENU STICKY --- */

.menu-path-section {
    position: relative;
    padding-top: 100px;
    /* La hauteur totale de la section DOIT être suffisante pour contenir tous les items */
    min-height: 3000px; 
    background-color: var(--color-light); 
}

.menu-path-wrapper {
    position: relative;
}

/* Conteneur de l'Ardoise (Rend l'image fixe au centre) */
.menu-slate-container {
    position: sticky;
    top: 50px; /* Commence à "coller" à 50px du haut de la fenêtre */
    height: calc(100vh - 100px); /* Hauteur visible de l'ardoise */
    width: 100%;
    pointer-events: none; /* Permet de cliquer sur les éléments derrière */
}

/* L'image de l'ardoise elle-même, centrée */
.menu-slate-image {
    position: absolute;
    height: 100%;
    width: auto;
    left: 50%;
    transform: translateX(-50%);
    object-fit: contain; 
}

/* Conteneur des plats (Contenu qui défile normalement) */
.menu-path-content {
    position: relative;
    width: 100%;
}

/* Styles des plats individuels */
.menu-path-item {
    padding: 20px;
    width: 45%; /* Les plats prennent 45% de la largeur du conteneur */
    margin-bottom: 300px; /* ESPACEMENT IMPORTANT : Crée la distance verticale entre les plats */
    background-color: var(--color-white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.menu-path-item:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Alignement des plats (Alternance Gauche/Droite) */
.item-left {
    margin-right: 55%; /* Laisse de la place à droite pour l'ardoise */
    border-left: 5px solid var(--color-primary);
}

.item-right {
    margin-left: 55%; /* Laisse de la place à gauche pour l'ardoise */
    border-right: 5px solid var(--color-primary);
}

/* Visuel des plats (Rond, comme sur l'exemple) */
.item-visual {
    float: right;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 0 10px 15px;
    border: 3px solid var(--color-secondary);
}

.item-right .item-visual {
    float: left;
    margin: 0 15px 10px 0;
}

.item-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Typographie des plats */
.menu-path-item h4 {
    font-size: 1.6em;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.price-path {
    display: block;
    font-size: 1.2em;
    font-family: var(--font-heading);
    color: var(--color-secondary);
    font-weight: 700;
    margin-top: 10px;
}

/* --- 2. Navigation Rapide (Ancres) --- */

.menu-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 60px;
    padding: 14px 20px;
    background-color: var(--color-white);
    border-radius: 999px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    position: sticky; /* à désactiver si conflit avec ton header */
    top: 80px;
    z-index: 20;
}

.menu-nav a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
    padding: 9px 18px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 999px;
    background-color: transparent;
    transition: all 0.25s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

/* halo doux au hover */
.menu-nav a::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.5), transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.menu-nav a.active,
.menu-nav a:hover {
    color: var(--color-white);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.menu-nav a:hover::after {
    opacity: 1;
}

/* --- 3. Sections de catégorie --- */

.menu-category {
    padding: 45px 30px 45px;
    margin-bottom: 55px;
    border-radius: 20px;
    position: relative;
}

/* léger alternat une section sur deux */
.menu-category:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.8);
}

.menu-category.alternate-bg {
    background-color: var(--color-white);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.06);
}

/* bordure décorative gauche */
.menu-category::before {
    content: "";
    position: absolute;
    left: 0;
    top: 18%;
    bottom: 18%;
    width: 4px;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(
        to bottom,
        var(--color-secondary),
        var(--color-primary)
    );
    opacity: 0.7;
}

/* titre de catégorie */

/* titre de catégorie */

/* titre de catégorie */

.category-title {
    font-size: 2.6rem;
    color: var(--color-primary);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    /* Ajoute un padding horizontal pour laisser de l'espace aux lignes */
    padding: 0 10px; 
    /* IMPORTANT : Le conteneur doit être en flex pour aligner le texte au centre des lignes */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}
    
    /* motifs décoratifs autour du titre */
    .category-title::before,
    .category-title::after {
        content: "";
        /* Position absolue par rapport au .category-title */
        top: 50%;
        transform: translateY(-50%);
        
        /* Une ligne longue pour assurer qu'elle touche les bords */
        width: 1000px; 
        height: 2px; /* Épaisseur de la ligne */
        
        /* Dégradé pour un effet de fondu vers les bords */
        background: linear-gradient(
            to right,
            var(--color-secondary), /* Couleur de la ligne */
            var(--color-primary)
        );
        position: absolute;
        z-index: -1; /* Place la ligne derrière le texte */
    }
    
    .category-title::before {
        /* Positionne la ligne à gauche, la pousse hors champ */
        right: 100%;
    }
    
    .category-title::after {
        /* Positionne la ligne à droite, la pousse hors champ */
        left: 100%;
        /* Inverse le dégradé pour que le Beige Doré soit vers le centre */
        transform: translateY(-50%) scaleX(-1); 
    }

/* CRUCIAL : Masquer les motifs derrière le texte */
.category-title span.text-wrap {
    background-color: inherit; /* Utilise la couleur de fond du .menu-category */
    padding: 0 15px; /* Petit espace autour du texte */
    position: relative;
    z-index: 10;
}

.category-subtitle {
    font-style: italic;
    color: #666;
    margin-bottom: 40px;
    text-align: center;
    padding: 0 10px;
}

/* --- 4. Layout des items --- */

.menu-item-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.item-content {
    flex: 1 1 380px;
    max-width: 520px;
    text-align: left;
    padding: 18px 18px 16px;
    background-color: var(--color-white);
    border-left: 4px solid var(--color-secondary);
    border-radius: 0 14px 14px 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

/* léger motif dans la carte */
.item-content::before {
    content: "";
    position: absolute;
    right: 14px;
    bottom: 10px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.03), transparent 60%);
    opacity: 0.7;
    pointer-events: none;
}

.item-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    border-color: var(--color-primary);
}

.item-content h4 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 1.4rem;
    margin-bottom: 4px;
    color: var(--color-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 4px;
}

/* nom du plat (pour le forcer à rester à gauche si tu as d'autres éléments) */
.item-title {
    font-weight: 600;
}

/* description principale du plat */
.item-description {
    font-size: 0.98rem;
    color: #555;
    margin-top: 6px;
    line-height: 1.6;
}

/* prix */
.price {
    color: var(--color-primary);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
}

/* --- Tags / badges (Spécialité, Végétarien, Épicé, etc.) --- */

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.item-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px;
    padding: 3px 9px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background-color: #fafafa;
}

/* variantes possibles */
.item-tag.best {
    border-color: var(--color-secondary);
    background-color: rgba(255, 255, 255, 0.9);
}

.item-tag.veg {
    border-color: var(--color-primary);
}

.item-tag.spicy {
    border-color: #c0392b;
}

/* --- 5. Sous-sections (Homos, Kebbeh, Maamoul, etc.) --- */

.menu-subsection {
    margin: 35px 0 15px;
    padding: 26px 24px 24px;
    background-color: var(--color-white);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    position: relative;
}

.menu-subsection::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px dashed rgba(0, 0, 0, 0.04);
    pointer-events: none;
}

.menu-subsection h4 {
    font-size: 1.8rem;
    color: var(--color-secondary);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.menu-subsection h4::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(
        to right,
        var(--color-secondary),
        var(--color-primary)
    );
    border-radius: 999px;
}

.menu-item-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.item-variant {
    font-weight: 700;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
}

.item-description-block {
    padding: 8px 0 10px;
    border-bottom: 1px dashed #eee;
}
.item-description-block:last-child {
    border-bottom: none;
}

.item-description-block .item-description {
    font-size: 0.9rem;
    color: #777;
}

/* --- 6. Petits extras (boissons, desserts simples, etc.) --- */

.small-items .menu-item-row {
    justify-content: flex-start;
}

.small-items .item-content {
    flex: 1 1 calc(25% - 15px);
    max-width: none;
    border-left: none;
    border-radius: 0;
    border-bottom: 1px dashed #eee;
    background-color: transparent;
    box-shadow: none;
    padding: 10px 0;
}

.small-items .item-content::before {
    display: none;
}

.small-items .item-content:hover {
    transform: none;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.02);
}

.small-items .item-content h4 {
    border-bottom: none;
}

/* --- 7. Séparateur visuel entre grosses catégories --- */

.separator {
    border: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--color-secondary),
        var(--color-primary),
        var(--color-secondary),
        transparent
    );
    margin: 65px auto 55px;
    width: 65%;
    position: relative;
}

.separator::before {
    content: "✶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 0.9rem;
    color: var(--color-primary);
    background-color: var(--color-light);
    padding: 0 10px;
}

/* --- 8. Bannières de catégorie --- */

.category-banner {
    width: calc(100% + 40px);
    max-height: 260px;
    overflow: hidden;
    margin: 0 -20px 35px -20px;
    border-radius: 16px;
    position: relative;
}

.category-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: transform 0.5s ease;
}

.category-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.25),
        rgba(0, 0, 0, 0.05),
        transparent
    );
}

.category-banner:hover img {
    transform: scale(1.06);
}

/* --- 9. Responsive --- */

@media (max-width: 992px) {
    .menu-nav {
        border-radius: 16px;
        top: 70px;
    }

    .menu-category {
        padding: 35px 18px 35px;
    }

    .category-title {
        font-size: 2.2rem;
    }

    .menu-item-row {
        gap: 20px;
    }

    .menu-item-list {
        grid-template-columns: 1fr;
    }

    .small-items .item-content {
        flex: 1 1 45%;
    }
}

@media (max-width: 600px) {
    .menu-complete {
        padding-top: 40px;
    }

    .menu-complete h1 {
        font-size: 2.2rem;
    }

    .menu-complete h2 {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .menu-title-divider {
        margin-bottom: 30px;
    }

    .menu-nav {
        position: static;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        border-radius: 12px;
    }

    .menu-category::before {
        display: none;
    }

    .menu-category {
        margin-bottom: 40px;
        padding: 28px 14px 28px;
        border-radius: 14px;
    }

    .item-content {
        padding: 14px 14px 12px;
        border-radius: 10px;
    }

    .category-banner {
        width: 100%;
        margin: 0 0 25px 0;
        border-radius: 12px;
    }

    .small-items .item-content {
        flex: 1 1 100%;
    }
}

@media (max-width: 900px) {
    /* 2. Navigation Rapide (Sticky désactivé pour éviter les conflits) */
    .menu-nav {
        position: static;
        border-radius: 12px;
        margin-top: 20px;
    }
    
    /* 3. Styles de Catégorie & Titres */
    .category-title {
        font-size: 2em;
        padding: 0 10px;
    }

    /* 4. Mise en page des Items */
    .item-content {
        flex: 1 1 100%; /* Prend toute la largeur, une seule colonne */
        max-width: 100%;
    }

    /* Points de conduite (Ajustés pour la petite largeur) */
    .item-content h4::after {
        content: "................................................................................................................................................";
    }

    /* 5. Sous-sections (Homos, Kebbeh) */
    .menu-item-list {
        grid-template-columns: 1fr; /* Une seule colonne pour les variantes */
        gap: 15px;
    }
    
    /* 6. Petits extras (Boissons) */
    .small-items {
        grid-template-columns: repeat(2, 1fr); /* Passe à deux colonnes */
        gap: 10px 15px;
        max-width: 100%;
    }
    
    /* NOUVEAU : Correction de l'Ardoise (Si vous l'avez implémentée) */
    .menu-path-section {
        min-height: auto !important; /* Retire la hauteur fixe */
        padding-top: 0;
    }
    
    .menu-path-wrapper {
        display: block;
    }

    /* L'ardoise disparaît ou est rendue moins visible */
    .menu-slate-container {
        display: none; /* Cache l'ardoise sur mobile, car elle prend trop de place */
        position: static;
        height: auto;
    }

    /* Les plats prennent 100% de la largeur */
    .menu-path-item {
        width: 100%;
        margin: 20px 0 20px 0 !important;
    }
    
    .item-visual {
        width: 80px;
        height: 80px;
    }
}