/**
 * Mega Menu — Mobile Accordion Styles
 */

@media (max-width: 1741px) {

    /* Arrow indicator showing the item expands — matches Astra's default chevron */
    .mm-mobile-trigger > a {
        position: relative;
        display: block;
        padding-right: 40px;
    }

    .mm-mobile-trigger > a::after {
        content: '';
        position: absolute;
        right: 24px;
        top: 50%;
        width: 10px;
        height: 10px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-50%) rotate(45deg);
        transition: transform 0.2s ease;
    }

    .mm-mobile-trigger.mm-mobile-arrow-open > a::after {
        transform: translateY(-50%) rotate(225deg);
    }

    .mm-mobile-trigger.mm-mobile-arrow-open::after {
        transform: translateY(-50%) rotate(225deg);
    }

    /* Cancel the desktop fixed-position floating panel behaviour */
    .icop-mega-menu {
        display: none; /* hidden until opened */
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        box-shadow: none;
        max-height: 70vh;
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .icop-mega-menu.mm-mobile-open {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        z-index: 99999 !important;
        height: auto !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
    }

    .mm-mobile-close {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 100000;
        width: 32px;
        height: 32px;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 0;
    }

    .mm-mobile-close::before,
    .mm-mobile-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
    }

    .mm-mobile-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .mm-mobile-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* Prevent background scroll while the mobile mega menu is open */
    body.mm-mobile-menu-open {
        overflow: hidden;
    }

    /* Stack left section list and right panels instead of side-by-side */
    .icop-mm-left,
    .icop-mm-right {
        width: 100% !important;
        float: none !important;
    }

    .icop-mm-section-item {
        cursor: pointer;
    }

    /* Hide all panels by default on mobile; only show the active one */
    .icop-mm-panel {
        display: none;
    }

    .icop-mm-panel.active,
    .icop-mm-panel.mm-mobile-panel-open {
        display: block;
    }

    /* Stack mega-menu columns vertically on mobile, including the 5-col variants */
    .icop-mm-columns,
    .icop-mm-columns--5 {
        display: block !important;
    }

    .icop-mm-col {
        width: 100% !important;
        margin-bottom: 16px;
    }
}