/* CSS removed to allow AlpineJS to handle menu toggle via click */

/* Force mega menu layout to override inline styles */
.mega-menu-overlay {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    z-index: 50 !important;
}

@media (min-width: 1024px) {
    .mega-menu-overlay {
        top: var(--header-height, 159px) !important;
        height: calc(100vh - var(--header-height, 159px)) !important;
        /* Desktop Menu: Above Backdrop (29), Below Header (50) */
        z-index: 40 !important;
    }

    /* Desktop L1: Curtain Animation */
    .mega-menu-overlay.menu-closed {
        clip-path: inset(0 0 100% 0);
    }

    .mega-menu-overlay.menu-open {
        clip-path: inset(0 0 0 0);
    }

    .mega-menu-overlay.menu-transition {
        transition-property: clip-path, top;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Desktop L2+: Fade Animation (prevent clip-path issues) */
    .submenu:not(.mega-menu-overlay).menu-closed {
        opacity: 0;
        pointer-events: none;
    }

    .submenu:not(.mega-menu-overlay).menu-open {
        opacity: 1;
        pointer-events: auto;
    }

    .submenu:not(.mega-menu-overlay).menu-transition {
        transition-property: opacity;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

@media (max-width: 1023px) {
    .mega-menu-overlay {
        top: 0 !important;
        height: 100vh !important;
        z-index: 99999 !important;
    }

    .submenu {
        z-index: 99999 !important;
    }

    /* Hide other header icons and brand elements on mobile when submenu is open */
    body.menu-overlay-active #main-header > div:first-child {
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 0.2s ease-in-out;
    }

    /* Mobile: Slide Animation for ALL levels */
    .menu-closed {
        transform: translateX(100%);
    }

    .menu-open {
        transform: translateX(0);
    }

    .menu-transition {
        transition-property: transform;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Global Backdrop (Shadow + Blur on DOM) */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    /* Dark Shadow */
    backdrop-filter: blur(5px);
    /* Blur Effect */
    -webkit-backdrop-filter: blur(5px);
    /* Safari Support */
    z-index: 29;
    /* Content < Backdrop (29) < Menu (40) < Header (50) */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

body.menu-overlay-active::after {
    opacity: 1;
    pointer-events: auto;
    /* Blocks interaction with underlying page */
}
