/* ---------------------------------------------------------------------- 
    Mega Menu – scope to desktop
---------------------------------------------------------------------- */
@media (min-width: 1301px) {
    /* Keep li relative so the divider :after stays put */
    header .top-bar .menu > li.mega-menu {
        position: relative;
        font-family: var(--ff-primary-100);
    }

    /* Hide the legacy submenu for mega items only */
    #et-boc header .top-bar .et_pb_widget_area .menu > li.mega-menu > ul.sub-menu {
            display: none !important;
            visibility: hidden !important;
        }

    /* Viewport-anchored full-bleed panel */
    .mega-dropdown {
        position: fixed;
        left: 0;
        right: 0;
        top: 0; /* set dynamically by JS */
        z-index: 9999;
        opacity: 0;
        pointer-events: none;
        transform: translateY(20px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .mega-dropdown.is-open {
            opacity: 1;
            pointer-events: auto;
        transform: translateY(0);
        }

    /* Inner constrained container + grid */
    .mega-dropdown > .mega-inner {
            max-width: calc(var(--max-width) + var(--max-width-padding) * 2);
        padding-left: var(--max-width-padding);
        padding-right: var(--max-width-padding);
        padding-top: 2rem;
        padding-bottom: 3rem;
            margin: 0 auto;

            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 24px;

            background: #fff;
        box-shadow: 0 6px 4px 1px rgba(0, 0, 0, 0.1);
            border-bottom: 8px solid var(--clr-primary-100);
    }

    /* Typography & list styles (unchanged) */
    .mega-group {
                min-width: 0;
    }
    /* Menu Level 2 */
    .mega-l2 {
                    margin: 0;
                    line-height: var(--lh-300);
                    padding-bottom: 0.5rem;
    }
    .mega-l2__link {
        font-size: var(--fs-300);
                        font-weight: var(--fw-medium);
                        color: var(--clr-neutral-100) !important;
                        text-decoration: none;
    }
    .mega-l2__link:hover {
                            opacity: 1;
                            color: var(--clr-primary-100) !important;
                        }
    .mega-dropdown .mega-l2__link.current-menu-item {
                            color: var(--clr-primary-100) !important;
                            opacity: 1;
                        }

    /* Menu Level 3 */
    .mega-l3 {
                    list-style: none;
        margin: 0;
                    padding: 0;
    }
    .mega-l3__item {
        padding: 0;
                        margin-bottom: 0.25rem;
                        line-height: var(--lh-400);
    }
    .mega-l3__item:first-child {
                            border-top: none;
                        }
    .mega-l3__item a {
                            position: relative;
        font-size: var(--fs-300);
                            color: var(--clr-neutral-100) !important;
                            text-decoration: none;
                            opacity: 1;
    }
    /* .mega-l3__item a:before {
                                content: "\2014";
                                position: absolute;
                                left: 1px;
                                top: 9px;
                                transform: translateX(-25px) translateY(-50%);
                                color: inherit;
                                font-weight: inherit;
                                line-height: 1rem;
                                padding-right: 2px;
    } */
    .mega-l3__item a:hover {
                                opacity: 1;
                                color: var(--clr-primary-100) !important;
                            }

    /* Visible focus for keyboard users */
    .mega-dropdown a:focus,
    header .top-bar .menu > li.mega-menu > a:focus {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }

    /* highlight active items inside the mega panel */
    /* .mega-dropdown .mega-group.current-menu-ancestor .mega-l2__link, */
    /* .mega-dropdown .mega-group.current_page_ancestor .mega-l2__link, */
    /* .mega-dropdown .mega-group.current_page_parent .mega-l2__link, */
    /* .mega-dropdown .mega-group .mega-l2__link[aria-current="page"] {
        color: var(--clr-primary-100) !important;
    } */

    .mega-dropdown .mega-l3__item.current-menu-item > a,
    .mega-dropdown .mega-l3__item .mega-l3__item > a[aria-current="page"],
    .mega-dropdown .mega-l3__item > a[aria-current="page"] {
                            color: var(--clr-primary-100) !important;
                            opacity: 1;
                        }

    /* Respect reduced motion */
    @media (prefers-reduced-motion: reduce) {
        .mega-dropdown {
            transition: none !important;
            transform: none !important;
        }
    }

    /* Screen-reader-only utility */
    .sr-only {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 1px, 1px) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}
