/* ============================================
   HEADER - ГИБКОЕ ПОЗИЦИОНИРОВАНИЕ С ПОЛНЫМ КОНТРОЛЕМ
   Адаптирован под существующую HTML структуру
   Использует CSS переменные для настройки всех параметров
   ============================================ */

/* ============================================
   НАСТРОЙКИ - ВСЕ ПАРАМЕТРЫ ЗДЕСЬ
   Меняйте эти значения для настройки хедера
   ============================================ */
:root {
    /* === ВЕРХНЯЯ ПАНЕЛЬ (WHITE BAR) === */
    --header-topbar-width: 1330px;
    /* Ширина белой панели */
    --header-topbar-height: 80px;
    /* Высота белой панели */
    --header-topbar-margin-top: 0px;
    /* Отступ сверху */
    --header-topbar-bg: #FFFFFF;
    /* Цвет фона */
    --header-topbar-radius: 5px;
    /* Скругление углов */
    --header-topbar-padding-h: 0px;
    /* Внутренний отступ слева/справа */
    --header-topbar-font-size: 17px;
    /* Основной размер шрифта для всей верхней панели */

    /* === МОБИЛЬНЫЕ НАСТРОЙКИ (не влияют на ПК) === */
    --mobile-header-height: 60px;
    /* Высота мобильного хедера */
    --mobile-bg: #FFFFFF;
    /* Фон мобильного хедера */
    --mobile-logo-width: 100px;
    /* Ширина лого на мобильном */
    --mobile-icon-size: 24px;
    /* Размер иконок на мобильном */
    --mobile-burger-size: 24px;
    /* Размер бургера */
    --mobile-padding-h: 16px;
    /* Боковые отступы */

    /* === ЛОГОТИП === */
    --logo-width: 120px;
    /* Ширина логотипа */
    --logo-height: 46px;
    /* Высота логотипа */
    --logo-margin-left: 8px;
    /* Отступ слева у логотипа */
    --logo-margin-right: 155px;

    /* Отступ справа от логотипа (до навигации) */

    /* === НАВИГАЦИЯ (Главная, Доставка, Оплата, Акции) === */
    --nav-gap: 20px;
    /* Расстояние между ссылками */
    --nav-font-size: var(--header-topbar-font-size);
    /* Размер шрифта (берет из общей настройки) */
    --nav-font-weight: 500;
    /* Толщина шрифта */
    --nav-color: #666666;
    /* Цвет текста */
    --nav-color-hover: #231F20;
    /* Цвет при наведении */
    --nav-color-active: #EE2722;
    /* Цвет активной ссылки */
    --nav-margin-left: 0px;
    /* Отступ слева у навигации */
    --nav-margin-right: auto;
    /* Отступ справа от навигации (auto = заполняет пространство) */

    /* === КОНТАКТЫ (Телефон, Email) === */
    --contact-gap: 24px;
    /* Расстояние между телефоном и email */
    --contact-font-size: var(--header-topbar-font-size);
    /* Размер шрифта (берет из общей настройки) */
    --contact-color: #666666;
    /* Цвет текста */
    --contact-icon-size: 16px;
    /* Размер иконок */
    --contact-margin-right: 0px;
    /* Отступ справа */
    --contact-margin-left: 0px;
    /* Отступ слева у контактов */
    /* Отступ слева у контактов */

    /* === ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА === */
    --lang-font-size: var(--header-topbar-font-size);
    /* Размер шрифта (берет из общей настройки) */
    --lang-color: #666666;
    /* Цвет текста */
    --lang-margin-left: 10px;
    /* Отступ слева у языка */
    --lang-margin-right: 0px;
    /* Отступ справа у языка */

    /* === ЛИЧНЫЙ КАБИНЕТ === */
    --cabinet-font-size: var(--header-topbar-font-size);
    /* Размер шрифта */
    --cabinet-color: #666666;
    /* Цвет текста */
    --cabinet-icon-size: 16px;
    /* Размер иконки */
    --cabinet-margin-left: 30px;
    /* Отступ слева */
    --cabinet-margin-right: 18px;
    /* Отступ справа */

    /* === НИЖНЯЯ ПАНЕЛЬ (ACTION BAR) === */
    --header-actionbar-width: 1330px;
    /* Ширина панели действий */
    --header-actionbar-height: 59px;
    /* Высота панели */
    --header-actionbar-margin-top: 10px;
    /* Отступ от верхней панели */
    --header-actionbar-gap: 20px;
    /* Расстояние между элементами */
    --header-actionbar-padding-h: 0px;
    /* Внутренний отступ слева/справа */

    /* === КНОПКА КАТАЛОГ === */
    --catalog-btn-height: 51px;
    /* Высота кнопки */
    --catalog-btn-padding: 12px 45px;
    /* Внутренние отступы */
    --catalog-btn-bg: #EE2722;
    /* Цвет фона */
    --catalog-btn-bg-hover: #D11E1A;
    /* Цвет при наведении */
    --catalog-btn-radius: 15px;
    /* Скругление */
    --catalog-btn-font-size: 14px;
    /* Размер шрифта */

    --catalog-btn-icon-gap: 10px;
    /* Расстояние между иконкой и текстом */
    --catalog-btn-margin-right: 0px;
    /* Отступ справа у кнопки Каталог */
    --catalog-btn-margin-left: 8px;
    /* Отступ слева у кнопки Каталог */

    /* === ПОЛЕ ПОИСКА === */
    --search-height: 51px;
    /* Высота поля */
    --search-padding: 12px 45px 12px 16px;
    /* Внутренние отступы */
    --search-bg: #F6F6F6;
    /* Цвет фона */
    --search-border: 1px solid #E5E5E5;
    /* Рамка */
    --search-border-focus: #EE2722;
    /* Цвет рамки при фокусе */
    --search-radius: 8px;
    /* Скругление */
    --search-font-size: 14px;
    /* Размер шрифта */
    --search-placeholder-color: #999999;
    /* Цвет placeholder */
    --search-margin-right: 0px;
    /* Отступ справа у поиска */
    --search-margin-left: 12px;
    /* Отступ слева у поиска */
    --search-max-width: 800px;
    /* Максимальная ширина поиска */

    /* === КНОПКА "ЗАКАЗАТЬ ЗВОНОК" === */
    --callback-btn-height: 51px;
    /* Высота кнопки */
    --callback-btn-padding: 12px 24px;
    /* Внутренние отступы */
    --callback-btn-bg: #EE2722;
    /* Цвет фона */
    --callback-btn-bg-hover: #D11E1A;
    /* Цвет при наведении */
    --callback-btn-radius: 8px;
    /* Скругление */
    --callback-btn-font-size: 14px;
    /* Размер шрифта */
    --callback-btn-margin-right: 0px;
    /* Отступ справа у кнопки звонка */
    --callback-btn-margin-left: 0px;
    /* Отступ слева у кнопки звонка */

    /* === WISHLIST И КОРЗИНА === */
    --icon-btn-size: 48px;
    /* Размер кнопок */
    --icon-size: 24px;
    /* Размер иконок */
    --badge-size: 18px;
    /* Размер счетчика */
    --badge-font-size: 10px;
    /* Размер шрифта счетчика */
    --wishlist-margin-right: 0px;
    /* Отступ справа у избранного */
    --wishlist-margin-left: auto;
    /* Отступ слева у избранного (auto = прижать вправо) */
    --cart-margin-right: 10px;
    /* Отступ справа у корзины */
    --cart-margin-left: 0px;
    /* Отступ слева у корзины */

    /* === ОБЩИЕ === */
    --header-font-family: 'Montserrat', sans-serif;
    --transition-speed: 0.3s;
}

/* ============================================
   ОСНОВНОЙ КОНТЕЙНЕР 
   ХЕДЕРА
   ============================================ */
.header-desktop {
    position: relative !important;
    background-color: transparent;
    padding-top: 10px;
    z-index: 1000;
}

/* Скрыть МОБИЛЬНОЕ МЕНЮ на desktop (строгий медиа-запрос) */
@media (min-width: 769px) {

    #mobilemenu,
    #mobilemenu-overlay,
    .mobile-menu,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Показать мобильное меню только на мобильных экранах */
@media (max-width: 768px) {

    #mobilemenu,
    .mobile-menu {
        display: block !important;
    }

    #mobilemenu-overlay,
    .mobile-menu-overlay {
        display: none;
        /* Скрыто по умолчанию */
    }

    #mobilemenu-overlay.active,
    .mobile-menu-overlay.active {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* Активное состояние меню - повышенная специфичность */
    body #mobilemenu.active,
    body .mobile-menu.active,
    #mobilemenu.active,
    .mobile-menu.active {
        transform: translateX(0) !important;
        -webkit-transform: translateX(0) !important;
        -ms-transform: translateX(0) !important;
        left: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
}

/* Скрыть desktop хедер на мобильных экранах */
@media (max-width: 768px) {
    .header-desktop {
        display: none;
    }
}

/* ============================================
   МОБИЛЬНЫЙ ХЕДЕР
   ============================================ */
.header-mobile {
    display: none;
    /* Скрыт по умолчанию на desktop */
    width: 100%;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    background-color: var(--mobile-bg);
    border-bottom: 1px solid #E5E5E5;
    height: var(--mobile-header-height);
}

/* Показать мобильный хедер на мобильных экранах */
@media (max-width: 768px) {
    .header-mobile {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 16px !important;
    }
    
    /* Добавляем отступ сверху у body чтобы контент не перекрывался хедером */
    body {
        padding-top: calc(var(--mobile-header-height) + 16px) !important;
        margin-top: 0 !important;
    }
    
    /* Убираем отступы сверху у контейнеров на мобильной версии */
    body .wrapper,
    body .wrapper_inner,
    body .container,
    body .container_inner,
    body .middle {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

.mobile-header-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--mobile-padding-h);
}

.mobile-burger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-burger svg {
    width: var(--mobile-burger-size);
    height: var(--mobile-burger-size);
}

.mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo img {
    width: var(--mobile-logo-width);
    height: auto;
    object-fit: contain;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-cart {
    position: relative !important;
    color: #333;
    display: flex;
    align-items: center;
}

.mobile-cart svg {
    width: var(--mobile-icon-size);
    height: var(--mobile-icon-size);
}

.mobile-cart .cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #EE2722;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* === МОБИЛЬНОЕ МЕНЮ (SIDEBAR) === */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background-color: #FFFFFF;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    /* Исправление видимости: используем ID селектор чтобы перебить display: none */
    display: block !important;
}

body #mobilemenu.active,
body .mobile-menu.active,
#mobilemenu.active,
.mobile-menu.active {
    transform: translateX(0) !important;
    -webkit-transform: translateX(0) !important;
    -ms-transform: translateX(0) !important;
    left: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.mobile-menu-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 1999 !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

#mobilemenu-overlay.active,
.mobile-menu-overlay.active {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.mobile-menu-content {
    padding: 24px 20px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* === НОВЫЕ ЭЛЕМЕНТЫ МОБИЛЬНОГО МЕНЮ (КАБИНЕТ + ПОИСК) === */
.mobile-menu-cabinet {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F0F0F0;
}

.mobile-cabinet-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #231F20;
    font-family: var(--header-font-family);
    font-size: 16px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    background-color: #F8F8F8;
    transition: all 0.2s ease;
}

.mobile-cabinet-link:hover {
    background-color: #EE2722;
    color: #FFFFFF;
}

.mobile-cabinet-link:hover .cabinet-icon {
    color: #FFFFFF;
}

/* Активное состояние - когда пользователь авторизован */
.mobile-cabinet-link.active {
    background-color: #EE2722;
    color: #FFFFFF;
}

.mobile-cabinet-link.active .cabinet-icon {
    color: #FFFFFF;
}

.mobile-cabinet-link .cabinet-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #231F20;
    transition: color 0.2s ease;
}

.mobile-menu-search {
    margin-bottom: 24px;
}

.mobile-search-form {
    display: flex;
    position: relative !important;
    width: 100%;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    font-family: var(--header-font-family);
    font-size: 14px;
    outline: none;
    background: #FFFFFF;
    color: #231F20;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.mobile-search-input:focus {
    border-color: #EE2722;
    background: #FAFAFA;
}

.mobile-search-input::placeholder {
    color: #999999;
}

.mobile-search-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #666666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.mobile-search-button:hover {
    color: #EE2722;
}

.mobile-search-button svg {
    width: 18px;
    height: 18px;
}

.mobile-menu-nav {
    margin-bottom: 24px;
}

.mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-nav li {
    margin-bottom: 8px;
}

.mobile-menu-nav .menu-link {
    font-family: var(--header-font-family);
    font-size: 16px;
    color: #231F20;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.mobile-menu-nav .menu-link:hover {
    background-color: #F8F8F8;
    color: #EE2722;
}

.mobile-menu-nav .menu-link-wishlist {
    position: relative !important;
}

.wishlist-count-badge {
    background-color: #EE2722;
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    height: 16px;
    text-align: center;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* === ЯЗЫКИ === */
.mobile-menu-language {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #F0F0F0;
}

.lang-selector-mobile {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

.lang-link-mobile {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-family: var(--header-font-family);
    font-size: 14px;
    font-weight: 500;
    color: #666666;
    background-color: #F8F8F8;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.lang-link-mobile:hover {
    background-color: #EEEEEE;
    color: #231F20;
}

.lang-link-mobile.active {
    background-color: #EE2722;
    color: #FFFFFF;
    border-color: #EE2722;
}

/* === КОНТАКТЫ === */
.mobile-menu-contact {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #F0F0F0;
}

.mobile-menu-contact .contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #231F20;
    font-family: var(--header-font-family);
    font-size: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.mobile-menu-contact .contact-link:hover {
    background-color: #F8F8F8;
    color: #EE2722;
}

.mobile-menu-contact .contact-link:last-child {
    margin-bottom: 0;
}

.mobile-menu-contact .contact-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #666666;
    transition: color 0.2s ease;
}

.mobile-menu-contact .contact-link:hover .contact-icon {
    color: #EE2722;
}

@media (max-width: 768px) {
    .header-mobile {
        display: block;
    }
}

/* ============================================
   ВЕРХНЯЯ БЕЛАЯ ПАНЕЛЬ
   ============================================ */
.header-top-bar {
    width: var(--header-topbar-width) !important;
    height: var(--header-topbar-height);
    margin: var(--header-topbar-margin-top) auto 0;
    background: var(--header-topbar-bg);
    border-radius: var(--header-topbar-radius);
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.08);
}

/* Container внутри top bar - Flexbox для расположения элементов */
.header-top-bar .container {
    height: 100%;
    padding: 0 var(--header-topbar-padding-h) !important;
    width: 100% !important;
    /* Гарантируем, что контейнер занимает всю ширину */
    max-width: none !important;
    /* Отключаем ограничение ширины контейнера */

    /* Flexbox для расположения всех элементов в ряд */
    display: flex;
    align-items: center;
    gap: 0;
    /* Убрали общий gap, теперь отступы контролируются индивидуально через margin */
}

/* ============================================
   ЛОГОТИП
   ============================================ */
.header-logo {
    width: var(--logo-width);
    height: var(--logo-height);
    margin-left: var(--logo-margin-left);
    margin-right: var(--logo-margin-right);
    flex-shrink: 0;
}

.header-logo a {
    display: block;
    width: 100%;
    height: 100%;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ============================================
   НАВИГАЦИОННЫЕ ССЫЛКИ
   ============================================ */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--nav-gap);
    margin-right: var(--nav-margin-right);
    margin-left: var(--nav-margin-left);
    flex-shrink: 0;
}

.header-nav .nav-link {
    font-family: var(--header-font-family);
    font-size: var(--nav-font-size);
    font-weight: var(--nav-font-weight);
    color: var(--nav-color);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-speed) ease;
    position: relative !important;
}

.header-nav .nav-link:hover {
    color: var(--nav-color-hover);
}

.header-nav .nav-link.active {
    color: var(--nav-color-active);
}

/* ============================================
   КОНТАКТНАЯ ИНФОРМАЦИЯ
   ============================================ */
.header-contact {
    display: flex;
    align-items: center;
    gap: var(--contact-gap);
    margin-right: var(--contact-margin-right);
    margin-left: var(--contact-margin-left);
    flex-shrink: 0;
}

.header-contact .contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--header-font-family);
    font-size: var(--contact-font-size);
    font-weight: 400;
    color: var(--contact-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.header-contact .contact-item:hover {
    color: #231F20;
}

.header-contact .contact-icon {
    width: var(--contact-icon-size);
    height: var(--contact-icon-size);
    flex-shrink: 0;
}

/* ============================================
   ПЕРЕКЛЮЧАТЕЛЬ ЯЗЫКА
   ============================================ */
.header-language {
    position: relative !important;
    flex-shrink: 0;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px 8px;
    user-select: none;
}

.lang-current {
    font-family: var(--header-font-family);
    font-size: var(--lang-font-size);
    font-weight: 500;
    color: var(--lang-color);
}

.lang-arrow {
    transition: transform var(--transition-speed) ease;
    opacity: 0.6;
}

.lang-selector.active .lang-arrow {
    transform: rotate(180deg);
}

/* Выпадающее меню языков */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
    display: none;
    min-width: 100px;
    z-index: 1000;
}

/* Показываем dropdown когда lang-selector или lang-dropdown активен */
.header-language .lang-selector.active ~ .lang-dropdown,
.header-language .lang-selector.active + .lang-dropdown,
.lang-dropdown.active {
    display: block !important;
}

.lang-link {
    display: block;
    padding: 8px 12px;
    font-family: var(--header-font-family);
    font-size: 14px;
    color: #666666;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.lang-link:hover {
    background-color: #F5F5F5;
}

.lang-link.active {
    color: #EE2722;
    font-weight: 600;
}

/* ============================================
   ЛИЧНЫЙ КАБИНЕТ
   ============================================ */
.header-cabinet {
    display: flex;
    align-items: center;
    margin-left: var(--cabinet-margin-left);
    margin-right: var(--cabinet-margin-right);
    flex-shrink: 0;
}

.cabinet-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--cabinet-color);
    font-family: var(--header-font-family);
    font-size: var(--cabinet-font-size);
    transition: color var(--transition-speed) ease;
}

.cabinet-link:hover {
    color: var(--nav-color-active);
}

.cabinet-icon {
    width: var(--cabinet-icon-size);
    height: var(--cabinet-icon-size);
}

/* Активное состояние - когда пользователь авторизован */
.cabinet-icon.active {
    color: #EE2722;
}

.cabinet-link:has(.cabinet-icon.active) {
    color: #EE2722;
}

/* ============================================
   НИЖНЯЯ ПАНЕЛЬ ДЕЙСТВИЙ
   ============================================ */
.header-action-bar {
    width: var(--header-actionbar-width) !important;
    height: var(--header-actionbar-height);
    margin: var(--header-actionbar-margin-top) auto 0;
    padding: 0 var(--header-actionbar-padding-h);

    /* Flexbox для расположения элементов */
    display: flex;
    align-items: center;
    gap: var(--header-actionbar-gap);
}

/* Container внутри action bar - тоже flex */
.header-action-bar .container {
    width: 100% !important;
    max-width: none !important;
    padding: 0 var(--header-actionbar-padding-h) !important;
    display: flex;
    align-items: center;
    gap: var(--header-actionbar-gap);
}

/* ============================================
   КОРЗИНА И МИНИ-КОРЗИНА
   ============================================ */
.cart-wrapper {
    position: relative !important;
    flex-shrink: 0;
}

.cart-button {
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: #231F20;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.cart-button:hover {
    color: #EE2722;
}

.cart-button svg {
    width: 24px;
    height: 24px;
}

.cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #EE2722;
    color: white;
    font-family: var(--header-font-family);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* Mini Cart Dropdown */
.mini-cart-dropdown {
    position: absolute !important;
    top: calc(100% + 12px) !important;
    right: 0 !important;
    width: 320px !important;
    background: #FFFFFF !important;
    border: 1px solid #E5E5E5 !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-8px) !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease !important;
    display: block !important;
}

.cart-wrapper:hover .mini-cart-dropdown,
.header-action-bar .cart-wrapper:hover .mini-cart-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #E5E5E5;
    background: #F8F8F8;
}

.mini-cart-title {
    font-family: var(--header-font-family);
    font-size: 18px;
    font-weight: 600;
    color: #231F20;
}

.mini-cart-items-count {
    font-family: var(--header-font-family);
    font-size: 14px;
    font-weight: 400;
    color: #FFFFFF;
    background: #EE2722;
    padding: 4px 8px;
    border-radius: 12px;
}

.mini-cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.mini-cart-items::-webkit-scrollbar {
    width: 6px;
}

.mini-cart-items::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.mini-cart-items::-webkit-scrollbar-thumb {
    background: #CCCCCC;
    border-radius: 3px;
}

.mini-cart-items::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

.mini-cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.mini-cart-empty p {
    font-family: var(--header-font-family);
    font-size: 15px;
    font-weight: 400;
    color: #666666;
    margin: 0;
    line-height: 1.5;
}

.mini-cart-footer {
    padding: 16px 20px;
    border-top: 1px solid #E5E5E5;
}

.mini-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mini-cart-total-label {
    font-family: var(--header-font-family);
    font-size: 16px;
    font-weight: 600;
    color: #231F20;
}

.mini-cart-total-price {
    font-family: var(--header-font-family);
    font-size: 20px;
    font-weight: 700;
    color: #EE2722;
}

.mini-cart-button {
    display: block !important;
    width: 100% !important;
    padding: 12px 16px !important;
    background-color: #EE2722 !important;
    color: #FFFFFF !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    font-family: var(--header-font-family) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    box-sizing: border-box !important;
}

.mini-cart-button:hover {
    background-color: #D4201B !important;
    color: #FFFFFF !important;
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */
/* Закомментировано - чтобы можно было менять ширину в базовых переменных
@media (min-width: 1400px) {
    :root {
        --header-topbar-width: 1300px;
        --header-actionbar-width: 1300px;
    }
}

@media (min-width: 1600px) {
    :root {
        --header-topbar-width: 1400px;
        --header-actionbar-width: 1400px;
    }
}
*/

@media (max-width: 1250px) {
    :root {
        --header-topbar-width: 95%;
        --header-actionbar-width: 95%;
        --header-topbar-padding-h: 30px;
        --logo-margin-right: 60px;
        --contact-margin-right: 16px;
    }
}