/* menu.css – стили для кнопки-бургера и выдвижной шторки */

/* Кнопка меню */
.menu-toggle {
    position: fixed;
    right: 28px;
    top: 28px;
    z-index: 210;
    background: rgba(255, 255, 250, 0.7);
    backdrop-filter: blur(12px);
    border: 0.5px solid rgba(44, 82, 130, 0.3);
    border-radius: 60px;
    width: 56px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.menu-toggle:hover {
    background: rgba(255, 255, 250, 0.9);
    transform: scale(1.02);
}
.menu-line {
    width: 26px;
    height: 3px;
    border-radius: 3px;
    background-size: 100% 100%; /* фикс для градиентов */
    flex-shrink: 0;
}
.line1 { background: linear-gradient(90deg, #364d5b 0%, #041620 25%, #6ca0b6 50%, #b3e3f0 75%, #b3e3f0 100%); }
.line2 { background: linear-gradient(90deg, #3d65aa 0%, #081e35 25%, #456cb1 50%, #4b97d3 75%, #4b97d3 100%); }
.line3 { background: linear-gradient(90deg, #2b3a59 0%, #011329 25%, #42598d 50%, #5765ae 75%, #5765ae 100%); }

/* Оверлей */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Шторка */
.menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 90%);
    height: 100%;
    background: rgba(255,255,250,0.96);
    backdrop-filter: blur(20px);
    box-shadow: -8px 0 30px rgba(0,0,0,0.2);
    z-index: 210;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    display: flex;
    flex-direction: column;
    padding: 1.8rem 1.2rem;
    font-family: 'Inter', sans-serif;
    border-radius: 32px 0 0 32px;
}
.menu-drawer.open {
    transform: translateX(0);
}

/* Заголовок меню (кнопка закрытия) */
.menu-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}
.menu-close {
    background: rgba(44,82,130,0.1);
    border: none;
    font-size: 28px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e3a5f;
    transition: 0.2s;
}
.menu-close:hover {
    background: rgba(44,82,130,0.2);
    transform: rotate(90deg);
}

/* Навигация */
.menu-nav ul {
    list-style: none;
    padding: 0;
}
.menu-nav li {
    margin: 1.2rem 0;
}
.menu-nav a {
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 500;
    color: #1e2a3a;
    transition: 0.2s;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(44,82,130,0.1);
}
.menu-nav a:hover {
    color: #2c5282;
    transform: translateX(6px);
}

/* Пункт с подменю */
.has-submenu {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin: 1.2rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(44,82,130,0.1);
}
.has-submenu span:first-child {
    font-size: 1.3rem;
    font-weight: 500;
    color: #1e2a3a;
}
.has-submenu .submenu-arrow {
    font-size: 1.3rem;
    transition: transform 0.2s;
    color: #2c5282;
}

/* Подменю – широкая версия без горизонтального скролла */
.submenu {
    list-style: none;
    margin-top: 0.8rem;
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.4s ease;
    background: rgba(44,82,130,0.05);
    border-radius: 24px;
    width: 100%;
}
.submenu.open {
    max-height: 55vh;
    padding: 0.8rem 0.8rem 0.8rem 1rem;
}
.submenu li {
    margin: 0.5rem 0;
}
.submenu a {
    font-size: 1rem;
    font-weight: 400;
    padding: 0.4rem 0;
    border-bottom: none;
    white-space: normal;
    word-break: break-word;
}
.submenu a:hover {
    transform: translateX(4px);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .menu-toggle {
        right: 18px;
        top: 18px;
        width: 48px;
        height: 48px;
        gap: 6px;
    }
    .menu-line {
        width: 22px;
        height: 3px !important;          /* принудительная одинаковая высота */
        background-size: 100% 100% !important; /* фикс для градиентов */
        flex-shrink: 0;
    }


    .menu-nav a,
    .has-submenu span:first-child {
        font-size: 1.1rem;
    }
    .submenu a {
        font-size: 0.9rem;
    }
    .menu-drawer {
        width: min(380px, 90%);
        padding: 1.2rem;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .submenu a {
        font-size: 0.85rem;
    }
}