/* =========================================
   CUSTOM DARK GLASS MOBILE MENU (REFINED)
   ========================================= */

/* 1. Reset & Base */
.custom-mobile-menu-overlay {
    line-height: 1.5;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

.custom-mobile-menu-overlay * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 2. Menu Overlay */
.custom-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    /* Backdrop dim */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2147483647;
    /* MAX Z-Index */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: block;
    /* Always block, controlled by visibility */
    pointer-events: none;
}

.custom-mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 3. Menu Drawer */
.custom-mobile-menu-drawer {
    position: absolute;
    top: 0;
    left: -100%;
    /* Hidden left */
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #0f1014;
    /* Solid dark fallback */
    background: rgba(15, 16, 20, 0.96);
    /* Deep glass dark */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transition: all 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    display: flex;
    flex-direction: column;
}

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

/* 4. Menu Header */
.custom-menu-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Logo Left, Close Right */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 80px;
    background: rgba(255, 255, 255, 0.02);
}

.custom-menu-logo img {
    max-width: 180px;
    /* Reasonable logo size */
    height: auto;
    display: block;
}

/* Close Button (Inside Drawer now) */
.custom-menu-close-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    /* Force Circle */
    min-height: 40px;
    /* Force Circle */
    flex-shrink: 0;
    /* Prevent Flex Squeeze */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    transition: all 0.3s ease;
}

.custom-menu-close-btn:hover {
    background: #f68a1e;
    color: #fff;
    border-color: #f68a1e;
    transform: rotate(90deg);
}

/* 5. Menu Content */
.custom-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.custom-main-nav ul {
    list-style: none;
}

.custom-main-nav li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Wrapper to handle Flex between Link and Arrow */
.custom-link-wrapper {
    display: flex;
    align-items: stretch;
    /* Full height click area */
    justify-content: space-between;
    position: relative;
    width: 100%;
}

/* Link Styles */
.custom-nav-link {
    flex: 1;
    display: block;
    padding: 16px 20px;
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.custom-nav-link:hover {
    color: #f68a1e;
    background: rgba(255, 255, 255, 0.02);
    padding-left: 25px;
}

/* Expand Button */
.custom-menu-expand {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    color: #94a3b8;
    background: rgba(0, 0, 0, 0.2);
    transition: 0.3s;
}

.custom-menu-expand i {
    transition: transform 0.3s ease;
}

/* Active State for Expand */
.custom-menu-expand.expanded {
    background: #f68a1e;
    color: #fff;
}

.custom-menu-expand.expanded i {
    transform: rotate(90deg);
}

/* 6. Submenu */
.custom-sub-menu {
    display: none;
    /* JS toggles this */
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.2);
}

.custom-sub-menu li a {
    display: block;
    padding: 14px 20px 14px 40px;
    /* Indented */
    color: #cbd5e1;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.custom-sub-menu li a:hover {
    color: #f68a1e;
    background: rgba(255, 255, 255, 0.02);
}

/* 7. Footer */
.custom-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.custom-footer-link {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-footer-link i {
    color: #f68a1e;
    width: 20px;
}

.custom-footer-link:hover {
    color: #fff;
}