:root {
    --mm-red: #c32026;
    --mm-dark-red: #92181c;
    --mm-dark: #2b2d30;
    --mm-yellow: #ffcc00;
    --mm-text: #ffffff;
    --mm-radius: 12px;
}

/* --- STRUCTURE --- */
.megamenu-container {
    position: relative;
    display: inline-block;
    font-family: 'Roboto', sans-serif;
}

.megamenu-trigger {
    background: var(--mm-red);
    color: var(--mm-text) !important;
    padding: 15px 25px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--mm-radius); 
    position: relative;
    z-index: 10000;
}

.megamenu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 12px; 
    width: 90vw;
    max-width: 1900px;
    background: var(--mm-dark);
    display: none;
    z-index: 9999;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    border-radius: var(--mm-radius);
    overflow: hidden;
}

/* HAUTEUR DYNAMIQUE : S'adapte à la taille de l'écran */
.megamenu-inner {
    display: flex;
    min-height: 500px;
    max-height: calc(100vh - 200px); 
}

/* --- SIDEBAR ROUGE --- */
.megamenu-sidebar {
    width: 380px;
    min-width: 280px;
    background: var(--mm-red);
    flex-shrink: 0;
    border-radius: var(--mm-radius) 0 0 var(--mm-radius);
    padding: 15px 0;
    overflow-y: auto;
    z-index: 999;
}

.megamenu-sidebar::-webkit-scrollbar { display: none; }

.level-1-item { 
    margin: 2px 10px;
    border-radius: 50px;
    transition: background 0.2s;
    position: relative;
}

.level-1-item:hover,
.level-1-item.active { 
    background: rgba(255,255,255, 0.15) !important;
}

.level-1-item.active {
    background: var(--mm-dark);
}

.level-1-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--mm-text) !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
}

.menu-icon {
    width: 20px; height: 20px;
    filter: brightness(0) invert(1);
    margin-right: 15px;
}

/* --- CONTENU NOIR & SCROLLBAR --- */
.megamenu-content {
    flex: 1;
    padding: 50px 60px;
    background: var(--mm-dark);
    border-radius: 0 var(--mm-radius) var(--mm-radius) 0;
    overflow-y: auto;
}

.megamenu-content::-webkit-scrollbar { width: 6px; }
.megamenu-content::-webkit-scrollbar-track { background: transparent; }
.megamenu-content::-webkit-scrollbar-thumb {
    background: var(--mm-yellow);
    border-radius: 10px;
}

.megamenu-pane { display: none; }
.megamenu-pane.active { display: block; }

.pane-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 60px;
    row-gap: 40px;
}

/* TITRES AVEC IMAGE UNDERLINE */
.column-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 25px;
    white-space: nowrap;
    position: relative;
    padding-bottom: 15px;
}

.column-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px; 
    height: 12px; 
    background-image: url('../img/underline.png'); 
    background-size: contain; 
    background-repeat: no-repeat;
    background-position: left bottom;
}

.column-title a { color: var(--mm-text) !important; text-decoration: none !important; }

.level-3-list { list-style: none; padding: 0; margin: 0; }
.level-3-list li { margin-bottom: 8px; }
.level-3-list a {
    color: rgba(255,255,255,0.9) !important;
    font-size: 13.5px;
    text-decoration: none !important;
}

.level-3-list a:hover {
    color: var(--mm-yellow) !important;
}

/* ============================================
   STYLE DES ÉTAPES (BULLE JAUNE FIXE)
   ============================================ */
.level-1-list { counter-reset: menu-steps; }

.level-1-item.is-step {
    background-color: var(--mm-dark-red);
    counter-increment: menu-steps;
}

/* On s'assure que la bulle RESTE JAUNE même au survol/actif */
.level-1-item.is-step:hover .level-1-link::before,
.level-1-item.is-step.active .level-1-link::before {
    background-color: var(--mm-yellow) !important;
    color: var(--mm-dark) !important;
    transform: scale(1.1);
}

.level-1-item.is-step.active .level-1-link span {
    color: var(--mm-yellow) !important;
}

.level-1-item.is-step > a { cursor: default !important; }

/* ============================================
   RESPONSIVE (1520px)
   ============================================ */
@media (max-width: 1520px) {
    .megamenu-panel { width: 95vw; left: 2.5vw; top: 225%; }
    .megamenu-inner { flex-direction: column; max-height: 85vh; overflow-y: auto; }
    .megamenu-sidebar { width: 100%; border-radius: 12px 12px 0 0; overflow-y: visible; }
    .megamenu-content { display: none !important; }
    .megamenu-pane { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; margin-top: 5px; }
    .pane-grid { grid-template-columns: 1fr; }
    .megamenu-trigger span { display: none; }
}