#header .menu {
    list-style: none;
    display: flex;
    justify-content: center;
    position: relative;
    gap: 20px;
    margin: 14px 0;
    font-size: 16px;

}

#header .menu > li {
    position: relative;
}

#header .menu > li > a {
    color: white;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

#header .submenu {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    list-style: none;
    min-width: 100%;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s;
    z-index: 100;
    padding-left: 0;
    max-width: 300px;
}


#header .menu > li:hover > .submenu::before {
    content: '';
    left: calc(50% - 10px); top: -20px;
    width: 0; height: 0;
    border-style: solid;
    border-width: 10px;
    border-color: transparent transparent #ffffff transparent ;
    position: absolute;
}

#header .submenu li {
    position: relative;
}

#header .submenu li:last-child {
    border-bottom: none;
}

#header .submenu li a {
    color: #2a3143;
    text-decoration: none;
    padding: 10px 20px;
    display: block;
}

#header .submenu li:hover > a {
    color: #ec6429;
}

#header .submenu-level3 {
    position: fixed;
    left: 100%;
    top: 0;
    bottom: 0;
    height: 100%;
    background: #f4f4ff;
    list-style: none;
    min-width: 100%;
    width: max-content;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    padding-left: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

#header .submenu-level3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    background: inherit;
    z-index: -1;
}

@media (min-width: 981px) {
    #header .menu > li:hover > .submenu {
        opacity: 1;
        visibility: visible;
    }

    #header .submenu li:hover > .submenu-level3 {
        opacity: 1;
        visibility: visible;
        height: auto;
    }
}

#header .submenu-level3 li {
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 44px;
}

#header .submenu-level3 li:last-child {
    border-bottom: none;
}

#header .submenu-level3 li a {
    width: 100%;
}

#header.fixed .menu > li > a {
    color: #2a3143;
}
a.gamburg {
    display: none;
}

@media (max-width: 1440px) {

    #header .menu {
        gap: 10px;
        padding: 0;
    }

}

@media (max-width: 980px) {
    a.gamburg {

    }
    a.gamburg {
        width: 42px;
        height: 26px;
        float: none;
        margin: 0;
        background-size: contain;
        display: block;
        stroke: #ffffff;
    }

    #header.fixed a.gamburg svg {
        stroke: #2a3143;
    }

    a.mobile {
        display: block;
        position: relative;
        z-index: 470;
        background: url("/local/templates/vnii/components/bitrix/menu/top/close.svg") no-repeat;
        background-size: contain;
    }

    #header.fixed .mobile .menu > li > a {
        color: #ffffff;
    }

    a.gamburg.mobile svg {
        display: none;
    }

    #header ul.topmenu {
        display: none;
        position: relative;
        z-index: 460;
        top: 0;
        right: 0;
        width: 100%;
        height: auto;
        margin-top: 0;
        padding: 0;
    }

    #header .header_inner.mobile {
        background: #2a3143;
        position: fixed;
        width: 100%;
        height: 100%;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        top: 0;
        left: 0;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 20px;
    }

    #header .header_inner.mobile ul.topmenu {
        display: block;
    }

    #header .header_inner.mobile .gamburg {
        position: absolute;
        top: 10px;
        right: 0;
    }

    #header .header_inner.mobile #search {
        display: none;
    }

    #header .header_inner.mobile .logo img {
        height: 70px;
        width: auto;
        max-width: unset;
        margin-top: 20px;
    }

    #header .header_inner.mobile .requests {
        display: none;
    }

    #header .header_inner.mobile .social {
        display: flex;
        margin-top: 20px;
    }

    #header .header_inner.mobile .submenu-level3 {
        position: relative;
        left: 0;
    }

    #header ul.topmenu li {
        width: 100%;
        padding: 20px 0 0px 0px;
    }


    #header ul.topmenu li a, #header.fixed ul.topmenu li a {
        height: auto;
        display: block;
        text-align: left;
        line-height: 20px;
        font-size: 16px; 
    }

    #header ul.topmenu li a i {
        display: none;
    }

    #header .submenu,
    #header .submenu-level3 {
        display: none;
        opacity: 1;
        visibility: visible;
        position: relative; /* чтобы раскрывалось под родителем */
        transform: none;
        left: 0;
        top: 0;
    }

    #header .submenu.open,
    #header .submenu-level3.open {
        display: block;
    }

    #header .submenu li {
        padding-left: 15px;
    }
	
	#header .menu > li:hover > .submenu::before {
		display: none;

}
}