/* Стили для выпадающего подменю */

/* Для десктопа */
@media (min-width: 992px) {
    .header__menu-item_parent {
        position: relative;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    /* Стили для текста пункта меню и индикатора */
    .header__menu-item_parent > span,
    .header__menu-item_parent .menu-item-text {
        display: block;
        position: relative;
        width: 100%;
        box-sizing: border-box;
        padding: 8px 24px;
    }
    
    /* Индикатор для выпадающего меню */
    .header__menu-item_parent > span:after,
    .header__menu-item_parent .menu-item-text:after {
        content: "▾";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #e0af04;
        transition: transform 0.3s ease;
        font-size: 16px;
        font-weight: bold;
    }
    
    /* Поворот индикатора при активном состоянии */
    .header__menu-item_parent.active > span:after,
    .header__menu-item_parent > span.active:after,
    .header__menu-item_parent.active .menu-item-text:after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    .header__submenu {
        display: none;
        width: 100% !important;
        background-color: #ffffff !important;
        padding: 5px 0 !important;
        border-radius: 0 !important;
        margin-top: 0 !important;
        position: relative !important;
        box-shadow: none !important;
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .header__submenu.visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Все пункты меню на одном уровне */
    .header__menu > li {
        margin: 0;
        padding: 0;
        position: relative;
        width: 100%;
    }
    
    /* Документация на том же уровне что и другие пункты */
    .header__menu > li > a {
        display: block;
        padding: 12px 14px;
        box-sizing: border-box;
        width: 100%;
    }
}

/* Для небольших высот экрана */
@media (max-height: 700px) and (min-width: 992px) {
    .header__submenu {
        max-height: 60vh !important;
    }
}

/* Для очень маленьких высот экрана */
@media (max-height: 500px) and (min-width: 992px) {
    .header__submenu {
        max-height: 85vh !important;
        top: auto !important;
        bottom: 0 !important;
    }
}

/* Для мобильной версии */
@media (max-width: 992px) {
    .header__menu-item_parent {
        position: relative;
        padding: 0;
        margin: 0;
        width: 100%;
    }
    
    .header__menu-item_parent > span {
        display: block;
        position: relative;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 30px 12px 14px;
    }
    
    /* Добавляем индикатор для мобильной версии */
    .header__menu-item_parent > span:after {
        content: "▾";
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #e0af04;
        transition: transform 0.3s ease;
        font-size: 16px;
        font-weight: bold;
    }
    
    /* Индикатор поворачивается когда подменю открыто */
    .header__menu-item_parent > span.active:after {
        transform: translateY(-50%) rotate(180deg);
    }
    
    .header__submenu {
        display: none;
        width: 100% !important;
        background-color: #ffffff !important;
        padding: 5px 0 !important;
        border-radius: 0 !important;
        margin-top: 0 !important;
        position: relative !important;
        box-shadow: none !important;
        /* Анимация для мобильной версии */
        opacity: 0;
        transform: translateY(-10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    /* Анимация при открытии подменю на мобильных */
    .header__submenu.visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    .header__menu {
        max-height: 80vh;
        overflow-y: auto;
    }
    .header__submenu {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Секция в выпадающем меню */
.submenu-section {
    margin-bottom: 15px;
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.3);
    position: relative;
}

.submenu-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Заголовок секции в выпадающем меню */
.submenu-section-title {
    font-weight: 700;
    font-size: 15px;
    padding: 10px 20px;
    color: #e0af04;
    position: relative;
    cursor: default;
    margin-bottom: 8px;
    font-family: 'Inter', Arial, sans-serif;
}

/* Элемент подменю */
.header__submenu-item {
    display: block;
    padding: 8px 20px 8px 30px;
    color: inherit;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    line-height: 1.4;
    white-space: normal;
}

/* Эффект при наведении на элемент подменю */
.header__submenu-item:hover {
    color: #e0af04;
    background-color: rgba(128, 128, 128, 0.1);
    padding-left: 35px;
}

/* Добавляем небольшую анимацию при наведении */
.header__submenu-item:before {
    content: "";
    position: absolute;
    left: 20px;
    top: 50%;
    width: 0;
    height: 1px;
    background-color: #e0af04;
    transition: width 0.2s ease;
    transform: translateY(-50%);
    -webkit-transition: width 0.2s ease;
    -moz-transition: width 0.2s ease;
}

.header__submenu-item:hover:before {
    width: 6px;
}

/* Стиль для активного пункта */
.header__menu-item_parent > span {
    cursor: pointer;
}

/* Для светлого фона хедера */
.header:not(.header_dark) .header__submenu {
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    -webkit-box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    -moz-box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.header_dark .header__submenu {
    background-color: #ffffff;
}

.header:not(.header_dark) .submenu-section-title,
.header_dark .submenu-section-title {
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 8px;
}

.header:not(.header_dark) .header__submenu-item {
    color: #555;
}

.header_dark .header__submenu-item {
    color: #333;
}

.header:not(.header_dark) .header__submenu-item:hover {
    color: #e0af04;
    background-color: #eee;
}

.header:not(.header_dark) .submenu-section {
    border-bottom: 1px solid #e0e0e0;
}

/* Стили для мобильной версии */
@media (max-width: 992px) {
    .header__submenu-item {
        padding: 8px 15px 8px 35px !important;
        white-space: normal !important;
    }
    
    .header__submenu-item:hover {
        padding-left: 40px !important;
    }
    
    .header__submenu-item:before {
        left: 20px !important;
    }
    
    .submenu-section-title {
        padding: 10px 15px 10px 20px !important;
        font-size: 16px !important;
    }
}

/* Для мобильных устройств с маленьким экраном */
@media (max-width: 576px) {
    .submenu-section-title {
        font-size: 14px !important;
        padding: 10px 15px 10px 15px !important;
    }
    
    .header__submenu-item {
        font-size: 13px !important;
        padding: 8px 15px 8px 25px !important;
        white-space: normal !important;
        line-height: 1.3 !important;
    }
    
    .header__submenu-item:hover {
        padding-left: 30px !important;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 350px) {
    .submenu-section-title {
        font-size: 13px !important;
    }
    
    .header__submenu-item {
        font-size: 12px !important;
        padding: 6px 10px 6px 20px !important;
    }
    
    .header__submenu-item:hover {
        padding-left: 25px !important;
    }
}

/* Стили для полос прокрутки в Firefox */
.header__menu, .header__submenu {
    scrollbar-width: thin;
    scrollbar-color: #e0af04 #f0f0f0;
}

/* Стили для полос прокрутки в Webkit (Chrome/Safari/Edge) */
.header__menu::-webkit-scrollbar,
.header__submenu::-webkit-scrollbar {
    width: 8px;
}

.header__menu::-webkit-scrollbar-track,
.header__submenu::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.header__menu::-webkit-scrollbar-thumb,
.header__submenu::-webkit-scrollbar-thumb {
    background-color: #e0af04;
    border-radius: 4px;
    border: 2px solid #f0f0f0;
}

.header__menu::-webkit-scrollbar-thumb:hover,
.header__submenu::-webkit-scrollbar-thumb:hover {
    background-color: #c99e04;
} 