/* OAcom Template - Navigation & Menu Overlay Styles */

/* ============================================================
   MENU CONTAINER (hamburger trigger circle)
   ============================================================ */
.menu-container {
    background-color: transparent;
    border-radius: 100%;
    color: white;
    cursor: pointer;
    position: fixed;
    z-index: 200001 !important; /* Above all other elements including oui-assistant */
    width: 300px;
    height: 300px;
    left: -120px;
    top: -120px;
    transition: none;
    transform: translate(-100%, -100%);
    transform-origin: center center;
    opacity: 0;
}

/* Yellow circle as pseudo-element */
.menu-container::before {
    content: '';
    position: fixed; /* Changed to fixed to create separate stacking context */
    width: 300px;
    height: 300px;
    background-color: #ffc901;
    border-radius: 100%;
    left: -120px;
    top: -120px;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    transform: translate(-100%, -100%);
    opacity: 0;
    z-index: 9995; /* Behind everything - just the yellow background */
    pointer-events: none; /* Don't interfere with clicks */
}

/* When menu is open, expand the yellow circle */
.menu-container.full-menu::before {
    width: 200vw;
    height: 200vh;
    left: -50vw;
    top: -50vh;
    border-radius: 0;
}

.menu-container.full-menu {
    border-radius: 0;
    padding: 0 !important;
    position: fixed;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    transition: none;
    z-index: 9998 !important; /* Below menu items and chatbox when open */
    pointer-events: none !important; /* Don't block clicks when expanded */
    box-shadow: 0 0 100px rgba(255, 201, 1, 0.5);
}

/* ============================================================
   MENU TOGGLE BUTTON (.menu icon)
   ============================================================ */
.menu {
    color: white;
    font-size: 3.5em;
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 200002 !important; /* Highest z-index above oui-assistant */
    transition: none;
    pointer-events: auto; /* Ensure it's always clickable */
}

.menu i {
    opacity: 0.7;
    transform: scale(1);
    transition: none;
}

.menu i:hover {
    opacity: 1;
    transform: scale(1.2);
    transition: none;
}

/* Style the menu toggle button (absolute position inside container) */
.menu-container .menu {
    z-index: 10001; /* Above the yellow circle */
    background-color: #ffc901;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 140px;
    left: 140px;
}

/* Reposition toggle button when menu is open */
.full-menu .menu {
    top: 40px;
    left: 40px;
    pointer-events: auto; /* Keep the X button clickable */
}

/* ============================================================
   OVERLAY (full-screen nav panel)
   ============================================================ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    z-index: 10002; /* Above yellow circle */
}

.overlay.open {
    opacity: 1;
    visibility: visible;
    height: 100%;
    overflow: auto; /* Allow scrolling if needed */
    padding-top: 10vh; /* Keep content below the toggle */
    z-index: 10000 !important; /* Above yellow background (9995) but below menu items */
    position: fixed; /* Ensure it's properly positioned */
}

.overlay.open li {
    opacity: 1 !important;
}

.overlay.open li:nth-of-type(2) {
}

.overlay.open li:nth-of-type(3) {
}

.overlay.open li:nth-of-type(4) {
}

.overlay.open ul li {
    opacity: 1 !important;
}

.overlay.open ul li a {
    opacity: 0.7;
}

.overlay nav {
    font-size: 3.2em;
    font-family: 'Titan One', san-serif;
    position: relative;
    height: 100vh;
    top: 0%;
    z-index: inherit; /* Inherit from parent overlay */
    font-weight: 400;
    text-align: center;
}

.overlay ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: inline-block;
    position: relative;
    height: 100%;
}

.overlay ul li {
    display: block;
    min-height: 10vh;
    min-height: 50px;
    position: relative;
    opacity: 1;
}

.overlay ul li a {
    display: block;
    position: relative;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
    transition: none;
}

.overlay ul li a:hover,
.overlay ul li a:focus,
.overlay ul li a:active {
    opacity: 1;
    transform: scale(1.2);
    transition: none;
}

/* ============================================================
   SIDEBAR MENU (#sidebar-menu)
   ============================================================ */
.overlay ul#sidebar-menu li {
    height: auto !important;
}

#sidebar-menu {
    width: 100%;
}

#sidebar-menu li a {
    font-family: 'PolicePrincipale';
}

/* Keep first level menu items in left column */
#sidebar-menu > li {
    display: block;
    text-align: left;
    position: relative;
}

/* Hide submenus by default and position them in right column */
#sidebar-menu li.deeper > ul.nav-child {
    display: none;
    position: fixed;
    left: 45%;
    top: 22vh;
    right: 0;
    bottom: 0;
    z-index: 10001; /* Behind social section */
    background-color: rgba(255, 201, 1, 0.98);
    padding: 40px;
    list-style: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

/* Add pseudo-element for background behind social */
#sidebar-menu li.deeper > ul.nav-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 201, 1, 0.98);
    z-index: -1;
}

/* Show submenu on hover of parent item */
#sidebar-menu li.deeper:hover > ul.nav-child,
#sidebar-menu li.deeper > ul.nav-child.layer_actif {
    display: block;
    opacity: 1;
}

/* Style submenu items */
#sidebar-menu ul.nav-child li {
    display: block;
    margin-bottom: 15px;
    text-align: left;
    position: relative;
    z-index: 10004; /* Above social section */
}

#sidebar-menu ul.nav-child li a {
    color: #fff;
    font-size: 1.5em;
    text-decoration: none;
    display: block;
    padding: 10px;
    transition: transform 0.2s ease;
    position: relative;
    z-index: 10004; /* Above social section */
}

#sidebar-menu ul.nav-child li a:hover {
    transform: scale(1.1);
    opacity: 1;
}

/* Active submenu panel (layer_actif) */
#sidebar-menu li.deeper ul.layer_actif {
    position: fixed;
    left: 45% !important;
    top: 22vh !important;
    bottom: 0;
    right: 22%;
    z-index: 10003; /* Above social section and overlay */
    opacity: 1;
    background-color: var(--template-sidebar-bg) !important;
}

/* ============================================================
   FOOTER MENU POSITION FIX
   ============================================================ */
footer ul.menu {
    position: relative !important;
}


/* ============================================================
   MOBILE MENU OVERLAY - 768px and below
   Override inline styles on the overlay for mobile layout
   ============================================================ */

/* ============================================================
   MOBILE MENU — Consistent discreet sizing (≤980px)
   All burger/yellow-circle sizing lives here.
   ============================================================ */
@media (max-width: 980px) {
    .menu-container {
        width: 120px;
        height: 120px;
        left: -40px;
        top: -40px;
    }

    .menu-container::before {
        width: 120px;
        height: 120px;
        left: -40px;
        top: -40px;
    }

    .menu-container .menu {
        width: 42px;
        height: 42px;
        top: 50px;
        left: 50px;
    }
}

@media (max-width: 768px) {

    /* --- Discreet burger: small yellow circle, small button --- */
    .menu-container {
        width: 80px;
        height: 80px;
        left: -20px;
        top: -20px;
    }

    .menu-container::before {
        width: 80px;
        height: 80px;
        left: -20px;
        top: -20px;
    }

    .menu-container .menu {
        width: 36px !important;
        height: 36px !important;
        top: 26px !important;
        left: 26px !important;
    }

    .full-menu .menu {
        top: 30px !important;
        left: 30px !important;
    }

    /* --- Overlay: make scrollable --- */
    #overlay {
        overflow-y: auto !important;
    }

    /* --- Two-column flex → single column stack --- */
    #overlay > div[style*="display: flex"] {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
    }

    /* --- Left column (menu): full width --- */
    #overlay > div > div[style*="width: 40%"] {
        width: 100% !important;
        padding: 100px 30px 30px 30px !important;
        overflow-y: visible !important;
    }

    /* --- Right column (submenus): full width, below menu --- */
    #overlay > div > div#submenu-area {
        width: 100% !important;
        padding: 0 30px 30px 30px !important;
        position: relative !important;
    }

    /* --- Submenus: inline instead of fixed overlay --- */
    #submenu-area > div[id^="submenu-"] {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        padding: 10px 20px !important;
        margin-bottom: 10px;
    }

    #submenu-area a {
        font-size: 16px !important;
        color: #333 !important;
    }

    /* --- Social section: relative, stacked below menu --- */
    #overlay > div[style*="position: fixed"][style*="bottom: 50px"] {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        text-align: center !important;
        padding: 30px !important;
        width: 100% !important;
    }

    /* Phone number: smaller on mobile */
    #overlay > div[style*="position: fixed"] > div[style*="font-size: 32px"] {
        font-size: 24px !important;
    }

    /* --- Menu items: comfortable touch targets --- */
    #sidebar-menu li {
        margin-bottom: 10px !important;
    }

    #sidebar-menu li a {
        font-size: 22px !important;
        padding: 12px 0 !important;
    }

    /* --- Navigation CSS submenu overrides --- */
    #sidebar-menu li.deeper > ul.nav-child,
    #sidebar-menu li.deeper ul.layer_actif {
        position: relative !important;
        left: 0 !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        padding: 10px 20px !important;
        background-color: rgba(255, 201, 1, 0.6) !important;
        border-radius: 8px;
    }

    #sidebar-menu ul.nav-child li a {
        font-size: 18px !important;
    }
}
