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

/************************************
 * 1. ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ ТИПОВ МЕНЮ
 ************************************/
.main-nav__list {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav__list > li {
    position: relative;
    margin: 0;
    display: flex;
    align-items: center;
}

/* Стили для пунктов меню с подменю */
.menu-item-has-children {
    position: relative;
}

/* Стрелка-индикатор для пунктов с подменю */
.dropdown-arrow {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-left: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    position: relative;
    top: -2px;
}

/* Поворот стрелки при открытом подменю */
.menu-item-has-children:hover > a .dropdown-arrow,
.menu-item-has-children.hover > a .dropdown-arrow {
    transform: rotate(-135deg);
    top: 0;
}

/************************************
 * 2. СТАНДАРТНОЕ МЕНЮ (непрозрачное)
 ************************************/
/* Стили для верхнего уровня меню */
.main-nav__list > li > a {
    display: flex;
    align-items: center;
    padding: 20px 15px;
    color: #003366;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
}

/* Активный пункт меню */
.main-nav__list > li.current-menu-item > a,
.main-nav__list > li.current-menu-ancestor > a {
    color: #0066cc;
}

/* Эффект при наведении для верхнего уровня - только изменение цвета текста */
.main-nav__list > li > a:hover {
    color: #0066cc;
}

/* Стили для подменю */
.menu-item-has-children .sub-menu {
    position: absolute;
    top: calc(100% + 1px); /* Смещаем подменю на 1px ниже */
    left: 0;
    min-width: 250px;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Отображение подменю при наведении или при добавлении класса hover */
.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children.hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Стили для пунктов подменю */
.menu-item-has-children .sub-menu li {
    display: block;
    margin: 0;
    padding: 0;
}

/* Убираем эффект подчеркивания для всех пунктов подменю */
.menu-item-has-children .sub-menu a:after {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Убираем эффект подчеркивания при наведении */
.menu-item-has-children .sub-menu a:hover:after {
    width: 0 !important;
}

.menu-item-has-children .sub-menu a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    min-height: 40px;
    color: #003366;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
}

/* Убираем нижнюю границу у последнего элемента */
.menu-item-has-children .sub-menu li:last-child > a {
    border-bottom: none;
}

/* Инверсия при наведении на пункт подменю */
.menu-item-has-children .sub-menu a:hover {
    background-color: #0066cc;
    color: #fff;
}

/* Активный пункт в подменю */
.menu-item-has-children .sub-menu .current-menu-item > a {
    background-color: #0066cc;
    color: #fff;
    border-bottom: none !important; /* Убираем толстую синюю линию */
}

/************************************
 * 3. ПРОЗРАЧНОЕ МЕНЮ (на главной)
 ************************************/
/* Стили для прозрачной шапки на главной странице */
.header--transparent .main-nav__list > li > a {
    color: #fff;
}

.header--transparent .main-nav__list > li.current-menu-item > a,
.header--transparent .main-nav__list > li.current-menu-ancestor > a,
.header--transparent .main-nav__list > li > a:hover {
    color: #0066cc;
}

/* Стили для фиксированного меню при скролле */
.header--fixed .main-nav__list > li > a {
    color: #003366;
}

.header--fixed .main-nav__list > li.current-menu-item > a,
.header--fixed .main-nav__list > li.current-menu-ancestor > a,
.header--fixed .main-nav__list > li > a:hover {
    color: #0066cc;
}

.header--transparent .menu-item-has-children .sub-menu {
    border-top: 0px solid #ffffff;
}

.header--transparent .menu-item-has-children .sub-menu a {
    color: #003366;
    background-color: #fff;
}

.header--transparent .menu-item-has-children .sub-menu a:hover {
    background-color: #0066cc;
    color: #fff;
}

.header--transparent .menu-item-has-children .sub-menu .current-menu-item > a {
    background-color: #003366;
    color: #fff;
}

/************************************
 * 4. МНОГОУРОВНЕВЫЕ ПОДМЕНЮ
 ************************************/
/* Стили для многоуровневых подменю */
.menu-item-has-children .sub-menu .menu-item-has-children > .sub-menu {
    top: 0;
    left: 100%;
    border-top: none;
    border-left: 1px solid #003366;
}

/* Стрелка для многоуровневых подменю */
.menu-item-has-children .sub-menu .menu-item-has-children > a .dropdown-arrow {
    transform: rotate(-45deg);
    position: absolute;
    right: 15px;
    top: 50%;
    margin-top: -4px;
}

.menu-item-has-children .sub-menu .menu-item-has-children:hover > a .dropdown-arrow {
    transform: rotate(45deg);
}

/************************************
 * 5. МОБИЛЬНАЯ ВЕРСИЯ МЕНЮ
 ************************************/
@media (max-width: 1199px) {
    .main-nav__list {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main-nav__list > li {
        width: 100%;
        display: block;
    }
    
    .main-nav__list > li > a,
    .header--transparent .main-nav__list > li > a {
        padding: 15px;
        border-bottom: 1px solid #f0f0f0;
        display: block;
        color: #003366; /* В мобильной версии текст всегда темно-синий */
    }
    
    .menu-item-has-children .sub-menu,
    .header--transparent .menu-item-has-children .sub-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding: 0;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        border-top: none;
        margin-left: 0;
        background-color: transparent;
    }
    
    .menu-item-has-children .sub-menu a,
    .header--transparent .menu-item-has-children .sub-menu a {
        padding: 8px 15px;
        display: block;
        min-height: auto;
        font-size: 13px;
        font-weight: normal;
        color: #fff;
        background-color: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .menu-item-has-children .sub-menu a:hover,
    .menu-item-has-children .sub-menu .current-menu-item > a,
    .header--transparent .menu-item-has-children .sub-menu a:hover,
    .header--transparent .menu-item-has-children .sub-menu .current-menu-item > a {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .dropdown-arrow {
        display: none;
    }
}
