/* 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 {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10013;
    }
}

@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: 0;
    }

    .mobile-header-icon-btn {
        width: 50px;
        height: 50px;
        border: none;
        padding: 0;
        background: transparent;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

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

    .mobile-header-icon-btn--cart {
        position: relative;
        margin-right: 28px; /* расстояние до бургера по макету */
    }

    .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;
    }

    .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; /* расстояние между корзиной и бургером по макету */
    }

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

/* 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: 0;
        box-shadow: none;
    }
}

.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 {
        display: block !important;
    }
}

/* Хедер всегда зафиксирован и виден, независимо от классов 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;
}

