/* =====================================================
   SOCCER WORLD MENU — MOBILE
   4 styles : Side Drawer, Partial Drawer, Bottom Sheet, Push Menu
   Couleurs injectées dynamiquement via PHP (variables CSS)
   ===================================================== */

/* ===== VARIABLES PAR DÉFAUT ===== */
:root {
    --swm-mobile-hamburger:   #ffffff;
    --swm-mobile-bg:          #1a1a1a;
    --swm-mobile-close-bg:    #333333;
    --swm-mobile-close-color: #ffffff;
    --swm-mobile-l1-text:     #ffffff;
    --swm-mobile-l1-bg:       #1a1a1a;
    --swm-mobile-l1-sep:      rgba(255,255,255,0.1);
    --swm-mobile-l2-text:     #cccccc;
    --swm-mobile-l2-bg:       #2a2a2a;
    --swm-mobile-l2-sep:      rgba(255,255,255,0.06);
    --swm-mobile-l3-text:     #aaaaaa;
    --swm-mobile-l3-bg:       #333333;
    --swm-mobile-l3-sep:      rgba(255,255,255,0.04);
    --swm-mobile-hover:       #672068;
}

/* ===== HAMBURGER BUTTON ===== */
.swm-hamburger {
    display: none;
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 500;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
}

.swm-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--swm-mobile-hamburger);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger → croix quand ouvert */
.swm-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.swm-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.swm-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 991px) {
    .swm-hamburger {
        display: flex;
    }
    .swm-nav-menu {
        display: none !important;
    }
}

/* ===== OVERLAY (fond semi-transparent) ===== */
.swm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.swm-overlay.active {
    display: block;
    opacity: 1;
}
/* Overlay masqué pour partial-drawer, push-menu, bottom-sheet */
.swm-overlay.active.no-overlay {
    display: none !important;
}

/* ===== PANEL COMMUN ===== */
.swm-mobile-panel {
    position: fixed;
    z-index: 999999;
    background: var(--swm-mobile-bg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar discrète */
.swm-mobile-panel::-webkit-scrollbar { width: 4px; }
.swm-mobile-panel::-webkit-scrollbar-track { background: transparent; }
.swm-mobile-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ===== BOUTON CLOSE COMMUN ===== */
.swm-close-btn {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 10px 16px;
    background: var(--swm-mobile-bg);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.swm-close-btn .swm-close-x {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: var(--swm-mobile-close-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}
.swm-close-btn .swm-close-x:hover {
    background: rgba(255,255,255,0.1);
}

/* ===== MENU ITEMS COMMUN ===== */
.swm-mobile-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Niveau 1 */
.swm-mobile-panel > ul > li {
    border-bottom: 1px solid var(--swm-mobile-l1-sep);
}

.swm-mobile-panel > ul > li > a,
.swm-mobile-panel > ul > li > .swm-parent-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: var(--swm-mobile-l1-text);
    background: var(--swm-mobile-l1-bg);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
}

.swm-mobile-panel > ul > li > a:hover,
.swm-mobile-panel > ul > li > .swm-parent-toggle:hover {
    color: var(--swm-mobile-hover);
    background: rgba(255,255,255,0.04);
}

/* Label texte dans le bouton toggle */
.swm-parent-toggle .swm-label {
    flex: 1;
    text-align: left;
}

/* Flèche toggle sous-menu */
.swm-toggle-arrow {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 8px;
    font-style: normal;
}
.swm-mobile-panel li.swm-open > .swm-parent-toggle .swm-toggle-arrow,
.swm-mobile-panel li.swm-open > a .swm-toggle-arrow {
    transform: rotate(180deg);
}

/* Niveau 2 */
.swm-mobile-panel .sub-menu {
    display: none;
    border-top: 1px solid var(--swm-mobile-l2-sep);
}
.swm-mobile-panel li.swm-open > .sub-menu {
    display: block;
}

.swm-mobile-panel .sub-menu li {
    border-bottom: 1px solid var(--swm-mobile-l2-sep);
}
.swm-mobile-panel .sub-menu li:last-child {
    border-bottom: none;
}

.swm-mobile-panel .sub-menu li > a,
.swm-mobile-panel .sub-menu li > .swm-parent-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 36px;
    color: var(--swm-mobile-l2-text);
    background: var(--swm-mobile-l2-bg);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
}
.swm-mobile-panel .sub-menu li > a:hover,
.swm-mobile-panel .sub-menu li > .swm-parent-toggle:hover {
    color: var(--swm-mobile-hover);
    background: rgba(255,255,255,0.04);
}

/* Niveau 3 */
.swm-mobile-panel .sub-menu .sub-menu li > a,
.swm-mobile-panel .sub-menu .sub-menu li > .swm-parent-toggle {
    padding-left: 52px;
    color: var(--swm-mobile-l3-text);
    background: var(--swm-mobile-l3-bg);
    font-size: 13px;
    font-weight: 400;
}
.swm-mobile-panel .sub-menu .sub-menu li {
    border-bottom: 1px solid var(--swm-mobile-l3-sep);
}
.swm-mobile-panel .sub-menu .sub-menu li > a:hover {
    color: var(--swm-mobile-hover);
    background: rgba(255,255,255,0.04);
}

/* ══════════════════════════════════════════
   STYLE 1 — SIDE DRAWER
   Slide depuis la droite, hauteur plein écran
   ══════════════════════════════════════════ */
.swm-style-side-drawer {
    top: 0 !important;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 90vw;
    transform: translateX(100%) !important;
    display: flex;
    flex-direction: column;
    z-index: 999999 !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.swm-style-side-drawer.swm-open {
    transform: translateX(0) !important;
}
.swm-style-side-drawer > ul {
    flex: 1;
}

/* ══════════════════════════════════════════
   STYLE 2 — PARTIAL DRAWER
   Identique au Side Drawer
   ══════════════════════════════════════════ */
.swm-style-partial-drawer {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    transform: translateX(100%) !important;
    display: flex;
    flex-direction: column;
    z-index: 99999 !important;
}
.swm-style-partial-drawer.swm-open {
    transform: translateX(0) !important;
}
.swm-style-partial-drawer > ul {
    flex: 1;
}

/* ══════════════════════════════════════════
   STYLE 3 — BOTTOM SHEET
   Monte du bas, plein écran
   ══════════════════════════════════════════ */
.swm-style-bottom-sheet {
    /* top/bottom calculés par JS selon le header actif */
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(100%) !important;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.swm-style-bottom-sheet.swm-open {
    transform: translateY(0) !important;
}
.swm-style-bottom-sheet > ul {
    flex: 1;
    overflow-y: auto;
}

/* ══════════════════════════════════════════
   STYLE 4 — PUSH MENU
   La page se décale à gauche,
   le menu apparaît sur la droite
   ══════════════════════════════════════════ */
.swm-style-push-menu {
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    transform: translateX(100%) !important;
    display: flex;
    flex-direction: column;
}
.swm-style-push-menu.swm-open {
    transform: translateX(0) !important;
}
.swm-style-push-menu > ul {
    flex: 1;
}

/* Body push — appliqué via JS */
body.swm-push-active {
    overflow-x: hidden;
}
/* Enfants directs du body uniquement — évite les transforms cumulatifs
   (ex: double <main> dans Hello Elementor qui faisait un effet x2) */
body.swm-push-active > header,
body.swm-push-active > main,
body.swm-push-active > footer,
body.swm-push-active > div {
    transform: translateX(-280px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body:not(.swm-push-active) > header,
body:not(.swm-push-active) > main,
body:not(.swm-push-active) > footer,
body:not(.swm-push-active) > div {
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== DESKTOP ===== */
@media (min-width: 992px) {
    /* Cacher tout le système mobile */
    .swm-mobile-panel,
    .swm-overlay,
    .swm-hamburger {
        display: none !important;
    }

    /* Désactiver le clic sur les liens parents avec sous-menu */
    .swm-nav-menu > li.dropdown > a,
    .swm-nav-menu > li.dropdown > a.inner-drop {
        pointer-events: none;
        cursor: default;
    }
}


/* ===== STICKY MENU - POSITIONNEMENT ===== */
/* Les couleurs sont déjà gérées par PHP dans swm-menu-dynamic-colors */
.swm-header-sticky {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999 !important;
    transform: translateY(-100%);
    opacity: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.swm-header-sticky.visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Admin bar WordPress */
.admin-bar .swm-header-sticky {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .swm-header-sticky {
        top: 46px;
    }
}

/* Éviter le saut du contenu */
#swm-content.swm-page-wrapper {
    transition: margin-top 0.3s ease;
}