/* Header Styles for mebel-garda.ru */

/* Header Container */
/* Не занимает место в потоке, так как все элементы внутри fixed */
#t-header {
    position: relative;
    width: 100%;
    z-index: 10013;
    height: 0; /* Не занимает место в потоке */
    min-height: 0;
    overflow: visible;
}

@media screen and (max-width: 639px) {
    #t-header {
        height: 0;
        min-height: 0;
    }
}

/* Chameleon Menu Styles - всегда зафиксирован и виден */
#rec799759784,
#rec798590483 {
    position: fixed !important;
    top: 0px !important;
    left: 0;
    width: 100%;
    z-index: 10013;
    min-height: 84px;
    height: auto;
    background-color: transparent;
    /* Хедер всегда виден и зафиксирован */
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Initial state - menu is visible by default */
#rec799759784.fixed,
#rec798590483.fixed {
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Отключаем скрытие меню при прокрутке - хедер всегда виден */
#rec799759784.fixed.chameleonhide,
#rec798590483.fixed.chameleonhide {
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Show menu on scroll - всегда виден */
#rec799759784.fixed.chameleonshow,
#rec798590483.fixed.chameleonshow {
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Smooth transition */
#rec799759784.fixed.transtime,
#rec798590483.fixed.transtime {
    transition: transform 0.4s cubic-bezier(0, 0, 0.8, 1.0), 
                opacity 0.4s cubic-bezier(0, 0, 0.8, 1.0),
                visibility 0.4s cubic-bezier(0, 0, 0.8, 1.0);
}

.chameleonshow {
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.transtime {
    transition: transform 0.4s cubic-bezier(0, 0, 0.8, 1.0), 
                opacity 0.4s cubic-bezier(0, 0, 0.8, 1.0),
                visibility 0.4s cubic-bezier(0, 0, 0.8, 1.0);
}

/* Chameleon mode - white icons/text */
div.chameleon .tn-atom,
div.chameleon .menu-btn {
    color: #ffffff !important;
}

.icon-white {
    display: none;
}

div.chameleon .icon-white {
    display: block;
}

div.chameleon .icon-black {
    display: none;
}

/* Header Container (desktop, используется в header-desktop) */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 88px;
    height: 88px;
    width: 100%;
    box-sizing: border-box;
    background-color: #FFFFFF;
}

@media screen and (max-width: 1199px) {
    .header-container {
        padding: 0 22px;
    }
}

@media screen and (max-width: 639px) {
    .header-container {
        padding: 0 16px;
        min-height: 64px;
        height: 64px;
    }
}

/* --- Mobile header (Figma: Mobile-menu) --- */

@media screen and (max-width: 1199px) {
    .header-mobile,
    #rec798590483 {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10013;
        height: 70px;
        min-height: 70px;
        max-height: 70px;
    }
}

@media screen and (max-width: 1199px) {
    .mobile-header-bar {
        position: relative;
        z-index: 10013;
        height: 70px;
        background-color: #FFFFFF;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
    }

    .mobile-header-logo {
        width: 92px;
        height: 40px;
        display: flex;
        align-items: center;
    }

    .mobile-header-logo__img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .mobile-header-right {
        display: flex;
        align-items: center;
        gap: 4px; /* Одинаковый промежуток между всеми иконками */
    }

    .mobile-header-icon-btn {
        width: 50px;
        height: 50px;
        border: none;
        padding: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.2s ease;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    /* Зеленая подсветка при нажатии */
    .mobile-header-icon-btn:active {
        background-color: #57A7B3;
    }
    
    /* Для иконок с img делаем белыми при активном состоянии */
    .mobile-header-icon-btn:active img {
        filter: brightness(0) invert(1);
    }

    .mobile-header-icon-btn__img {
        width: 32px;
        height: 32px;
        object-fit: contain;
    }

    /* Иконка поиска товаров - кнопка стандартного размера, SVG внутри 28x28px */
    .mobile-header-icon-btn--search-products {
        /* Размер кнопки остается 50x50px как у всех */
        position: relative;
        margin-right: -4px; /* Уменьшаем gap между иконками поиска на 4px (еще на 2px) */
    }
    
    .mobile-header-icon-btn--search-products svg {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        max-width: 28px;
        max-height: 28px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: block;
    }
    
    /* Иконка поиска заказа - стандартный размер */
    .mobile-header-icon-btn--search {
        /* Размер кнопки остается 50x50px как у всех */
    }

    .mobile-header-icon-btn--cart {
        position: relative;
        margin-right: 5px; /* Увеличиваем пробел между корзиной и бургер-меню на 5px */
    }
    
    /* Для корзины с SVG меняем цвет stroke на белый при активном состоянии */
    .mobile-header-icon-btn--cart:active svg path {
        stroke: #FFFFFF !important;
    }

    .mobile-header-cart-icon {
        width: 32px;
        height: 24px;
    }

    .mobile-header-cart-badge {
        position: absolute;
        top: 2px;
        right: 4px;
        min-width: 16px;
        height: 16px;
        padding: 0 3px;
        border-radius: 999px;
        background-color: #57A7B3;
        color: #FFFFFF;
        font-family: 'Montserrat', sans-serif;
        font-weight: 600;
        font-size: 10px;
        line-height: 16px;
        text-align: center;
        text-transform: uppercase;
    }
    
    /* Скрываем бейдж, если count = 0 */
    .mobile-header-cart-badge[data-cart-count="0"],
    .mobile-header-cart-badge:empty {
        display: none !important;
    }

    .mobile-header-burger {
        width: 36px;
        height: 36px;
        border: none;
        padding: 0;
        background: transparent;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        cursor: pointer;
        margin-left: 34px; /* расстояние между корзиной и бургером по макету */
        transition: background-color 0.2s ease;
        border-radius: 8px;
    }
    
    /* Зеленая подсветка при нажатии */
    .mobile-header-burger:active {
        background-color: #57A7B3;
    }
    
    .mobile-header-burger:active .mobile-header-burger__line {
        background-color: #FFFFFF; /* Белые линии при активном состоянии */
    }

    .mobile-header-burger__line {
        width: 36px;
        height: 3px;
        border-radius: 3px;
        background-color: #0C181A;
        transition: background-color 0.2s ease;
    }
}

/* Logo Styles - выровнен по левому краю текста hero-секции */
/* Логотип позиционируется относительно viewport (как hero-title), а не container */
.header-logo {
    position: fixed; /* Относительно viewport, как hero-title */
    top: 60px; /* Исходная позиция, не двигаем по вертикали */
    left: 68px; /* Выровнено по левому краю текста "ЭМОЦИЯ" (тот же left что и у hero-title) */
    width: 178px;
    height: auto;
    z-index: 10014; /* Выше чем header */
}

.header-logo img {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 1199px) {
    .header-logo {
        left: 22px;
    }
}

@media screen and (max-width: 639px) {
    .header-logo {
        top: 20px;
        left: 16px;
        width: 112px;
    }
}

/* Navigation Menu - центрировано между логотипом и бургером */
.header-nav {
    position: fixed; /* Относительно viewport, как логотип и бургер */
    top: 51px; /* Верхний край */
    left: calc((68px + 178px + 100vw - 78px - 100px) / 2); /* Центр между правым краем логотипа (68px + 178px) и левым краем бургера (100vw - 78px - 100px) */
    transform: translateX(-50%); /* Центрируем меню относительно его центра */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px; /* Больше пространства между элементами */
    height: 55px;
    z-index: 10013;
}
/* Центр меню: top (51px) + половина высоты (27.5px) = 78.5px */

/* Menu Buttons - стандартный Flexbox подход */
.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    padding: 0 25px; /* Увеличено пространство внутри кнопок */
    color: #000000;
    font-size: 14px;
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.5;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 30px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    white-space: nowrap;
}

.menu-btn:hover {
    color: #5fa8be;
}

@media screen and (max-width: 1199px) {
    .header-nav {
        display: none;
    }
}

/* Menu Separator - между элементами в flexbox */
.menu-separator {
    width: 1px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.1);
    opacity: 0.1;
    margin: 0; /* Убираем margin, так как gap уже есть */
    flex-shrink: 0;
}

.menu-separator.icon-white {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 0.15;
}

@media screen and (max-width: 639px) {
    .menu-separator {
        height: 80px;
    }
}

/* Menu Burger Button - центрирован относительно пунктов меню по вертикали, сдвинут вниз на 3px */
.menu-burger {
    position: fixed; /* Относительно viewport, как логотип */
    top: calc(51px + 27.5px - 19px + 3px); /* Центр меню минус половина высоты бургера плюс 3px вниз */
    right: 78px; /* Сдвинут влево на 10px */
    width: 100px;
    height: 38px; /* Высота: 2 линии по 2px + gap 13px + небольшой отступ */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    z-index: 10014; /* Выше чем header */
}

/* Старые стили бургера удалены - используются стили из header-new.css */

.burger-line.icon-white {
    background-color: #ffffff;
}

@media screen and (max-width: 1199px) {
    .menu-burger {
        width: 60px;
    }
}

@media screen and (max-width: 639px) {
    .menu-burger {
        top: 43px;
        right: 20px;
        width: 40px;
    }
}

/* Mobile Menu Button */
.menu-burger-btn {
    position: absolute;
    top: 40px;
    right: 27px;
    width: 56px;
    height: 56px;
    border: none;
    background-color: #57A7B3; /* Garda-Green_Primary */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

@media screen and (max-width: 639px) {
    .menu-burger-btn {
        top: 14px;
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* Плоский бургер без зелёного круга внутри mobile-header */
@media screen and (max-width: 1199px) {
    .header-mobile .menu-burger-btn {
        position: static;
        width: 36px;
        height: 36px;
        padding: 0;
        margin: 0;
        background: transparent;
        border-radius: 8px;
        box-shadow: none;
        transition: background-color 0.2s ease;
    }
    
    /* Зеленая подсветка при нажатии */
    .header-mobile .menu-burger-btn:active {
        background-color: #57A7B3;
    }
    
    .header-mobile .menu-burger-btn:active .mobile-header-burger__line {
        background-color: #FFFFFF; /* Белые линии при активном состоянии */
    }
}

/* Burger menu button для desktop версии (header-desktop) */
.burger-menu-btn {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    height: 84px;
    min-height: 84px;
    max-height: 84px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: absolute;
    right: clamp(20px, 2.5vw, 40px);
    top: 0;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    z-index: 10015;
    transition: opacity 0.1s ease, visibility 0.1s ease;
}

.burger-menu-btn > div {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    left: 0;
    top: 34px;
    width: 80px;
    height: 16px;
}

.burger-line {
    width: 80px;
    height: 3px;
    background: #0C181A;
    flex-shrink: 0;
    position: relative;
}

/* Зеленая линия при наведении - появляется поверх чёрной линии */
.burger-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 3px;
    background: #57A7B3;
    transition: width 0.3s ease;
}

/* Верхняя линия (первая) - заполнение слева направо */
.burger-menu-btn:hover .burger-line:nth-child(1)::before {
    width: 80px;
    left: 0;
    right: auto;
}

/* Нижняя линия (вторая) - заполнение справа налево */
.burger-line:nth-child(2)::before {
    left: auto;
    right: 0;
}

.burger-menu-btn:hover .burger-line:nth-child(2)::before {
    width: 80px;
    left: auto;
    right: 0;
}

/* Стили для бейджа корзины (desktop) */
.cart-badge {
    position: absolute;
    min-width: 18px;
    width: auto;
    height: 18px;
    min-height: 18px;
    padding: 0 4px;
    left: 32px;
    top: 2px;
    background: #57A7B3;
    border: 2px solid #F5F5F5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.12;
    text-transform: uppercase;
    color: #FFFFFF;
    pointer-events: none;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Скрываем бейдж, если count = 0 */
.cart-badge[data-cart-count="0"],
.cart-badge:empty {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Показываем бейдж только если count > 0 */
.cart-badge:not([data-cart-count="0"]):not(:empty) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Стили для .header-right (если их нет в header-new.css) */
/* Теперь header-right сдвинут влево, чтобы освободить место для бургер-меню */
.header-right {
    display: flex !important;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    position: absolute;
    width: 298px;
    min-width: 298px;
    max-width: calc(100% - 40px);
    height: 84px;
    min-height: 84px;
    right: calc(clamp(20px, 2.5vw, 40px) + 80px); /* Сдвигаем влево на ширину бургер-меню (80px) */
    top: 0px;
    box-sizing: border-box;
    flex-shrink: 0;
    z-index: 10014;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Убеждаемся, что header-right виден в header-desktop */
.header-desktop .header-right,
.top-menu-fill .header-right {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Убеждаемся, что бургер-меню видно в header-desktop - теперь оно вне header-right */
.header-desktop .burger-menu-btn,
.top-menu-fill .burger-menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    right: clamp(20px, 2.5vw, 40px) !important;
    top: 0 !important;
    z-index: 10015 !important;
}

/* Убеждаемся, что линии бургера видны */
.header-desktop .burger-line,
.top-menu-fill .burger-line,
.header-right .burger-line,
.burger-menu-btn .burger-line {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #0C181A !important;
    width: 80px !important;
    height: 3px !important;
}

/* Убеждаемся, что контейнер линий бургера виден */
.burger-menu-btn > div {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: absolute !important;
    flex-direction: column !important;
    gap: 10px !important;
    left: 0 !important;
    top: 34px !important;
    width: 80px !important;
    height: 16px !important;
}

.burger-icon {
    width: 20px;
    height: 20px;
    position: relative;
}

.burger-icon::before,
.burger-icon::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: all 0.3s;
}

.burger-icon::before {
    top: 0;
}

.burger-icon::after {
    bottom: 0;
}

/* Catalog Icon - привязан к пункту меню "Каталог" с отступом 10px */
.catalog-icon {
    position: fixed; /* Относительно viewport, как меню */
    top: calc(51px + 27.5px - 8px - 3px); /* Центр меню минус половина высоты иконки минус 3px вверх */
    /* Центр меню минус приблизительно половина ширины меню (~350px) минус отступ 10px минус половина ширины иконки (8px) */
    left: calc(((68px + 178px + 100vw - 78px - 100px) / 2) - 350px - 10px - 8px);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10014;
}

.catalog-icon img {
    max-width: 100%;
    height: auto;
}

@media screen and (max-width: 1199px) {
    .catalog-icon {
        top: -70px;
        display: none;
    }
}

/* Header Desktop - show on 1200px+ */
.header-desktop {
    display: block;
}

@media screen and (max-width: 1199px) {
    .header-desktop {
        display: none !important;
    }
}

/* Header Mobile - show on < 1200px */
.header-mobile {
    display: none;
}

@media screen and (max-width: 1199px) {
    .header-mobile,
    #rec798590483 {
        display: block !important;
        max-height: 70px;
    }
}

/* Хедер всегда зафиксирован и виден, независимо от классов chameleon */
#rec799759784,
#rec799759784.chameleonhide,
#rec799759784.chameleonshow,
#rec798590483,
#rec798590483.chameleonhide,
#rec798590483.chameleonshow,
.header-desktop {
    position: fixed !important;
    top: 0 !important;
    transform: translateY(0%) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Скрываем иконку прокрутки на главной странице */
.hero-scroll-icon {
    display: none !important;
}

