/*
 * Mobile menu — namespace .mm-*
 * Off-canvas slide-in panel from left. Only applies <992px.
 * INDEPENDENT from desktop menu.
 */

/* Hide on desktop */
@media (min-width: 992px) {
    .mm-toggle,
    .mm-panel,
    .mm-backdrop { display: none !important; }
}

/* ───── MOBILE MENU (<992px) ───── */
@media (max-width: 991px) {
    /* Hamburger toggle button (in header bar — placed via .h-bar-mobile) */
    .mm-toggle {
        flex: 0 0 30px;
        width: 30px;
        height: 30px;
        padding: 4px;
        background: transparent;
        border: 0;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        -webkit-tap-highlight-color: transparent;
    }
    .mm-toggle span {
        display: block;
        width: 22px;
        height: 3px;
        background: #404759;
        border-radius: 2px;
        transition: transform .25s, opacity .15s;
    }
    .mm-toggle:hover span { background: #d90202; }
    body.mm-open .mm-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.mm-open .mm-toggle span:nth-child(2) { opacity: 0; }
    body.mm-open .mm-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Off-canvas panel */
    .mm-panel {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 80vw);
        z-index: 1010;
        background: #fff;
        box-shadow: 2px 0 16px rgba(0,0,0,.2);
        transform: translateX(-100%);
        transition: transform .25s ease;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    body.mm-open .mm-panel {
        transform: translateX(0);
    }

    /* Header of panel */
    .mm-panel__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
    }
    .mm-panel__title {
        font-weight: 700;
        font-size: 16px;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: #1f2937;
    }
    .mm-panel__close {
        width: 32px;
        height: 32px;
        background: transparent;
        border: 0;
        font-size: 28px;
        line-height: 1;
        color: #404759;
        cursor: pointer;
        padding: 0;
    }
    .mm-panel__close:hover { color: #d90202; }

    /* Menu list */
    .mm-list,
    .mm-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    .mm-list > li,
    .mm-list .sub-menu > li {
        border-bottom: 1px solid #f3f4f6;
    }
    .mm-list a {
        display: block;
        padding: 12px 16px;
        color: #1f2937;
        text-decoration: none;
        font-size: 15px;
    }
    .mm-list a:hover {
        background: #f3f4f6;
        color: #d90202;
    }
    .mm-list .sub-menu {
        display: none;
        background: #f9fafb;
    }
    .mm-list li.is-open > .sub-menu {
        display: block;
    }
    .mm-list .sub-menu a {
        padding-left: 32px;
        font-size: 14px;
        color: #374151;
    }
    .mm-list .sub-menu .sub-menu a {
        padding-left: 48px;
    }
    /* Chevron SVG icon (matches desktop menu style) */
    .mm-list .menu-item-has-children > a::after {
        content: '';
        display: inline-block;
        width: 14px;
        height: 14px;
        float: right;
        margin-top: 4px;
        background-color: currentColor;
        -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center/contain no-repeat;
                mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") center/contain no-repeat;
        opacity: .6;
        transition: transform .25s, opacity .2s;
    }
    .mm-list .menu-item-has-children.is-open > a::after {
        transform: rotate(180deg);
        opacity: 1;
    }

    /* ── Extra widget area (mobile-menu-extra) ── */
    .mm-panel__extra {
        padding: 16px;
        border-top: 1px solid #e5e7eb;
        background: #f9fafb;
        font-family: "Inter", "Roboto", sans-serif;
        font-size: 13px;
        line-height: 1.6;
        color: #374151;
    }
    .mm-panel__extra .mobile-footer-info {
        text-align: center;
    }
    .mm-panel__extra .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 14px;
        margin: 0 0 14px;
    }
    .mm-panel__extra .footer-links a {
        font-size: 13px;
        font-weight: 600;
        color: #1f2937;
        text-decoration: none;
        padding: 0;
    }
    .mm-panel__extra .footer-links a:hover {
        color: #d90429;
        background: transparent;
    }
    .mm-panel__extra .site-description,
    .mm-panel__extra .disclaimer,
    .mm-panel__extra .copyright {
        margin: 0 0 10px;
        font-size: 12px;
        color: #6b7280;
        line-height: 1.5;
    }
    .mm-panel__extra .site-description strong,
    .mm-panel__extra .disclaimer strong {
        color: #1f2937;
    }
    .mm-panel__extra .disclaimer u {
        text-decoration: underline;
    }
    .mm-panel__extra .copyright a {
        color: #1f2937;
        font-weight: 600;
        text-decoration: none;
    }

    /* Backdrop */
    .mm-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1009;
        background: rgba(0,0,0,.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    body.mm-open .mm-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.mm-open {
        overflow: hidden;
    }
}
