/* Шапка */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding-bottom: 80px;
}

/* Верхняя черная полоса */
.header-top {
    background-color: var(--color-black);
    height: 48px;
    color: var(--color-white);
    display: flex;
    align-items: center;
    padding: 0 60px;
    width: 100%;
    position: relative;
    z-index: 1001;
    transition: transform 0.1s ease, opacity 0.3s ease;
}

.header-top-left {
    flex: 1;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
}

.header-top-center {
    flex: 2;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.header-top-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.top-menu-link {
    color: var(--color-white);
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
    white-space: nowrap;
}

.top-menu-link:hover {
    color: #ddd;
}

/* Нижняя белая полоса шапки */
.header-bottom {
    background-color: var(--color-white);
    height: 81px;
    display: flex;
    align-items: center;
    padding: 0 60px;
    border-bottom: 1px solid #e9eaea;
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    transition: transform 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94), top 0.3s ease;
    will-change: transform;
    z-index: 1000;
}

/* Состояние когда шапка скрыта */
.header-bottom.header-hidden {
    transform: translateY(-100%);
}

/* Состояние когда шапка видима */
.header-bottom.header-visible {
    transform: translateY(0);
}

/* Скрытие верхней черной полосы */
.header-top.header-top-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Корректируем позицию header-bottom когда header-top скрыта */
.header-top.header-top-hidden + .header-bottom {
    top: 0;
}

.logo {
    font-weight: bold;
    font-size: 24px;
    color: var(--color-black);
    z-index: 1002;
    min-width: 0;
    height: 100%;
}

.logo img {
    height: 100%;
}

/* Стили основного меню */
.main-menu {
    flex: 2;
    display: flex;
    justify-content: center;
    gap: 30px;
    min-width: 0;
    flex-wrap: wrap;
    z-index: 1001;
}

.menu-item {
    position: static;
}

.menu-item.active .menu-link {
    color: var(--color-black);
}

.menu-link {
    color: var(--color-black);
    text-decoration: none;
    font-weight: 400;
    padding: 5px 0;
    position: relative;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    cursor: pointer;
    font-size: 21px;
}

/* Эффект подчеркивания с постепенным заполнением */
.menu-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-black);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.menu-item:hover .menu-link::before,
.menu-item.active .menu-link::before {
    transform: scaleX(1);
}

/* Выпадающее меню - переработанная версия */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100vw;
    background-color: var(--color-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    border-top: 1px solid #eee;
    display: none;
}

/* Класс для отображения меню */
.dropdown-menu.active {
    display: block;
}

/* Контейнер для ограничения ширины контента */
.dropdown-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 40px;
}

/* Анимация смены контента */
.dropdown-left,
.dropdown-right {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Левый блок выпадающего меню (30%) */
h3.dropdown-left-title {
    font-size: 21px;
    margin-bottom: 35px;
    font-weight: bold;
    color: var(--color-black);
}

.dropdown-left {
    flex: 0 0 30%;
    max-width: 30%;
    border-right: 1px solid #dedede;
    padding: 80px 0px 65px 100px;
}

.dropdown-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-category-item {
    margin-bottom: 15px;
}

.dropdown-category-link {
    color: var(--color-black);
    text-decoration: none;
    font-weight: 500;
    font-size: 21px;
    display: block;
    transition: color 0.3s, padding-left 0.3s;
}

.dropdown-category-link:hover {
    color: var(--color-black);
    padding-left: 10px;
}

/* Обновленные стили для правого блока выпадающего меню */
.dropdown-right {
    flex: 0 0 69%;
    /* max-width: 70%; */
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    padding: 80px 60px 80px 65px;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0; /* Важно для правильной работы Swiper */
    overflow: hidden; /* Скрываем выходящий контент */
}

/* Стили для Swiper контейнера */
.dropdown-product-swiper {
    width: 100%;
    overflow: hidden;
    margin-top: 10px;
}

/* Стили для списка продуктов в Swiper */
.dropdown-product-list.swiper-wrapper {
    display: flex;
    gap: 0; /* Убираем gap, так как его заменит spaceBetween в JS */
}

/* Стили для слайда */
.dropdown-product.swiper-slide {
    /* max-width: calc(50% - 15px); */
    width: auto;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    margin-right: 20px; /* Добавляем отступ между слайдами */
}

.dropdown-product.swiper-slide:last-child {
    margin-right: 0;
}

.dropdown-product a {
    text-decoration: none;
}

.product-image {
    /* width: 264px;
    height: 264px; */
    max-width: 264px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #f7f5f4;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-title {
    font-weight: 600;
    font-size: 21px;
    margin-bottom: 10px;
    color: var(--color-black);
}

.product-price {
    font-size: 18px;
    color: var(--color-black);
    font-weight: 500;
    text-align: left;
}

/* Стили для скроллбара Swiper */
.dropdown-product-swiper .swiper-scrollbar {
    background: rgba(0, 0, 0, 0.1);
    height: 3px;
    width: 100%;
    margin-top: 15px;
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dropdown-product-swiper:hover .swiper-scrollbar {
    opacity: 1;
}
.dropdown-product-list.swiper-wrapper {
    padding-bottom: 25px;
}
.dropdown-product-swiper .swiper-scrollbar-drag {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    cursor: grabbing;
}

/* Скрываем скроллбар, если слайдов мало или они все помещаются */
.dropdown-product-swiper .swiper-scrollbar.swiper-scrollbar-lock {
    display: none;
}

.header-icons {
    display: flex;
    gap: 20px;
    align-items: center;
    z-index: 1002;
}

.header-icons a {
    color: #333;
    font-size: 20px;
    text-decoration: none;
    transition: color 0.3s;
}

.header-icons a img {
    width: 26px;
    height: 26px;
}

.header-icons a:hover {
    color: var(--color-black);
}

/* Слайдер в шапке */
.header-slider {
    width: 100%;
    max-width: 400px;
    height: 30px;
    overflow: hidden;
}

.header-slider .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--color-white);
    text-align: center;
    padding: 0 10px;
    font-weight: 700;
}

/* Стили для SVG бургера */
.burger-menu {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 12px;
    z-index: 1003;
    flex-shrink: 0;
    position: relative;
    width: 48px;
    height: 48px;
    margin-left: 15px;
}

.burger-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.burger-icon--open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.burger-icon--close {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.burger-menu.active .burger-icon--open {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.burger-menu.active .burger-icon--close {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Мобильное меню - обновленная версия с правильным скроллом */
.mobile-menu {
    position: fixed;
    top: 105px;
    left: 0;
    width: 100%;
    height: calc(100vh - 105px);
    max-height: calc(100vh - 105px);
    background-color: var(--color-white);
    z-index: 999;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, top 0.3s ease; /* Добавлен transition для top */
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
}

/* Корректируем позицию и высоту мобильного меню в зависимости от состояния шапки */
.header-bottom.header-hidden ~ .mobile-menu {
    top: 40px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

/* Когда шапка полностью скрыта */
.header-top.header-top-hidden + .header-bottom.header-hidden ~ .mobile-menu {
    top: 0;
    height: 100vh;
    max-height: 100vh;
}

/* Стилизация скроллбара для мобильного меню */
.mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Firefox */
.mobile-menu {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.mobile-menu-item {
    color: var(--color-black);
    text-decoration: none;
    font-size: 18px;
    padding: 13px 0;
    font-weight: 500;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    flex-wrap: wrap;
    width: 100%;
}

.mobile-menu-item a {
    text-decoration: none;
    color: inherit;
}

.mobile-menu-text {
    flex: 1;
    cursor: pointer;
}

/* SVG стрелка для пунктов с подменю */
.mobile-arrow {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
}

.mobile-arrow path {
    stroke: var(--color-black);
    stroke-width: 2;
}

.mobile-menu-item.has-submenu.active .mobile-arrow {
    transform: rotate(180deg);
}

/* Подменю в мобильной версии */
.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    width: 100%;
    border-radius: 4px;
    order: 2;
    flex-basis: 100%;
}

.mobile-submenu.active {
    max-height: 800px;
}

/* Стили для mobile-submenu-item */
.mobile-submenu-item {
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    padding: 12px 0;
    display: block;
    transition: all 0.3s;
    cursor: pointer;
}

/* Отключаем hover эффект для всей ссылки */
.mobile-submenu-item:hover {
    background-color: transparent;
    color: var(--color-black);
    padding-left: 0;
}

/* Применяем hover эффект только к тексту */
.mobile-submenu-item .submenu-item-wrapper span:first-child:hover {
    color: var(--color-black);
    opacity: 0.7;
}

/* Стили для обертки контента подменю */
.submenu-item-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Стрелка для пунктов подменю */
.submenu-arrow {
    width: 20px;
    height: 20px;
    transform: rotate(90deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.submenu-arrow path {
    stroke: var(--color-black);
    stroke-width: 2;
}

/* Стили для картинок в мобильном подменю */
.mobile-submenu-image-link {
    text-decoration: none;
    display: block;
    margin-top: 20px;
    margin-bottom: 10px;
}

.mobile-submenu-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mobile-submenu-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.mobile-submenu-image:hover img {
    transform: scale(1.05);
}

.mobile-submenu-image-description {
    display: block;
    padding: 12px 15px;
    color: var(--color-black);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
}

.mobile-submenu.active .mobile-submenu-image {
    animation: fadeIn 0.4s ease;
}

/* Фикс для body при открытом меню */
body.menu-open {
    overflow: hidden;
}

/* Стили для футера аккордеона */
.footer-links-container {
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
    overflow: hidden;
}

.footer-arrow {
    transition: transform 0.3s ease;
}

.footer-column-title {
    transition: margin-bottom 0.3s ease;
}

/* Медиа-запросы для адаптивности */
@media (max-width: 992px) {
    .header-icons {
        order: 3;
        margin-left: auto;
    }
    
    .burger-menu {
        display: block;
        order: 4;
    }
    
    .main-menu {
        display: none;
    }
    
    .logo {
        order: 1;
    }
    
    .header-bottom {
        justify-content: flex-start;
    }
    
    .dropdown-menu {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header-top, 
    .header-bottom {
        padding: 0 20px;
    }
    

    .header-top{

        height: 38px;
    }

    .header-bottom {
        height: 64px;
        top: 38px;
    }

    .header {
        padding-bottom: 63px;
    }
    
    .mobile-menu {
        top: 110px;
        height: calc(100vh - 110px);
        max-height: calc(100vh - 110px);
        padding: 20px;
    }
    
    .burger-menu {
        padding: 10px;
        width: 24px;
        height: 24px;
    }
    
    .burger-icon {
        width: 24px;
        height: 24px;
    }
    
    .header-bottom.header-hidden ~ .mobile-menu {
        top: 40px !important;
        height: calc(100vh - 40px) !important;
        max-height: calc(100vh - 40px) !important;
    }
    
    .header-top.header-top-hidden + .header-bottom.header-hidden ~ .mobile-menu {
        top: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }
    
    .mobile-menu-item {
        font-size: 17px;
        padding: 23px 0;
    }
    
    .mobile-submenu-item {
        font-size: 15px;
        padding: 14px 0;
    }
    
    .mobile-submenu-image-description {
        font-size: 15px;
        padding: 10px 12px;
    }
    
    .mobile-arrow {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 576px) {

    .header {
        padding-bottom: 60px;
    }


    .header-top-center {
        flex: 2;
    }
    
    .header-top-left, 
    .header-top-right {
        display: none;
    }
    
    .header-slider {
        max-width: 100%;
    }
    
    .swiper-slide {
        font-size: 12px;
        padding: 0 5px;
    }
    
    .mobile-menu {
        padding: 15px;
    }
    
    .mobile-submenu.active {
        max-height: 700px;
        margin-top: 15px;
        margin-bottom: 10px;
    }
    
    .mobile-submenu-image-description {
        font-size: 14px;
        padding: 8px 12px;
    }
}

@media (max-width: 400px) {
    .header-bottom {
        height: 60px;
        top: 38px;
    }
    
    .mobile-menu {
        top: 100px;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        padding: 15px;
    }
    
    .burger-menu {
        width: 36px;
        height: 36px;
        padding: 8px;
    }
    
    .burger-icon {
        width: 32px;
        height: 32px;
    }
    
    .mobile-menu-item {
        font-size: 16px;
        padding: 11px 0;
    }
    
    .mobile-submenu-item {
        font-size: 14px;
        padding: 8px 0;
    }
    
    .mobile-submenu.active {
        max-height: 600px;
    }
    
    .mobile-submenu-image-description {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .mobile-arrow {
        width: 20px;
        height: 20px;
    }
}