/* Menu Z-Index Fix - Quintessential Wellness */

/* Critical Z-Index hierarchy for mobile menu */
@media only screen and (max-width: 991px) {
    
    /* Mobile header - highest priority */
    .wsmobileheader {
        z-index: 99999 !important;
        position: fixed !important;
    }
    
    /* Mobile menu toggle button */
    #wsnavtoggle,
    .wsanimated-arrow {
        z-index: 100000 !important;
        position: relative !important;
    }
    
    /* Mobile menu overlay */
    .wsmenu {
        z-index: 99998 !important;
        position: fixed !important;
    }
    
    /* Mobile menu list */
    .wsmenu > .wsmenu-list {
        z-index: 99997 !important;
        position: relative !important;
    }
    
    /* Overlay background */
    .overlapblackbg {
        z-index: 99996 !important;
        position: fixed !important;
    }
    
    /* Ensure dropdown menus appear above everything */
    .wsmenu > .wsmenu-list > li > ul.sub-menu,
    .wsmenu > .wsmenu-list > li > .wsmegamenu {
        z-index: 99995 !important;
        position: relative !important;
    }
    
    /* Fix for active menu state */
    .wsactive .wsmenu {
        z-index: 99998 !important;
    }
    
    .wsactive .wsmenu > .wsmenu-list {
        z-index: 99997 !important;
    }
    
    .wsactive .overlapblackbg {
        z-index: 99996 !important;
    }
}

/* Desktop menu z-index fixes */
@media only screen and (min-width: 992px) {
    
    /* Desktop header */
    .header,
    .wsmainfull {
        z-index: 9999 !important;
    }
    
    /* Desktop dropdown menus */
    .wsmenu > .wsmenu-list > li > ul.sub-menu,
    .wsmenu > .wsmenu-list > li > .wsmegamenu {
        z-index: 10000 !important;
    }
    
    /* Desktop nested dropdowns */
    .wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu {
        z-index: 10001 !important;
    }
    
    .wsmenu > .wsmenu-list > li > ul.sub-menu > li > ul.sub-menu > li > ul.sub-menu {
        z-index: 10002 !important;
    }
}

/* Global z-index overrides for common interfering elements */
body * {
    position: relative;
}

/* Ensure carousel and other content doesn't interfere */
.carousel,
.owl-carousel,
.flexslider,
.hero-section,
section,
.container,
.row,
.col-md-12,
.col-lg-12 {
    z-index: auto !important;
}

/* Fix for specific sections that might interfere */
#hero-10,
#about-4,
#pricing-2,
#services-13,
#team-1,
#reviews-1,
#contacts-1,
#footer-1 {
    z-index: 1 !important;
    position: relative !important;
}

/* Fix for form elements */
.hero-form,
#hero-form {
    z-index: 10 !important;
    position: relative !important;
}

/* Bootstrap modal compatibility */
.modal {
    z-index: 99990 !important;
}

.modal-backdrop {
    z-index: 99989 !important;
}

/* Ensure other fixed elements don't interfere */
.fixed-top,
.sticky-top {
    z-index: 9998 !important;
}

/* Additional safety for any absolutely positioned elements */
.position-absolute,
.position-fixed {
    z-index: auto !important;
}

/* Exception for menu-related elements */
.wsmobileheader,
.wsanimated-arrow,
.wsmenu,
.wsmenu-list,
.overlapblackbg {
    z-index: inherit !important;
}
