/* =====================================================================
   Mobile / tablet menu (< 1024px) — per design_handoff_mobile_menu.
   One bar (logo left, menu right) + right-side drawer, all flows.
   Desktop (>= 1024px) is unchanged: the existing header shows, this hides.
   Shared classes are prefixed .mmenu-*.
   ===================================================================== */

/* hidden on desktop; the existing header owns >= 1024px */
.mmenu-root { display: none; }

@media (max-width: 1023px) {

    /* hide the existing per-flow desktop header on tablet/phone */
    .mmenu-hide-mobile { display: none !important; }

    .mmenu-root { display: block; }

    /* ---- top bar ---- */
    .mmenu-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 8px 0 16px;
        background: #ffffff;
        border-bottom: 1px solid #ededed;
        position: relative;
        z-index: 1000;
    }

    .mmenu-logo {
        display: flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
    }

        /* Vodacom-Logo.svg declares a 1200x800 (1.5:1) box but its viewBox is
           260 x 75.42 (~3.45:1), so height + width:auto letterboxes the logo to
           ~10px tall. Size the box to the real logo ratio so it fills to ~26px. */
        .mmenu-logo img {
            height: 26px;
            width: 90px;
            display: block;
        }

    .mmenu-btn {
        width: 44px;
        height: 44px;
        border: none;
        background: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .mmenu-btn-lines {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

        .mmenu-btn-lines span {
            display: block;
            height: 1.75px;
            background: #1f1f1f;
        }

            .mmenu-btn-lines span:nth-child(1),
            .mmenu-btn-lines span:nth-child(2) {
                width: 20px;
            }

            .mmenu-btn-lines span:nth-child(3) {
                width: 14px;
            }

    /* ---- backdrop ---- */
    .mmenu-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(20,20,20,.4);
        opacity: 0;
        transition: opacity .25s;
        pointer-events: none;
        z-index: 1100;
    }

    .mmenu-root.mmenu-open .mmenu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* ---- drawer ---- */
    .mmenu-drawer {
        position: fixed;
        top: 0;
        right: 0;
        /* Height tracks the VISIBLE viewport so the pinned footer (Log out / Login)
           never falls below a mobile browser's bottom bar. mobile-menu.js also sets
           the exact visualViewport height on open as a belt-and-braces. */
        height: 100vh;
        height: 100dvh;
        width: 340px;
        max-width: calc(100vw - 40px);
        background: #ffffff;
        box-shadow: 0 0 24px rgba(0,0,0,.18);
        display: flex;
        flex-direction: column;
        transform: translateX(105%);
        /* Closed = off-screen AND visibility:hidden, so its links/buttons drop out of
           the Tab order (transform alone leaves them focusable inside aria-hidden).
           visibility flips only after the slide-out finishes (.3s delay). */
        visibility: hidden;
        transition: transform .3s cubic-bezier(.2,.8,.2,1), visibility 0s .3s;
        z-index: 1101;
    }

    .mmenu-root.mmenu-open .mmenu-drawer {
        transform: translateX(0);
        visibility: visible;
        transition-delay: 0s;
    }

    .mmenu-drawer-head {
        height: 56px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 8px 0 16px;
        border-bottom: 1px solid #ededed;
    }

    .mmenu-drawer-logo {
        display: flex;
        align-items: center;
        gap: 6px;
    }

        .mmenu-drawer-logo img {
            height: 24px;
            width: 83px;
            display: block;
        }

    .mmenu-close {
        width: 44px;
        height: 44px;
        border: none;
        background: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: 'Material Symbols Outlined';
        font-size: 22px;
        font-weight: 300;
        color: #1f1f1f;
        line-height: 1;
    }

    /* ---- user block (Dealer, Admin) ---- */
    .mmenu-user {
        padding: 16px 20px;
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #ececec;
    }

    .mmenu-avatar {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border-radius: 50%;
        background: #fdeaea;
        color: #e60000;
        font-size: 16px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        text-transform: uppercase;
    }

    .mmenu-user-name {
        font-size: 15px;
        font-weight: 700;
        color: #1f1f1f;
    }

    .mmenu-user-role {
        font-size: 12px;
        color: #4a4a4a;
    }

    /* ---- nav list ---- */
    .mmenu-nav {
        padding: 8px 0;
        flex: 1;
        overflow: auto;
    }

    .mmenu-item {
        display: flex;
        align-items: center;
        gap: 14px;
        height: 52px;
        padding: 0 20px;
        font-size: 15px;
        color: #1f1f1f;
        text-decoration: none;
    }

        .mmenu-item:hover {
            background: #fafafa;
            color: #1f1f1f;
        }

    .mmenu-ico {
        font-family: 'Material Symbols Outlined';
        font-size: 22px;
        font-weight: 300;
        color: #1f1f1f;
        line-height: 1;
    }

    /* ---- language row ---- */
    .mmenu-lang {
        margin: 8px 20px;
        padding-top: 12px;
        border-top: 1px solid #ececec;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 14px;
        color: #4a4a4a;
    }

    .mmenu-seg {
        display: flex;
        border: 1px solid #d4d4d4;
        border-radius: 8px;
        overflow: hidden;
        font-size: 13px;
        font-weight: 700;
    }

        .mmenu-seg a {
            height: 36px;
            padding: 0 14px;
            display: flex;
            align-items: center;
            background: #ffffff;
            color: #1f1f1f;
            text-decoration: none;
        }

            .mmenu-seg a.mmenu-seg-active {
                background: #1f1f1f;
                color: #ffffff;
            }

    /* ---- footer action ---- */
    .mmenu-logout-form {
        margin: 0;
        flex-shrink: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mmenu-footer-logout {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        height: 56px;
        padding: 0 20px;
        border: none;
        border-top: 1px solid #ececec;
        background: none;
        color: #e60000;
        font-size: 15px;
        font-weight: 600;
        text-decoration: none;
        cursor: pointer;
        font-family: inherit;
    }

        .mmenu-footer-logout .mmenu-ico {
            color: #e60000;
        }

    .mmenu-footer-login {
        flex-shrink: 0;
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #ececec;
    }

        .mmenu-footer-login a {
            display: block;
            width: 100%;
            height: 48px;
            line-height: 48px;
            text-align: center;
            border: none;
            border-radius: 10px;
            background: #e60000;
            color: #ffffff;
            font-size: 15px;
            font-weight: 700;
            text-decoration: none;
        }

    /* ---- notice under the bar (e.g. "verify your email OTP" for unverified users) ---- */
    .mmenu-notice {
        padding: 12px 16px;
        background: #ffffff;
        border-bottom: 1px solid #ededed;
        font-size: 14px;
        color: #1f1f1f;
    }

        .mmenu-notice p {
            margin: 0;
        }

            .mmenu-notice p + p {
                margin-top: 4px;
                color: #4a4a4a;
            }

    /* ---- optional page-title row (context, below the bar) ---- */
    .mmenu-pagetitle {
        padding: 16px;
        display: flex;
        align-items: center;
        gap: 2px;
    }

        .mmenu-pagetitle .mmenu-back {
            width: 36px;
            margin-left: -6px;
            font-size: 22px;
            color: #1f1f1f;
            text-decoration: none;
        }

        .mmenu-pagetitle .mmenu-title {
            font-size: 20px;
            font-weight: 700;
            color: #1f1f1f;
        }

    /* ---- ISP Connect: replace its separate fixed header with the shared bar ---- */
    .isp-connect-header,
    .isp-connect-home-logo,
    .isp-connect-home-btn,
    .isp-connect-login-btn,
    .isp-connect-language-selector {
        display: none !important;
    }

    /* ISP keeps a fixed bar (its layout reserves top padding for a fixed header) */
    .mmenu-root--fixed .mmenu-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
    }

    /* reserve the 56px bar height across the whole < 1024px range (isp-components
       only does this at <= 768px) so content clears the fixed bar on tablet too */
    .isp-connect-main {
        padding-top: calc(56px + var(--isc-space-lg, 24px));
    }

    /* scroll-lock while the drawer is open */
    body.mmenu-locked {
        overflow: hidden;
    }
}
