/* ========================================
   MOBILE MENU STYLES
   ======================================== */
.mobile-menu-wrapper {
    position: relative;
    z-index: 1000;
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 45px;
    height: 45px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    background: #fff;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active .mobile-menu-container {
    transform: translateX(0);
}

.mobile-menu-level {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: 60px;
}

.mobile-menu-level.active {
    transform: translateX(0);
}

.mobile-menu-level.next {
    transform: translateX(100%);
}

.mobile-menu-level.prev {
    transform: translateX(-100%);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid #f0f0f0;
}

/* Контейнер для разделения ссылки и стрелки (только мобильное) */
.mobile-menu-item-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: background-color 0.2s;
    width: 100%;
    text-align: left;
    flex: 1;
}

.mobile-menu-link:hover {
    background-color: #f5f5f5;
}

/* Стрелка-кнопка (только мобильное) */
.submenu-toggle {
    width: 40px;
    height: 100%;
    background: none;
    border: none;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.submenu-toggle:hover,
.submenu-toggle:focus {
    color: #000;
    background: rgba(0,0,0,0.05);
}

.submenu-toggle:focus {
    outline: 2px solid #0066cc;
    border-radius: 4px;
}

.mobile-menu-back {
    display: block;
    width: 100%;
    padding: 16px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 16px;
    color: #007bff;
    border: none;
    text-align: left;
    font-family: inherit;
    transition: background-color 0.2s;
}

.mobile-menu-back:hover {
    background-color: #f0f0f0;
}

.mobile-menu-back::before {
    content: '← ';
}

/* Гамбургер меню */
.hamburger {
    display: inline-block;
    width: 24px;
    height: 20px;
    position: relative;
    top: 3px;
}

.hamburger-line {
    display: block;
    height: 3px;
    width: 100%;
    background: #333;
    margin-bottom: 4px;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Адаптивность - показываем кнопку только на мобильных */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* ========================================
   DESKTOP MENU STYLES
   ======================================== */
.desktop-menu-container {
    display: block;
}

.desktop-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.desktop-menu-item {
    position: relative;
    padding: 0 15px;
}

.desktop-menu-link {
    display: block;
    padding: 15px 0;
    text-decoration: none;
    color: #333;
    font-size: 16px;
    transition: color 0.2s;
    position: relative;
}

.desktop-menu-link:hover {
    color: #0066cc;
}

/* Стрелка для пунктов с подменю (только десктоп) */
.desktop-menu-item.has-children > .menu-item-container::after {
    content: '▼';
    display: inline-block;
    margin-left: 8px;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s;
}

.desktop-menu-item.has-children:hover > .menu-item-container::after {
    transform: rotate(180deg);
    color: #0066cc;
}

/* Контейнер для ссылки и стрелки (десктоп) */
.menu-item-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Выпадающее меню (только десктоп) */
.desktop-submenu {
    position: absolute;
    left: 0;
    width: 33vw;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    top: 100%;
    padding: 20px 0;
    display: none;
    border-top: 3px solid #0066cc;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Показываем подменю при ховере */
.desktop-menu-item:hover > .desktop-submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.desktop-submenu .submenu-list {
    display: block;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.nav .desktop-submenu ul{
    display: block;
    margin-top: 0px;
}
.submenu-list li {
    margin: 0 20px;
}

.submenu-list a {
    display: block;
    padding: 5px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s;
    border-radius: 4px;
    white-space: nowrap;
}

.submenu-list a:hover {
    background: #f0f7ff;
    color: #0066cc;
}

/* Скрываем десктопное меню на мобильных */
@media (max-width: 768px) {
    .desktop-menu-container {
        display: none;
    }
}