/* Mega Menu Styles for NION */
.header-main .main-menu ul li.has-megamenu {
    position: static !important;
}

.header-main .main-menu ul li .nion-mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
    padding: 40px 0;
    z-index: 9999;
    border-top: 4px solid var(--theme3);
    transform: translateY(15px);
    border-radius: 0px 0px 20px 20px;
}

.header-main .main-menu ul li:hover .nion-mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.mega-menu-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.mega-menu-col {
    flex: 0 0 22%;
    padding: 0 15px;
}

.mega-menu-col h4 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--header);
    position: relative;
    padding-bottom: 10px;
    text-transform: uppercase;
}

.mega-menu-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--theme3);
}

.mega-menu-col ul {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.mega-menu-col ul li {
    display: block !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

.mega-menu-col ul li a {
    font-size: 15px !important;
    color: #555 !important;
    padding: 0 !important;
    display: block !important;
    transition: all 0.3s ease;
    text-transform: capitalize !important;
    font-weight: 400 !important;
}

.mega-menu-col ul li a:hover {
    color: var(--theme3) !important;
    padding-left: 8px !important;
}

.mega-menu-featured {
    flex: 0 0 28%;
    background: #f4f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e1eff1;
}

.mega-menu-featured img {
    max-width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #fff;
    padding: 10px;
}

.mega-menu-featured h5 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--header);
}

.mega-menu-featured p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

/* Mobile Responsive Toggle */
.mmenu-toggle {
    cursor: pointer;
    font-size: 24px;
    color: var(--header);
    transition: all 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmenu-toggle:hover {
    color: var(--theme3);
}

/* Fix mmenu container issues */
.mm-wrapper_opened {
    overflow: hidden !important;
}

/* Ensure the header is above the mmenu overlay if needed, 
   but usually mmenu handles this */

/* Desktop Refinements */
.header-main .main-menu ul li.has-megamenu > a {
    position: relative;
}

.header-main .main-menu ul li.has-megamenu:hover > a::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--theme3);
    transition: all 0.3s ease;
}

@media (max-width: 1199px) {
    .header-main .main-menu {
        display: none !important;
    }
    .header-main .main-menu ul li.has-megamenu {
        position: relative !important;
    }
    .header-main .main-menu ul li .nion-mega-menu {
        display: none !important;
    }
}

/* Hide mmenu markup on desktop by moving it off-screen, 
   allowing plugin to read it during initialization. */
#menu {
    position: absolute !important;
    left: -9999px !important;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    display: block !important;
}

/* mmenu Overrides to ensure visibility and premium appearance */
.mm-menu_theme-dark {
    --mm-color-background: #111 !important;
}

.mm-panel {
    background: #111 !important;
}

.mm-listitem a, .mm-listitem span {
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.mm-navbar {
    background: #000 !important;
    border-bottom: 1px solid #333 !important;
}

.mm-navbar__title {
    color: var(--theme3) !important;
    font-weight: 800 !important;
    font-size: 18px !important;
}

.mm-searchfield__input {
    background: #222 !important;
    color: #fff !important;
    border: 1px solid #444 !important;
    border-radius: 30px !important;
    padding: 10px 20px !important;
}

.mm-counter {
    color: var(--theme3) !important;
    font-weight: 700 !important;
}

.mm-btn_prev::before, .mm-btn_next::after {
    border-color: #fff !important;
}
