/* Многоуровневое меню */
.multi-level-menu {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Бургер-меню с надписью КАТЕГОРИИ */
.menu-toggle {
    display: none;
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 50px;
    cursor: pointer;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    box-sizing: border-box;
}

.menu-toggle-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    letter-spacing: 1px;
}

.menu-toggle-icon {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.menu-toggle-icon span {
    display: block;
    height: 3px;
    width: 25px;
    background: #333;
    border-radius: 3px;
    margin: 3px 0;
    transition: all 0.3s ease;
}

/* Анимация иконки при открытом меню */
.menu-toggle.open .menu-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.open .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open .menu-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Стили для меню */
.multi-level-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.multi-level-menu li {
    position: relative;
    border-bottom: 1px solid #eee;
}

.multi-level-menu a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.multi-level-menu a:hover {
    background-color: #f8f9fa;
}

.multi-level-menu a.active {
    background-color: #e3f2fd;
    color: #1565c0;
    font-weight: 500;
    border-left: 4px solid #1565c0;
}

/* Иконки стрелок */
.menu-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
}

.arrow-right {
    right: 20px;
    left: auto;
}

.arrow-right::after {
    content: '▼';
    font-size: 12px;
    color: #666;
}

.arrow-up {
    left: auto;
    right: 20px;
    display: none;
}

.arrow-up::after {
    content: '▲';
    font-size: 12px;
    color: #666;
}

/* Первый уровень меню */
.multi-level-menu > ul > li > a {
    padding-left: 50px;
}

.multi-level-menu > ul > li.has-children > a .arrow-right {
    display: flex;
}

.multi-level-menu > ul > li.has-children.open > a .arrow-right {
    display: none;
}

.multi-level-menu > ul > li.has-children.open > a .arrow-up {
    display: flex;
}

/* Второй уровень меню */
.multi-level-menu ul ul li a {
    padding-left: 70px;
}

.multi-level-menu ul ul .arrow-up {
  /* left: 40px; */
}

.multi-level-menu ul ul li.has-children > a .arrow-right {
    display: flex;
}

.multi-level-menu ul ul li.has-children.open > a .arrow-right {
    display: none;
}

.multi-level-menu ul ul li.has-children.open > a .arrow-up {
    display: flex;
}

/* Третий уровень меню */
.multi-level-menu ul ul ul li a {
    padding-left: 90px;
}

.multi-level-menu ul ul ul .arrow-up {
    left: 60px;
}

.multi-level-menu ul ul ul li.has-children > a .arrow-right {
    display: flex;
}

.multi-level-menu ul ul ul li.has-children.open > a .arrow-right {
    display: none;
}

.multi-level-menu ul ul ul li.has-children.open > a .arrow-up {
    display: flex;
}

/* Вложенные меню */
.multi-level-menu ul ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #fafafa;
}

.has-children.open > ul {
    max-height: 1000px;
}

/* Индикатор текущего уровня */
.multi-level-menu .current > a {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* Изображения в меню */
.multi-level-menu .menu-image {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.multi-level-menu .menu-image img {
    max-width: 100%;
    max-height: 100%;
}

.multi-level-menu ul ul .menu-image {
    left: 40px;
}

.multi-level-menu ul ul ul .menu-image {
    left: 60px;
}

/* Мобильные стили */
@media screen and (max-width: 768px) {
    .menu-toggle {
        display: flex !important;
    }
    
    .multi-level-menu {
        display: none;
        width: 100%;
        max-width: 300px;
        position: absolute;
        z-index: 1000;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .multi-level-menu.open {
        display: block;
    }
    
    .menu-icon {
        width: 40px;
        height: 40px;
    }
    
    .arrow-right::after,
    .arrow-up::after {
        font-size: 16px;
    }
    
    .multi-level-menu a {
        padding: 18px 20px;
    }
}

/* Десктоп стили */
@media screen and (min-width: 769px) {
    .menu-toggle {
        display: none !important;
    }
    
    .multi-level-menu {
        display: block;
    }
}