body.no-scroll {
    overflow: hidden;
}

html.no-scroll {
    overflow: hidden;
}

main {
    margin-top: 105px;
}

/* Скрываем мобильные элементы на десктопе */
.burger,
.mobile-menu {
    display: none;
}

/* Основные стили меню */
.main-menu {
    position: relative;
    z-index: 1000;
    margin-left: 4rem;
}

.nav {
    background-color: transparent !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.nav.scrolled,
.nav:hover {
    background-color: #fff !important;
}

.nav .container__left .logo {
    width: auto;
}

.main-menu__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-menu__item {
    position: relative;
}

.main-menu__link {
    display: inline-block;
    padding: 0;
    text-decoration: none;
    color: #000;
    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    transition: color 0.5s;
    position: relative;
}

.nav.scrolled .main-menu__link,
.nav:hover .main-menu__link {
    color: #000;
}

.main-menu__link:hover {
    color: #0070AD;
}

.main-menu__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0070AD;
    transition: width 0.5s ease;
}

.main-menu__link:hover::after {
    width: 100%;
}

/* Выпадающее меню */
.main-menu__dropdown {
    position: fixed;
    top: 92px;
    width: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    height: 40vh;
    overflow-y: auto;
    min-width: 100vw;
    margin-left: calc(-50vw + 50%);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.1);
}

.main-menu__item:hover .main-menu__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu__dropdown-content {
    padding: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    font-weight: 400;
    height: 100%;
    background-color: rgb(247, 247, 247);
}

.main-menu__promo-section {
    background-color: #0070ad;
    color: #fff;
    padding: 2rem;
    width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-shrink: 0;
}

.main-menu__promo-section h4 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.main-menu__promo-section p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.main-menu__promo-section .promo-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: 1px solid #fff;
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    margin-top: auto;
}

.main-menu__promo-section .promo-button:hover {
    background-color: #fff;
    color: #0070ad;
}

.main-menu__promo-section .promo-button i {
    margin-left: 0.5rem;
}


.main-menu__links-section {
    padding: 2rem;
    flex-grow: 0;
    width: fit-content;
    overflow-y: auto;
    /* border-right: 1px solid #eee; */
}

.main-menu__sub-links-section {
    background-color: #fff;
}

.main-menu__sub-links-section,
.main-menu__sub-sub-links-section {
    padding: 2rem;
    flex-grow: 0;
    width: fit-content;
    display: none;
    /* Скрываем по умолчанию */
}

.main-menu__sub-links-section.active,
.main-menu__sub-sub-links-section.active {
    display: block;
    /* Показываем активную секцию */
}

.main-menu__submenu-content {
    display: none;
    /* Скрываем все подменю */
    max-height: 100%;
    overflow-y: auto;
}

.main-menu__submenu-content.active {
    display: block;
    /* Показываем активное подменю */
}

/* Равная ширина для трех главных разделов в меню "Услуги и сотрудничество" */
.main-menu__dropdown-content .main-menu__section {
    flex: 0 0 auto;
}

/* Колонки для больших меню */
.main-menu__columns {
    /* display: grid; */
    /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); */
    /* gap: 2rem; */
    /* margin-bottom: 2rem; */
}

.main-menu__column {
    min-width: 0;
}

/* Секции меню */
.main-menu__section {
    margin: 0;
    transition: all 0.3s ease;
}

.main-menu__section:last-child {
    margin-bottom: 0;
}

.main-menu__section-title {
    color: #000;
    font-family: "Ubuntu", sans-serif;
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    padding: 0.5rem 0;
    cursor: default;
}

/* Выпадающие секции - больше не нужны в таком виде */
.main-menu__section-dropdown,
.main-menu__subsection-dropdown {
    display: none;
}


/* Подсекции */
.main-menu__subsection {
    margin-bottom: 0rem;
    margin-top: 0rem;
}

.main-menu__subsection:last-child {
    margin-bottom: 0;
}

.main-menu__subsection-title {
    color: #000;
    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    font-weight: 400;
    margin: 0;
    cursor: default;
    padding: 0.5rem 0;
}

/* Выпадающие подсекции - больше не нужны в таком виде */
.main-menu__subsection-dropdown {
    display: none;
}

/* Стили для ссылок с подменю */
.main-menu__hoverable>a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem 0;
}

.main-menu__hoverable>a .arrow {
    margin-left: 1rem;
    font-size: 0.8em;
    transition: transform 0.3s;
}

/* Новые унифицированные стили для подчеркивания */
.main-menu__submenu li a {
    position: relative;
}

.main-menu__submenu li a::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #0070AD;
    transition: width 0.5s ease;
}

.main-menu__submenu li a:hover::after {
    width: 100%;
}

/* Отключаем подчеркивание у 'a' в hoverable, чтобы оно было только на span */
.main-menu__hoverable>a::after {
    content: none;
}


.main-menu__hoverable.active>a .arrow {
    transform: none;
    /* Убираем вращение */
}

/* Улучшенные стили для скролла подменю */
.main-menu__section-dropdown::-webkit-scrollbar,
.main-menu__subsection-dropdown::-webkit-scrollbar {
    width: 4px;
}

.main-menu__section-dropdown::-webkit-scrollbar-track,
.main-menu__subsection-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.main-menu__section-dropdown::-webkit-scrollbar-thumb,
.main-menu__subsection-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.main-menu__section-dropdown::-webkit-scrollbar-thumb:hover,
.main-menu__subsection-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Списки в меню */
.main-menu__submenu,
.main-menu__subsection ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-menu__submenu li,
.main-menu__subsection ul li {
    margin-bottom: 0;
    position: relative;
}

.main-menu__submenu li:last-child,
.main-menu__subsection ul li:last-child {
    margin-bottom: 0;
}

.main-menu__submenu a,
.main-menu__subsection ul a {
    display: inline-block;
    padding: 0.75rem 0;
    text-decoration: none;
    color: #000;
    font-family: "Ubuntu", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    transition: color 0.5s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    width: auto;
}

.main-menu__submenu a:hover,
.main-menu__subsection ul a:hover {
    color: #0070AD;
}

/* .main-menu__submenu a:hover::after,
.main-menu__subsection ul a:hover::after {
    width: 100%;
} */

/* Удаляем старые правила для выпадающих меню */
.main-menu__section-dropdown,
.main-menu__subsection-dropdown,
.main-menu__hoverable:hover>.main-menu__section-dropdown,
.main-menu__hoverable:hover>.main-menu__subsection-dropdown {
    /* Эти правила больше не нужны, так как мы управляем видимостью через JS */
    display: none;
}

.main-menu__section-dropdown.active,
.main-menu__subsection-dropdown.active {
    /* Эти правила больше не нужны */
    display: none;
}


/* Кастомный скроллбар для выпадающего меню */
.main-menu__dropdown::-webkit-scrollbar {
    width: 4px;
}

.main-menu__dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.main-menu__dropdown::-webkit-scrollbar-thumb {
    background: #0070AD;
    border-radius: 2px;
}

.main-menu__dropdown::-webkit-scrollbar-thumb:hover {
    background: #005a8b;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .main-menu__columns {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .main-menu__dropdown-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-menu {
        display: none;
    }
}

/* ======= Мобильное меню ======= */
@media (max-width: 992px) {
    .mobile-hide { display: none; }

    .burger {
        display: inline-flex;
        position: relative;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        padding: 0;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1101;
    }
    .burger__line {
        position: absolute;
        width: 22px;
        height: 2px;
        background: #120028;
        transition: transform .3s ease, opacity .2s ease;
    }
    .burger__line:nth-child(1) { transform: translateY(-6px); }
    .burger__line:nth-child(2) { transform: translateY(0); }
    .burger__line:nth-child(3) { transform: translateY(6px); }
    .burger__cross {
        position: absolute;
        width: 22px;
        height: 22px;
        pointer-events: none;
    }
    .burger__cross::before,
    .burger__cross::after {
        content: '';
        position: absolute;
        left: 0;
        top: 50%;
        width: 22px;
        height: 2px;
        background: #120028;
        transform: translateY(-50%) rotate(45deg);
        opacity: 0;
        transition: opacity .2s ease, transform .3s ease;
    }
    .burger__cross::after { transform: translateY(-50%) rotate(-45deg); }
    .burger.is-active .burger__line { opacity: 0; }
    .burger.is-active .burger__cross::before,
    .burger.is-active .burger__cross::after { opacity: 1; }

    /* Контейнер мобильного меню */
    .mobile-menu {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1100;
        pointer-events: none;
    }
    .mobile-menu__overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.35);
        opacity: 0;
        transition: opacity .3s ease;
    }
    .mobile-menu__container {
        position: absolute;
        top: 0; bottom: 0; right: 0; left: 0;
        overflow: hidden;
        transform: translateX(100%);
        transition: transform .35s ease;
        background: #fff;
        max-width: 100vw;
    }
    .mobile-menu.is-open { pointer-events: auto; }
    .mobile-menu.is-open .mobile-menu__overlay { opacity: 1; }
    .mobile-menu.is-open .mobile-menu__container { transform: translateX(0); }

    /* Трек и панели */
    .mobile-menu__track {
        display: flex;
        height: 100%;
        width: 100%;
        transition: transform .35s ease;
    }
    .mobile-menu__panel {
        width: 100%;
        min-width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        background: #fff;
    }
    .mobile-menu__panel-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        background: #0070AD;
        color: #fff;
    }
    .mobile-menu__back {
        width: 36px; height: 36px;
        border-radius: 18px;
        /* border: 1px solid rgba(255,255,255,.6); */
        background: transparent;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }
    .mobile-menu__title { font: 600 18px/1.2 "Ubuntu", sans-serif; }

    .mobile-menu__list {
        list-style: none;
        margin: 0;
        padding: 8px 16px 24px 16px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-menu__link {
        width: 100%;
        padding: 14px 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
        background: none;
        color: #120028;
        text-decoration: none;
        font-family: "Ubuntu", sans-serif;
        font-size: 16px;
    }
    .mobile-menu__link--has-children { cursor: pointer; }
    .mobile-menu__templates, .mm-hidden { display: none; }

    /* Кнопка закрытия (X) поверх меню */
    .mobile-menu__close {
        position: absolute;
        top: 16px;
        right: 10px;
        z-index: 1200;
        width: 40px;
        height: 40px;
        border: none;
        /* background: rgba(255,255,255,0.95); */
        border-radius: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /* box-shadow: 0 2px 8px rgba(0,0,0,.1); */
        color: #fff;
    }
    .mobile-menu__close .fa-xmark { font-size: 20px; }
}