﻿.m-overlay {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 998;
}

    .m-overlay.is-open {
        opacity: 1;
        pointer-events: auto;
    }

/* Sidebar on RIGHT */
.m-nav-right {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    height: calc(100vh - var(--nav-h));
    width: min(85vw, var(--menu-w));
    background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
    border-left: 1px solid rgba(255,255,255,.08);
    box-shadow: -10px 0 40px rgba(0,0,0,.45);
    transform: translateX(105%);
    transition: transform .25s ease;
    z-index: 999;
    overflow-y: auto;
    padding: 12px;
}

    .m-nav-right.is-open {
        transform: translateX(0);
    }

/* Menu */
.m-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .m-menu > li {
        margin: 8px 0;
    }

/* Links */
.m-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    color: #e5e7eb;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.09);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

a.m-link:hover,
button.m-link:hover {
    background: rgba(56,189,248,.12);
    border-color: rgba(56,189,248,.28);
    transform: translateX(-3px);
}

/* Button reset */
button.m-link {
    cursor: pointer;
    outline: none;
    border: 1px solid rgba(255,255,255,.09);
}

/* Submenu */
.m-submenu {
    list-style: none;
    padding: 8px 0 0 12px;
    margin: 0;
    display: none;
}

    .m-submenu li {
        margin: 6px 0;
    }

.m-sublink {
    display: block;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(229,231,235,.92);
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.07);
}

    .m-sublink:hover {
        background: rgba(56,189,248,.10);
        border-color: rgba(56,189,248,.22);
    }

/* Caret rotate */
.has-sub.is-expanded .m-caret {
    transform: rotate(180deg);
}

.m-caret {
    transition: transform .18s ease;
}
