/* Header Menu Positioning */
@media (min-width: 768px) {
    /* Regular dropdown positioning */
    .menu-item-wrapper:not(.has-mega-menu) {
        position: relative !important;
    }

    .menu-item-wrapper:not(.has-mega-menu) > .group {
        position: relative !important;
    }

    /* Regular dropdown menu */
    .menu-item-wrapper:not(.has-mega-menu) .mega-menu {
        position: absolute !important;
        left: 0 !important;
        top: 100% !important;
        width: auto !important;
        min-width: 280px !important;
        transform: none !important;
        z-index: 50 !important;
    }

    /* Sub-dropdown positioning */
    .menu-item-wrapper:not(.has-mega-menu) .group\/sub .absolute {
        z-index: 60 !important;
    }

    /* Mega menu positioning - only for actual mega menus */
    .menu-item-wrapper.has-mega-menu {
        position: static !important;
    }

    .menu-item-wrapper.has-mega-menu .group {
        position: static !important;
    }

    .menu-item-wrapper.has-mega-menu .mega-menu {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        transform: translateX(calc(-50vw + 50%)) !important;
    }

    /* Ensure hover works properly */
    .group:hover .mega-menu {
        display: block !important;
    }

    /* Prevent horizontal scroll when mega menu is open */
    #desktopMenuContainer {
        overflow: visible !important;
    }
}

/* Prevent body scroll when mega menu appears */
body {
    overflow-x: hidden !important;
}

/* Mega menu scrollable grid */
.mega-menu-grid {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.mega-menu-grid::-webkit-scrollbar {
    width: 4px;
}

.mega-menu-grid::-webkit-scrollbar-track {
    background: transparent;
}

.mega-menu-grid::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 4px;
}

.mega-menu-grid::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}
