/* Основные стили */
.categories-site-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 1000;
    font-family: Arial, sans-serif;
}

.categories-site-menu > li {
    position: relative;
    margin-right: 20px;
}

.categories-site-menu > li:last-child {
    margin-right: 0;
}

.categories-site-menu > li > a {
    display: flex;
    align-items: center;
    padding: 12px 35px 12px 15px;
    text-decoration: none;
    color: white;
    position: relative;
    font-family: Arial, sans-serif;
    font-size: 17px;
}

/* Убираем маркеры */
.categories-site-menu,
.categories-site-menu ul {
    list-style: none !important;
    padding-left: 0 !important;
}

/* Стрелка для десктопной версии */
.menu-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid white;
    transition: transform 0.3s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.categories-site-menu > li:hover > a > .menu-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Выпадающее меню 1 уровня */
.sub-menu.level-1 {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    z-index: 1001;
    margin: 0;
    padding: 15px 20px;
    font-family: Arial, sans-serif;
}

.sub-menu.level-1 a {
    color: #CC3366 !important;
}

.categories-site-menu > li:hover > .sub-menu.level-1 {
    display: block;
}

/* Пункты 2 уровня */
.sub-menu.level-1 > li {
    width: 100%;
    padding-right: 0;
    margin-bottom: 15px;
    position: relative;
}

.sub-menu.level-1 > li:last-child {
    margin-bottom: 0;
}

.sub-menu.level-1 > li > a {
    font-weight: bold;
    padding: 0px 20px 5px 15px;
    display: block;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
    position: relative;
    font-family: Arial, sans-serif;
    text-decoration: none;
    font-size: 17px;
}

/* Стрелка для пунктов 2 уровня */
.sub-menu.level-1 > li > a > .menu-arrow {
    border-top-color: #CC3366;
}

/* Поворот стрелки при наведении на пункты 2 уровня */
.sub-menu.level-1 > li:hover > a > .menu-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Выпадающее меню 2 уровня (3 и 4 уровни) */
.sub-menu.level-2 {
    display: none;
    position: absolute;
    top: 0;
    left: 300px;
    background: #f9f9f9;
    padding: 7px 10px 10px 10px!important;
    z-index: 1002;
    font-family: Arial, sans-serif;
    margin-top: 0 !important;
    min-height: 365px;
}

/* Выравниваем по пункту 2 уровня */
.sub-menu.level-1 > li:hover > .sub-menu.level-2 {
    display: flex;
    flex-wrap: wrap;
    top: -15px;
}

/* Промежуточная зона между меню */
.sub-menu.level-1 > li:hover::after {
    content: "";
    position: absolute;
    top: 0;
    right: -20px;
    width: 40px;
    height: 100%;
}

/* Стили для разного количества колонок */
.sub-menu.level-2.columns-1 {
    width: 450px;
}
.sub-menu.level-2.columns-1 > li {
    width: 100%;
}

.sub-menu.level-2.columns-2 {
    width: 530px;
}
.sub-menu.level-2.columns-2 > li {
    width: 50%;
}

.sub-menu.level-2.columns-3 {
    width: 750px;
}
.sub-menu.level-2.columns-3 > li {
    width: 33.333%;
}

.sub-menu.level-2.columns-4 {
    width: 850px;
}
.sub-menu.level-2.columns-4 > li {
    width: 25%;
}

/* Общие стили для пунктов 3 уровня */
.sub-menu.level-2 > li {
    box-sizing: border-box;
    padding-right: 20px;
    margin-bottom: 20px;
}

.sub-menu.level-2 > li > a {
    font-weight: bold !important;
    padding: 8px 0 !important;
    display: block !important;
    color: #333 !important;
    font-family: Arial, sans-serif;
    text-decoration: none;
    font-size: 17px;
}

/* Пункты 4 уровня */
.sub-menu.level-3 {
    display: block !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
    font-family: Arial, sans-serif;
}

.sub-menu.level-3 li {
    margin-bottom: 8px;
}

.sub-menu.level-3 a {
    font-weight: normal !important;
    padding: 0 !important;
    display: block !important;
    color: #666 !important;
    transition: color 0.2s ease;
    font-family: Arial, sans-serif;
    text-decoration: none;
    font-size: 17px;
}

.sub-menu.level-3 a:hover {
    color: #000 !important;
}

/* Мобильное меню - общие стили */
@media (max-width: 1030px) {
    .categories-site-menu > li > a {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: block;
        cursor: pointer;
        padding: 5px;
        position: relative;
        z-index: 1001;
        float: right;
    }
    
    .burger-icon {
        width: 23px;
        height: 23px;
        border: 2px solid #FFFFFF;
        border-radius: 4px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 5px;
    }
    
    .burger-icon span {
        display: block;
        width: 20px;
        height: 2px;
        background: #FFFFFF;
        margin: 2px 0;
        transition: all 0.3s ease;
    }
    
    .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: all 0.3s ease;
    }
    
    .mobile-menu-container {
        position: fixed;
        top: 0;
        left: -100%;
        width: 95%;
        max-width: 350px;
        height: 100vh;
        background: #fff;
        z-index: 99999;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        font-family: Arial, sans-serif;
    }
    
    .mobile-menu-header {
        padding: 7px 0;
        position: relative;
    }
    
    .mobile-menu-close {
        position: absolute;
        top: 2px;
        right: 2px;
        font-size: 35px;
        color: #CC3366;
        cursor: pointer;
        z-index: 1002;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        font-family: Arial, sans-serif;
    }
    
    .mobile-menu {
        list-style: none;
        padding: 15px 19px 15px 15px;
        margin: 0;
        font-family: Arial, sans-serif;
    }
    
    .mobile-menu li {
        position: relative;
        margin-bottom: 2px;
    }
    
    .mobile-menu li a {
        display: block;
        padding: 8px 4px;
        color: #333 !important;
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid #eee;
        font-size: 14px;
        font-family: Arial, sans-serif;
    }
    
    .mobile-menu li.has-children > a {
        padding-right: 60px;
    }
    
    .toggle-submenu {
        position: absolute;
        right: 10px;
        top: 0px;
        width: 9px;
        height: 9px;
        border: 1px solid #ddd;
        border-radius: 50%;
        background: #f5f5f5;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        font-family: Arial, sans-serif;
        z-index: 999999;
        padding: 10px;
    }
    
    .toggle-submenu:before {
        content: '+';
        font-size: 14px;
        color: #333;
        font-weight: bold;
        font-family: Arial, sans-serif;
        z-index: 999999;
    }
    
    .toggle-submenu.active:before {
        content: '-';
        z-index: 999999;
    }
    
    .submenu-container {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        padding-left: 10px;
    }
    
    .submenu-container.active {
        max-height: 2000px;
    }
    
    /* Анимация бургера при открытии */
    .mobile-menu-active .burger-icon span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }
    
    .mobile-menu-active .burger-icon span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-active .burger-icon span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
    
    /* Показываем оверлей и меню при активации */
    .mobile-menu-active .mobile-menu-overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-active .mobile-menu-container {
        left: 0;
        z-index: 9999999;
    }
}

/* Десктопные стили */
@media (min-width: 1031px) {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-container {
        display: none !important;
    }
}

/* === POLKOFF v5 (2025-09-19) — categories_site_menu === */
/* Колонка для depth-2 без дочерних depth-3: компактные отступы и сохранение вида заголовков */
.sub-menu.level-2 > li.csm-simple-column{ padding-right:20px; box-sizing:border-box; }
.sub-menu.level-2 > li.csm-simple-column > ul.csm-simple-list{
    list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px;
}
.sub-menu.level-2 > li.csm-simple-column > ul.csm-simple-list > li{ margin:0 !important; padding:0 !important; line-height:1.2; }
.sub-menu.level-2 > li.csm-simple-column > ul.csm-simple-list > li > a{
    font-weight:bold !important; color:#333 !important; text-decoration:none; display:block !important;
    padding:2px 0 !important; font-size:17px; font-family:Arial, sans-serif;
}
.sub-menu.level-2 > li.csm-simple-column > ul.csm-simple-list > li > a:hover{ color:#000 !important; }
/* === END POLKOFF v5 === */
