/* ===== Mobile navigation — fix click-capture bug + redesign ===== */

/* ---- BUG FIX ----
   The overlay is rendered (display:block on mobile) but opacity:0 — so it's
   invisible yet still covers the viewport AND captures clicks. Force it inert
   when not .active so the page underneath is interactive again. */
.mobile-menu-overlay { pointer-events: none; }
.mobile-menu-overlay.active { pointer-events: auto; }

/* ---- REDESIGN ---- */
@media (max-width: 768px) {
    /* Side panel — wider on small screens, frosted look */
    .mobile-menu {
        top: 0;
        width: 320px;
        max-width: 88vw;
        height: 100vh;
        max-height: 100vh;
        background: #fff;
        border-left: 0;
        box-shadow: -16px 0 48px rgba(15,17,26,0.18);
        padding: 0;
        display: flex;
        flex-direction: column;
        transform: translateX(105%);
    }
    .mobile-menu.active { transform: translateX(0); }

    .mobile-menu-overlay { background: rgba(15,17,26,0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }

    /* Sticky header inside the panel */
    .mm-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-light, #ECEEF5);
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 2;
    }
    .mm-brand {
        display: flex; align-items: center; gap: 10px;
        color: var(--text, #1A1D26); text-decoration: none;
        font-weight: 800; font-size: 17px; letter-spacing: -0.3px;
    }
    .mm-brand-icon {
        width: 32px; height: 32px;
        background: var(--accent, #3B5BDB);
        border-radius: 8px;
        display: inline-flex; align-items: center; justify-content: center;
        color: #fff;
    }
    .mm-close {
        width: 38px; height: 38px;
        background: var(--bg, #F8F9FC);
        border: 1px solid var(--border-light, #ECEEF5);
        border-radius: 10px;
        display: inline-flex; align-items: center; justify-content: center;
        cursor: pointer;
        color: var(--text-secondary, #5B6178);
        transition: color .15s, border-color .15s, background .15s;
    }
    .mm-close:hover, .mm-close:active { color: var(--accent, #3B5BDB); border-color: var(--accent, #3B5BDB); background: var(--accent-light, #EBF0FF); }

    /* Scrolling body */
    .mm-body {
        flex: 1; overflow-y: auto; padding: 8px 0 20px;
        -webkit-overflow-scrolling: touch;
    }

    /* Section blocks */
    .mm-section { padding: 14px 20px 6px; }
    .mm-label {
        font-size: 11px; font-weight: 800;
        text-transform: uppercase; letter-spacing: 0.8px;
        color: var(--text-muted, #6E7490);
        margin-bottom: 6px;
    }

    /* Each link is a tap target ≥48px */
    .mm-link {
        display: flex; align-items: center; gap: 14px;
        padding: 13px 4px;
        text-decoration: none;
        color: var(--text, #1A1D26);
        font-size: 15px; font-weight: 600;
        border-radius: 10px;
        transition: background .12s, color .12s;
    }
    .mm-link:hover, .mm-link:active { background: var(--accent-light, #EBF0FF); color: var(--accent-dark, #2E4BB0); padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
    .mm-link-emoji { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
    .mm-link-chevron { margin-left: auto; color: var(--text-light, #9198AE); }

    /* Tool category list — denser grid 2-col */
    .mm-tool-grid {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
        margin-top: 6px;
    }
    .mm-tool {
        display: flex; align-items: center; gap: 8px;
        padding: 11px 12px;
        background: var(--bg, #F8F9FC);
        border: 1px solid var(--border-light, #ECEEF5);
        border-radius: 10px;
        text-decoration: none;
        color: var(--text, #1A1D26);
        font-size: 13px; font-weight: 600;
        transition: border-color .12s, color .12s, background .12s;
    }
    .mm-tool:hover, .mm-tool:active { border-color: var(--accent, #3B5BDB); color: var(--accent, #3B5BDB); background: var(--accent-light, #EBF0FF); }
    .mm-tool-emoji { font-size: 16px; }

    /* Auth section — last block in the drawer, separated from Navigation by a top border */
    .mm-section.mm-auth {
        padding: 18px 20px 24px;
        display: grid; gap: 10px;
        border-top: 1px solid var(--border-light, #ECEEF5);
        margin-top: 8px;
    }
    .mm-btn {
        display: block; width: 100%;
        padding: 13px 16px;
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-size: 15px; font-weight: 700;
        border-radius: 12px;
        text-align: center;
        text-decoration: none;
        cursor: pointer;
        transition: all .15s;
        border: 1.5px solid transparent;
    }
    .mm-btn-primary { background: var(--accent, #3B5BDB); color: #fff; }
    .mm-btn-primary:hover, .mm-btn-primary:active { background: var(--accent-hover, #3350C4); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(59,91,219,0.35); }
    .mm-btn-outline { background: transparent; color: var(--text-secondary, #5B6178); border-color: var(--border, #E2E5F0); }
    .mm-btn-outline:hover, .mm-btn-outline:active { color: var(--accent, #3B5BDB); border-color: var(--accent, #3B5BDB); background: var(--accent-light, #EBF0FF); }
}
