/**
 * Menu Mobile Custom
 * Overlay accordéon pour remplacer Max Mega Menu en mobile
 */

/* Masquer Max Mega Menu en mobile */
@media (max-width: 768px) {
    #mega-menu-wrap-primary {
        display: none !important;
    }
    
    .storefront-primary-navigation {
        display: none !important;
    }
}

/* Bouton hamburger */
.mobile-menu-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    z-index: 10001;
    display: none;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important;
        visibility: visible !important;
    }
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: #fff;
    margin: 4px 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active {
    display: none !important;
}

/* Overlay menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: var(--corinne-bleu);
    z-index: 998;
    overflow-y: auto;
    transition: left 0.3s ease;
    padding-top: 60px;
}

.mobile-menu-overlay.active {
    left: 0;
}

/* Header du menu - masqué car le masthead reste visible */
.mobile-menu-header {
    display: none !important;
}

/* Bouton de fermeture - positionné comme le hamburger */
.mobile-menu-close {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: none !important;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

body.menu-open .mobile-menu-close {
    display: flex !important;
}

/* Liste du menu */
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 20px 20px 100px 20px;
}

.mobile-menu-list > li {
    margin-bottom: 8px;
}

.mobile-menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: #fff;
    text-decoration: none;
    background: transparent;
    border-radius: 0;
    min-height: 48px;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu-list > li > a {
    font-size: 18px;
    font-weight: bold;
}

.mobile-menu-list a:hover,
.mobile-menu-list a:focus {
    background: rgba(255,255,255,0.1);
}

/* Indicateur accordéon */
.menu-item-has-children > a::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.menu-item-has-children.active > a::after {
    transform: rotate(180deg);
}

/* Sous-menu */
.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-item-has-children.active > .sub-menu {
    max-height: 1000px;
    margin-top: 8px;
}

.sub-menu li {
    margin-bottom: 4px;
}

.sub-menu a {
    font-size: 15px;
    font-weight: normal;
    padding-left: 30px;
    background: transparent;
}

.sub-menu a:hover {
    background: rgba(255,255,255,0.1);
}

/* Séparateur de menu */
.mobile-menu-list > li.menu-separator {
    height: 20px;
    border: none;
    background: transparent;
    margin-bottom: 20px;
}

.mobile-menu-list > li.menu-separator a {
    display: none;
}
