﻿/* -----------------------------------------------------------
   ANIMATIONS
----------------------------------------------------------- */
@keyframes menuBounceBack {
    0% {
        transform: translateX(-20px);
    }

    40% {
        transform: translateX(5px);
    }

    70% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

/* -----------------------------------------------------------
   DESKTOP MENU BASE
----------------------------------------------------------- */
#wrapper .menu-main {
    display: block;
    align-items: center;
    position: relative !important; /* anchor for ALL submenus */
    width: 100%;
    padding: 18px 0;
}

@media (max-width: 990px) {
    #wrapper .menu-main {
        display: none;
    }
}

/* FORCE ALL <li> TO BE STATIC — CRITICAL FIX */
#wrapper .menu-main ul li {
    position: static !important;
}

#wrapper .menu-main ul {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    align-items: center;
    overflow: visible;
    padding: 0;
    margin: 0;
}

#wrapper .menu-main > ul > li {
    list-style: none;
    z-index: 1;
    display: block;
    margin: 0 20px;
}

@media only screen and (max-width: 1600px) {
    #wrapper .menu-main > ul > li {
        margin: 0 26px;
    }
}

#wrapper .menu-main ul li a {
    color: #ffffff;
    font-family: "Raleway", sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    display: inline-block;
    position: relative;
    padding: 10px 0;
    text-decoration: none;
    transition: all 0.4s ease;
}

    #wrapper .menu-main ul li a:hover {
        color: #00bfff;
    }

/* -----------------------------------------------------------
   MAIN SUB-MENU — CONTENT-WIDTH MEGA-MENU
----------------------------------------------------------- */
#wrapper .menu-main ul li .sub-menu {
    position: absolute;
    top: 100%;
    /* anchor to menu-main width */
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 20px 40px;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    background: rgba(42, 76, 155, 0.90);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    list-style: none;
    margin: 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease;
}

#wrapper .menu-main ul li.hover-intent > .sub-menu {
    visibility: visible;
    opacity: 1;
}

/* items inside mega-menu */
#wrapper .menu-main ul li .sub-menu > li {
    padding: 6px 0;
}

/* links inside mega-menu */
#wrapper .menu-main ul li .sub-menu a {
    display: block;
    padding: 6px 10px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
}

    #wrapper .menu-main ul li .sub-menu a:hover {
        color: #00bfff;
        padding-left: 16px;
    }

/* -----------------------------------------------------------
   SUB-SUB-MENU — MULTI-COLUMN PANEL (INSIDE MEGA-MENU)
----------------------------------------------------------- */
#wrapper .menu-main ul li .sub-menu .sub-sub-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    max-width: 600px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    background: rgba(42, 76, 155, 0.95);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    list-style: none;
    margin: 0;
    z-index: 99999;
    isolation: isolate;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s ease;
}

#wrapper .menu-main ul li .sub-menu li.hover-intent > .sub-sub-menu {
    visibility: visible;
    opacity: 1;
}

/* -----------------------------------------------------------
   ARROWS
----------------------------------------------------------- */
#wrapper .menu-main ul li:has(.sub-menu) > a::after {
    content: "˅";
    position: absolute;
    right: -22px;
    font-size: 23px;
    opacity: 0.7;
}

#wrapper .menu-main ul li .sub-menu li:has(.sub-sub-menu) > a::after {
    content: ">";
    position: absolute;
    right: 1px;
    font-size: 18px;
    opacity: 0.7;
}

/* -----------------------------------------------------------
   OVERFLOW MENU — CONTENT-WIDTH MEGA-MENU
----------------------------------------------------------- */
#wrapper .menu-main ul li.more {
    margin-left: auto;
    position: static !important;
}

    #wrapper .menu-main ul li.more .overflow-menu {
        position: absolute;
        top: calc(100% - 22px);
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        padding: 20px 40px;
        box-sizing: border-box;
        backdrop-filter: blur(8px);
        background: rgba(42, 76, 155, 0.90);
        border-radius: 0 0 6px 6px;
        border: 1px solid rgba(255,255,255,0.15);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        list-style: none;
        margin: 0;
        visibility: hidden;
        opacity: 0;
        transition: opacity .25s ease;
    }

    #wrapper .menu-main ul li.more.open .overflow-menu {
        visibility: visible;
        opacity: 1;
    }

    #wrapper .menu-main ul li.more .overflow-menu a { 
        font-size: 16px;
    }

    #wrapper .menu-main ul li.more .overflow-menu li:has(.sub-menu) > a::after {
        top: 7px;
    }

    /* -----------------------------------------------------------
   SUB-MENU INSIDE OVERFLOW — CONTENT-WIDTH MEGA-MENU
----------------------------------------------------------- */
    #wrapper .menu-main ul li.more .overflow-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        padding: 20px 40px;
        box-sizing: border-box;
        backdrop-filter: blur(8px);
        background: rgba(42, 76, 155, 0.95);
        border-radius: 0 0 6px 6px;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        list-style: none;
        margin: 0;
        z-index: 99998;
        visibility: hidden;
        opacity: 0;
        transition: opacity .25s ease;
    }

    #wrapper .menu-main ul li.more .overflow-menu li.hover-intent > .sub-menu {
        visibility: visible;
        opacity: 1;
    }

/* -----------------------------------------------------------
   MOBILE MENU (unchanged)
----------------------------------------------------------- */
#wrapper .hamburger {
    width: 32px;
    cursor: pointer;
    padding: 20px;
    display: none;
}

@media (max-width: 990px) {
    #wrapper .hamburger {
        display: block;
    }

    #wrapper .mobile-menu {
        display: block;
    }
}

/* (Your entire mobile + login menu CSS remains unchanged below this point) */

#wrapper .mobile-menu .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 10px;
}

    #wrapper .hamburger span {
        display: block;
        height: 3px;
        margin: 6px 0;
        background: #ffffff;
        transition: all 0.3s ease;
    }

    /* Animate to X */
    #wrapper .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    #wrapper .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    #wrapper .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

#wrapper .mobile-menu {
    position: fixed;
    top: 0;
    right: -360px;
    width: 320px;
    height: 90vh;
    background: rgba(42, 76, 155, 0.95);
    backdrop-filter: blur(8px);
    padding: 60px 20px 40px 20px;
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
    overflow-y: auto;
    transition: right 0.35s ease;
    z-index: 9999;
    border-radius: 0 0 0 6px;
    display: none;
}

    #wrapper .mobile-menu.open {
        right: 0;
    }

    #wrapper .mobile-menu a {
        display: block;
        padding: 14px 10px;
        color: #ffffff;
        font-family: "Raleway", sans-serif;
        font-size: 20px;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.3s ease;
    }

        #wrapper .mobile-menu a:hover {
            color: #00bfff;
            padding-left: 20px;
        }

    #wrapper .mobile-menu ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #wrapper .mobile-menu li {
        position: relative;
        margin-bottom: 6px;
    }

.mobile-menu.bounce {
    animation: menuBounceBack 0.35s ease-out;
}

#wrapper .mobile-submenu {
    display: none;
    padding-left: 15px;
    border-left: 2px solid rgba(255,255,255,0.2);
    margin-top: 6px;
}

#wrapper .mobile-menu li.open > .mobile-submenu {
    display: block;
    padding-left: 15px;
}

#wrapper .submenu-toggle::after {
    content: "˅";
    font-size: 22px;
    color: #fff;
    opacity: 0.7;
    transition: transform .3s ease;
}

#wrapper .mobile-menu li.open > .submenu-toggle::after {
    content: "˄";
}

.submenu-toggle {
    position: absolute;
    right: 5px;
    top: 28px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
}

    .submenu-toggle::after {
        content: "˅";
        font-size: 20px;
        color: #fff;
        opacity: 0.7;
        transition: transform .3s ease;
    }

li.open > .submenu-toggle::after {
    transform: rotate(180deg);
}

@media (max-width: 990px) {
    #wrapper .hamburger {
        display: block;
    }

    #wrapper .mobile-menu {
        display: block;
    }
}

#wrapper .login-btn-wrapper {
    text-align: center;
}

#wrapper .login-menu {
    display: block;
}

@media (max-width: 991px) {
    #wrapper .login-menu {
        display: none;
    }
}

#wrapper .login-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    #wrapper .login-menu ul li {
        list-style: none;
        position: relative;
        z-index: 1;
        display: inline-block;
        margin: 0;
    }

        #wrapper .login-menu ul li a {
            color: #ffffff;
            font-family: "Raleway", sans-serif;
            font-size: 20px;
            font-weight: 500;
            line-height: 1;
            display: flex;
            align-items: center;
            margin-left: 6px;
            gap: 6px;
            position: relative;
            padding: 26px 0 26px 0;
            text-decoration: none;
            transition: all 0.4s ease 0s;
            -webkit-transition: all 0.4s ease 0s;
            -moz-transition: all 0.4s ease 0s;
            -o-transition: all 0.4s ease 0s;
            -ms-transition: all 0.4s ease 0s;
        }

            #wrapper .login-menu ul li a:hover {
                color: #00bfff;
            }

                #wrapper .login-menu ul li a:hover .login-icon {
                    background-color: #00bfff;
                }

        #wrapper .login-menu ul li .sub-menu {
            border: 0;
            position: absolute;
            top: 100%;
            right: -10px;
            z-index: 5;
            backdrop-filter: blur(8px);
            background: rgba(42, 76, 155, 0.85);
            border-radius: 6px;
            display: block;
            padding: 10px 0;
            margin: 0;
            text-align: left;
            list-style: none;
            visibility: hidden;
            opacity: 0;
            min-width: 220px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.15);
            transform: translateY(10px);
            -webkit-transition: all 0.3s ease-in-out;
            -moz-transition: all 0.3s ease-in-out;
            -ms-transition: all 0.3s ease-in-out;
            -o-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
        }

        #wrapper .login-menu ul li:hover > .sub-menu {
            visibility: visible;
            opacity: 1;
            transform: translateY(0);
        }

        #wrapper .login-menu ul li .sub-menu a {
            display: block;
            padding: 8px 20px;
            color: #fff;
            text-decoration: none;
            font-size: 16px;
        }

            #wrapper .login-menu ul li .sub-menu a:hover {
                color: #00bfff;
                padding-left: 24px;
            }

        #wrapper .login-menu ul li .sub-menu li {
            position: relative;
        }

#wrapper .login-icon {
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    mask: url("/images/person-circle.svg") no-repeat center;
    mask-size: contain;
    transition: all 0.4s ease 0s;
    -webkit-transition: all 0.4s ease 0s;
    -moz-transition: all 0.4s ease 0s;
    -o-transition: all 0.4s ease 0s;
    -ms-transition: all 0.4s ease 0s;
}

#wrapper .login-icon.mobile {
    padding: 10px 0 10px 0;
    margin-right: 10px
}

#wrapper .mobile-menu-login a {
    display: flex;
    padding: 14px 10px;
    color: #ffffff;
    font-family: "Raleway", sans-serif;
    font-size: 20px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

    #wrapper .mobile-menu-login a:hover {
        color: #00bfff;
        padding-left: 20px;
    }

#wrapper .mobile-menu-login a:hover .login-icon.mobile {
    background-color: #00bfff;
}

#wrapper .mobile-menu-login li {
    position: relative;
    margin-bottom: 6px;
}
