/* ============================================================================
   BB HEADER — стили нового header-компонента
   Префиксы:  .bb-mm-*   →  desktop mega-menu
              .bb-dr-*   →  mobile drawer
              .bb-nav-*  →  bottom navigation bar
   Нет конфликтов с:
      Porto   (.mega-menu, .sidebar-menu, #header, .header-*)
      Groovy  (.gm-*, .hamburger, .gm-navbar-*)
   ============================================================================ */

/* ════════════════════════════════════════════════════════════════════════════
   СБРОС / ПЕРЕМЕННЫЕ
   ════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Mega-menu */
    --bb-mm-bg: #fff;
    --bb-mm-shadow: 0 6px 32px rgba(0, 0, 0, 0.1);
    --bb-mm-border: #e8e8e8;
    --bb-mm-radius: 0 0 12px 12px;
    --bb-mm-col-l0-w: 220px;
    --bb-mm-z: 8990; /* ниже хедера (--bb-hdr-z будет 9000) */
    --bb-mm-dur: 0.22s;

    /* L0 item */
    --bb-mm-l0-hover-bg: #f5f5f5;
    --bb-mm-l0-active-bg: #111;
    --bb-mm-l0-active-c: #fff;
    --bb-mm-l0-h: 46px;

    /* L1 item */
    --bb-mm-l1-hover-bg: #f9f9f9;
    --bb-mm-l1-active-bg: #111;
    --bb-mm-l1-active-c: #fff;

    /* L2 grid */
    --bb-mm-l2-cols: 3;
    --bb-mm-l2-gap: 10px;

    /* Badge */
    --bb-badge-bg: #e53e3e;
    --bb-badge-c: #fff;

    /* Drawer */
    --bb-dr-w: 320px;
    --bb-dr-bg: #111;
    --bb-dr-c: #fff;
    --bb-dr-border: rgba(255, 255, 255, 0.08);
    --bb-dr-header-h: 56px;
    --bb-dr-item-h: 52px;
    --bb-dr-dur: 0.28s;
    --bb-dr-z: 99999;
    --bb-dr-overlay-c: rgba(0, 0, 0, 0.55);

    /* Trigger / Burger */
    --bb-trigger-c: inherit;
}

/* ════════════════════════════════════════════════════════════════════════════
   TRIGGER — кнопка «Выбери свою технику»
   ════════════════════════════════════════════════════════════════════════════ */

.bb-mm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 40px;
    background: none;
    border: 2px solid currentColor;
    border-radius: 6px;
    cursor: pointer;
    font-family: "als-hauss", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bb-trigger-c);
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
    white-space: nowrap;
    user-select: none;
}

.bb-mm-trigger:hover,
.bb-mm-trigger[aria-expanded="true"] {
    background: #111;
    color: #fff;
    border-color: #111;
}

.bb-mm-trigger__icon svg {
    width: 18px;
    height: 12px;
    display: block;
}

.bb-mm-trigger__chevron svg {
    width: 10px;
    height: 6px;
    display: block;
    transition: transform var(--bb-mm-dur);
}

.bb-mm-trigger[aria-expanded="true"] .bb-mm-trigger__chevron svg {
    transform: rotate(180deg);
}

/* ════════════════════════════════════════════════════════════════════════════
   MEGA-MENU PANEL
   ════════════════════════════════════════════════════════════════════════════ */

/* Overlay (затемнение за панелью) */
/* Overlay находится снаружи панели (в DOM — до неё),
   z-index ниже #bb-header чтобы не блокировать клики по шапке */
/* .bb-mm-overlay — удалён по запросу */
.bb-mm-overlay {
    display: none !important;
}

/* Панель: скрыта по умолчанию */
#bb-mega-menu-panel {
    position: fixed;
    top: 0; /* JS выставит реальный top = высота header */
    left: 0;
    right: 0;
    z-index: var(--bb-mm-z);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity var(--bb-mm-dur),
        transform var(--bb-mm-dur);
    /* display:none управляется через aria-hidden + JS-класс, а не hidden-атрибут */
}

#bb-mega-menu-panel[aria-hidden="false"],
#bb-mega-menu-panel.bb-mm-panel--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Overlay активируется когда панель открыта */

/* Body панели */
.bb-mm-body {
    background: var(--bb-mm-bg);
    border-bottom: 1px solid var(--bb-mm-border);
    /* box-shadow убран — не нужна тень поверх хедера */
    border-radius: var(--bb-mm-radius);
    overflow: hidden;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Container */
.bb-mm-container {
    display: flex;
    max-width: 1504px;
    margin: 0 auto;
    padding: 0 50px;
    min-height: 400px;
}

/* ── Колонки ────────────────────────────────────────────── */

.bb-mm-col {
    flex-shrink: 0;
}

/* L0: список типов техники */
.bb-mm-col--l0 {
    width: var(--bb-mm-col-l0-w);
    flex-shrink: 0;
    background: #fafafa;
    border-right: 1px solid var(--bb-mm-border);
    padding: 8px 0;
    overflow-y: auto;
}

/* Правая колонка: занимает всё оставшееся место */
.bb-mm-col--right {
    flex: 1 1 0;
    min-width: 0;
    overflow-y: auto;
    max-height: calc(100vh - var(--bb-hdr-h, 104px) - 40px);
}

/* Правая панель: по одной на каждый L0-пункт */
.bb-mm-right-panel {
    display: none;
}

.bb-mm-right-panel--active {
    display: block;
}

/* L0 без вложений */
.bb-mm-no-children {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    padding: 40px;
}

.bb-mm-view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    padding: 12px 24px;
    border: 2px solid #111;
    border-radius: 8px;
    transition:
        background 0.15s,
        color 0.15s;
}

.bb-mm-view-all-link:hover {
    background: #111;
    color: #fff;
}

/* Сетка брендов */
/* Сетка брендов: максимум 4 колонки, остальные переносятся ниже */
.bb-mm-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: start;
    gap: 0;
}

.bb-mm-brand-section {
    padding: 16px 20px 20px;
    border-right: 1px solid #f0f0f0;
    min-width: 0; /* предотвращает переполнение в grid */
}

/* Убираем правую границу у последнего в каждой строке */
.bb-mm-brand-section:nth-child(4n) {
    border-right: none;
}

.bb-mm-brand-section:last-child {
    border-right: none;
}

/* Бренд без моделей: без черной линии под заголовком */
.bb-mm-brand-section--leaf .bb-mm-brand-heading {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Заголовок бренда (L1) */
.bb-mm-brand-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: "als-hauss", sans-serif !important;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 2px solid #111;
    transition: color 0.15s;
}

.bb-mm-brand-heading:hover {
    color: #444;
}

/* Логотип бренда (если есть изображение) */
.bb-mm-brand-logo {
    display: block;
    max-height: 24px;
    width: auto;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.8;
    transition:
        filter 0.15s,
        opacity 0.15s;
}

.bb-mm-brand-heading:hover .bb-mm-brand-logo {
    filter: grayscale(0);
    opacity: 1;
}

/* Контейнер моделей бренда */
.bb-mm-brand-models {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Группа моделей (L2 с детьми) */
.bb-mm-model-group {
    margin-bottom: 8px;
}

/* Подзаголовок группы (L2 с детьми) */
.bb-mm-model-group-title {
    display: block;
    font-size: 10px;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    text-decoration: none;
    padding: 4px 4px 4px 0;
    margin-bottom: 2px;
    transition: color 0.15s;
}

.bb-mm-model-group-title:hover {
    color: #555;
}

/* Ссылка на модель (L2 без детей или L3) */
.bb-mm-model-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    text-decoration: none;
    transition:
        background 0.1s,
        color 0.1s;
    line-height: 1.3;
}

.bb-mm-model-link:hover {
    background: #f5f5f5;
    color: #111;
}

/* Sub-модель чуть меньше */
.bb-mm-model-link--sub {
    font-size: 12px;
    padding: 3px 6px 3px 12px; /* отступ слева = вложенность */
    color: #444;
}

/* Миниатюра модели */
.bb-mm-model-thumb {
    flex-shrink: 0;
    width: 52px;
    height: 34px;
    object-fit: cover;
    border-radius: 3px;
    background: #f0f0f0;
    display: block;
    transition: opacity 0.2s;
}

.bb-mm-model-thumb.bb-mm-lazy {
    opacity: 0;
}

.bb-mm-model-thumb.bb-mm-loaded {
    opacity: 1;
}

/* ── L0 items ───────────────────────────────────────────── */

.bb-mm-l0-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bb-mm-l0-item {
    margin: 0;
}

.bb-mm-l0-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: var(--bb-mm-l0-h);
    color: var(--bb-item-color, #222);
    font-size: 13px;
    font-family: "als-hauss", sans-serif !important;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background 0.12s,
        color 0.12s;
    position: relative;
    user-select: none;
}

.bb-mm-l0-link:hover {
    background: var(--bb-mm-l0-hover-bg);
}

.bb-mm-l0-item--active .bb-mm-l0-link,
.bb-mm-l0-link[aria-expanded="true"] {
    background: var(--bb-mm-l0-active-bg);
    color: var(--bb-mm-l0-active-c) !important;
}

.bb-mm-l0-icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.bb-mm-l0-label {
    flex: 1;
}

.bb-mm-l0-chevron {
    flex-shrink: 0;
    opacity: 0.4;
}

.bb-mm-l0-chevron svg {
    width: 6px;
    height: 10px;
    display: block;
}

.bb-mm-l0-item--active .bb-mm-l0-chevron,
.bb-mm-l0-link[aria-expanded="true"] .bb-mm-l0-chevron {
    opacity: 0.8;
}

/* ── L1 items (бренды) ──────────────────────────────────── */

/* Старые L1-panel стили оставлены для обратной совместимости */
.bb-mm-l1-panel {
    display: none;
}
.bb-mm-l1-panel--active {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bb-mm-l1-item {
    position: relative;
}

.bb-mm-l1-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--bb-item-color, #333);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 4px;
    margin: 0 6px;
}

.bb-mm-l1-link:hover,
.bb-mm-l1-item--active .bb-mm-l1-link {
    background: var(--bb-mm-l1-hover-bg);
}

.bb-mm-l1-item--active .bb-mm-l1-link {
    background: #111;
    color: #fff !important;
}

.bb-mm-l1-img-wrap {
    flex-shrink: 0;
    width: 56px;
    height: 36px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-mm-l1-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bb-mm-l1-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.bb-mm-l1-label {
    flex: 1;
    font-weight: 600;
    font-family: "als-hauss", sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 12px;
}

.bb-mm-l1-chevron {
    flex-shrink: 0;
    opacity: 0.4;
}

.bb-mm-l1-chevron svg {
    width: 5px;
    height: 9px;
    display: block;
}

.bb-mm-l1-item--active .bb-mm-l1-chevron {
    opacity: 0.9;
}

/* ── L2 items (модели — сетка) ──────────────────────────── */

/* Старые L2-panel стили оставлены для обратной совместимости */
.bb-mm-l2-panel {
    display: none;
}
.bb-mm-l2-panel--active {
    display: block;
}

.bb-mm-l2-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px 10px;
    text-decoration: none;
    color: var(--bb-item-color, #222);
    border-radius: 8px;
    transition:
        background 0.12s,
        transform 0.12s;
    cursor: pointer;
}

.bb-mm-l2-item:hover {
    background: #f5f5f5;
    transform: translateY(-1px);
}

.bb-mm-l2-img-wrap {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-mm-l2-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

/* lazy-заглушка не занимает высоту */
.bb-mm-l2-img.bb-mm-lazy:not([src*="data:"]) {
    opacity: 0;
}
.bb-mm-l2-img.bb-mm-loaded {
    opacity: 1;
}

.bb-mm-l2-icon {
    font-size: 28px;
    line-height: 1;
}

.bb-mm-l2-label {
    font-size: 12px;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.3;
}

/* L3 подсписок (редко, только если есть) */
.bb-mm-l3-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
    justify-content: center;
}

.bb-mm-l3-link {
    font-size: 10px;
    color: #888;
    text-decoration: none;
    white-space: nowrap;
}

.bb-mm-l3-link:hover {
    color: #111;
    text-decoration: underline;
}

/* Нижняя ссылка «Все модели» */
.bb-mm-l2-footer {
    margin-top: 14px;
    text-align: right;
}

.bb-mm-l2-all-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    transition:
        color 0.15s,
        border-color 0.15s;
}

.bb-mm-l2-all-link:hover {
    color: #111;
    border-color: #111;
}

/* ── Бейдж (используется везде) ─────────────────────────── */

.bb-mm-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bb-badge-bg);
    color: var(--bb-badge-c);
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE DRAWER — кнопка-бургер
   ════════════════════════════════════════════════════════════════════════════ */

.bb-dr-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    flex-shrink: 0;
}

.bb-dr-burger__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition:
        transform var(--bb-dr-dur),
        opacity var(--bb-dr-dur);
}

/* Анимация бургера → крестик (добавляется JS-классом .bb-dr-burger--open) */
.bb-dr-burger--open .bb-dr-burger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.bb-dr-burger--open .bb-dr-burger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.bb-dr-burger--open .bb-dr-burger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE DRAWER — OVERLAY
   ════════════════════════════════════════════════════════════════════════════ */

#bb-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--bb-dr-z) - 1);
    background: var(--bb-dr-overlay-c);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--bb-dr-dur);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#bb-drawer-overlay.bb-dr-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE DRAWER — ASIDE
   ════════════════════════════════════════════════════════════════════════════ */

#bb-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--bb-dr-w);
    max-width: 90vw;
    z-index: var(--bb-dr-z);
    background: var(--bb-dr-bg);
    color: var(--bb-dr-c);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--bb-dr-dur) cubic-bezier(0.4, 0, 0.2, 1);
    overscroll-behavior: contain;
    /* Всегда в DOM, видимость через transform */
    visibility: hidden;
}

#bb-drawer[aria-hidden="false"],
#bb-drawer.bb-drawer--open {
    transform: translateX(0);
    visibility: visible;
}

/* Шапка */
.bb-dr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: var(--bb-dr-header-h);
    border-bottom: 1px solid var(--bb-dr-border);
    flex-shrink: 0;
}

.bb-dr-logo img {
    max-height: 36px;
    width: auto;
    display: block;
}

.bb-dr-logo-text {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    font-family: "als-hauss", sans-serif;
}

.bb-dr-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition:
        background 0.15s,
        color 0.15s;
    flex-shrink: 0;
}

.bb-dr-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.bb-dr-close svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* ── Панели (слайдер) ───────────────────────────────────── */

.bb-dr-panels {
    flex: 1 1 0;
    overflow: hidden;
    position: relative;
    display: flex;
}

.bb-dr-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    transform: translateX(100%);
    transition: transform var(--bb-dr-dur) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    /* hidden-атрибут управляется JS */
}

.bb-dr-panel--active {
    transform: translateX(0);
}

/* Уходит влево когда дочерняя панель активна */
.bb-dr-panel--exit {
    transform: translateX(-30%);
}

/* ── Заголовок панели (назад + title) ───────────────────── */

.bb-dr-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--bb-dr-border);
    flex-shrink: 0;
}

.bb-dr-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    transition:
        background 0.15s,
        color 0.15s;
    flex-shrink: 0;
}

.bb-dr-back:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.bb-dr-back svg {
    width: 8px;
    height: 14px;
    display: block;
}

.bb-dr-panel-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    font-family: "als-hauss", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* «Все товары раздела» */
.bb-dr-panel-all {
    padding: 8px 16px 4px;
    flex-shrink: 0;
}

.bb-dr-all-link {
    display: inline-block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition:
        color 0.15s,
        border-color 0.15s;
}

.bb-dr-all-link:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

/* ── Список пунктов ─────────────────────────────────────── */

.bb-dr-list {
    list-style: none;
    margin: 0;
    padding: 4px 0 16px;
    flex: 1 1 0;
}

.bb-dr-item {
    margin: 0;
}

/* Строка с ссылкой + кнопкой-стрелкой */
.bb-dr-item-row {
    display: flex;
    align-items: stretch;
}

.bb-dr-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    min-height: var(--bb-dr-item-h);
    color: var(--bb-item-color, rgba(255, 255, 255, 0.9));
    font-size: 14px;
    text-decoration: none;
    transition: background 0.12s;
    border-bottom: 1px solid var(--bb-dr-border);
}

.bb-dr-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.bb-dr-link--leaf {
    padding-right: 20px;
}

/* Картинка в ссылке */
.bb-dr-img-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 34px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-dr-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}

.bb-dr-img.bb-dr-lazy {
    opacity: 0;
}

.bb-dr-img.bb-dr-loaded {
    opacity: 1;
}

.bb-dr-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.bb-dr-label {
    flex: 1;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-size: 13px;
}

/* Бейдж в drawer */
.bb-dr-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--bb-badge-bg);
    color: var(--bb-badge-c);
    flex-shrink: 0;
}

/* Кнопка-стрелка «открыть подменю» */
.bb-dr-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--bb-dr-border);
    border-left: 1px solid var(--bb-dr-border);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition:
        background 0.12s,
        color 0.12s;
}

.bb-dr-arrow:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.bb-dr-arrow svg {
    width: 8px;
    height: 14px;
    display: block;
}

/* ── Нижняя зона: мессенджеры ───────────────────────────── */

.bb-dr-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--bb-dr-border);
    padding: 14px 16px;
}

.bb-dr-messengers {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bb-dr-msg-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
    margin-right: 4px;
}

.bb-dr-msg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition:
        background 0.15s,
        transform 0.15s;
    flex-shrink: 0;
}

.bb-dr-msg-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: scale(1.1);
}

.bb-dr-msg-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    display: block;
}

.bb-dr-msg-btn img {
    display: block;
    filter: brightness(0) invert(1);
}

.bb-dr-msg-wa {
    background: #25d366 !important;
}
.bb-dr-msg-wa:hover {
    background: #1da851 !important;
}
.bb-dr-msg-tg {
    background: #229ed9 !important;
}
.bb-dr-msg-tg:hover {
    background: #1a8bc2 !important;
}
.bb-dr-msg-max {
    background: rgba(255, 255, 255, 0.12) !important;
}
.bb-dr-msg-vk {
    background: #0077ff !important;
}
.bb-dr-msg-vk:hover {
    background: #0066d6 !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   BOTTOM NAV BAR
   ════════════════════════════════════════════════════════════════════════════ */

.bb-nav-bar {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bb-nav-bar::-webkit-scrollbar {
    display: none;
}

.bb-nav-item {
    position: relative;
    flex-shrink: 0;
}

.bb-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    height: 36px;
    font-size: 12px;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--bb-item-color, inherit);
    white-space: nowrap;
    transition: color 0.15s;
    border-radius: 4px;
}

.bb-nav-link:hover {
    text-decoration: underline;
}

/* Dropdown для пункта «Помощь и информация» */
.bb-nav-item--dropdown:hover .bb-nav-dropdown,
.bb-nav-item--dropdown:focus-within .bb-nav-dropdown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bb-nav-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 6px 0;
    z-index: 9980;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 0.18s,
        transform 0.18s;
}

.bb-nav-dropdown-link {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: background 0.1s;
}

.bb-nav-dropdown-link:hover {
    background: #f5f5f5;
}

/* Бейдж в нижней навигации */
.bb-nav-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    border-radius: 99px;
    font-size: 9px;
    font-weight: 700;
    background: var(--bb-badge-bg);
    color: var(--bb-badge-c);
}

/* Мессенджеры в нижней полосе (справа) */
.bb-nav-messengers {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding-left: 14px;
    flex-shrink: 0;
}

.bb-nav-msg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition:
        background 0.15s,
        transform 0.15s;
}

.bb-nav-msg-btn:hover {
    background: rgba(0, 0, 0, 0.12);
    transform: scale(1.1);
}

.bb-nav-msg-btn svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: #333;
}

.bb-nav-msg-btn img {
    width: 14px;
    height: 14px;
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════════
   BODY LOCK (когда меню открыто)
   ════════════════════════════════════════════════════════════════════════════ */

body.bb-menu-open,
body.bb-drawer-open {
    overflow: hidden;
}

/* На десктопе блокируем скролл только под мега-меню */
@media (min-width: 992px) {
    body.bb-menu-open {
        overflow: hidden;
        padding-right: var(--bb-scrollbar-w, 0px); /* компенсируем скроллбар */
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */

/* Мега-меню только на десктопе */
@media (max-width: 991px) {
    #bb-mega-menu-panel,
    .bb-mm-trigger {
        display: none !important;
    }
}

/* Drawer только на мобиле */
@media (min-width: 992px) {
    #bb-drawer,
    #bb-drawer-overlay,
    .bb-dr-burger {
        display: none !important;
    }
}

/* Адаптация L2 сетки */
@media (max-width: 1100px) {
    :root {
        --bb-mm-col-l0-w: 190px;
    }
    .bb-mm-brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bb-mm-brand-section:nth-child(4n) {
        border-right: 1px solid #f0f0f0;
    }
    .bb-mm-brand-section:nth-child(3n) {
        border-right: none;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   ДОСТУПНОСТЬ (reduced-motion)
   ════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    #bb-mega-menu-panel,
    #bb-drawer,
    #bb-drawer-overlay,
    .bb-mm-trigger__chevron svg,
    .bb-dr-panel,
    .bb-dr-img,
    .bb-mm-l2-img {
        transition: none !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   PORTO HEADER-WRAPPER — нейтрализация
   Убираем всё, что Porto добавляет к .header-wrapper, чтобы
   наш #bb-header с position:fixed работал корректно.
   ════════════════════════════════════════════════════════════════════════════ */

.header-wrapper,
.header-wrapper.fixed-header,
.header-wrapper.header-reveal,
.header-wrapper.wide {
    position: static !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: none !important;
    transform: none !important;
    z-index: auto !important;
}

/* Porto иногда добавляет margin-top к .page-wrapper под fixed header */
.page-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   #BB-HEADER — базовый layout (фиксированный, полная ширина)
   ════════════════════════════════════════════════════════════════════════════ */

:root {
    --bb-hdr-main-h: 68px; /* высота главной строки */
    --bb-hdr-nav-h: 36px; /* высота нижней nav-полосы */
    --bb-hdr-h: 104px; /* суммарная высота (обновляется JS) */
    --bb-hdr-bg: #fff;
    --bb-hdr-border: #ebebeb;
    --bb-hdr-shadow: none; /* тень хедера отключена */
    --bb-hdr-z: 9000; /* ВЫШЕ mega-menu панели (8990) */
    --bb-hdr-dur: 0.3s;
    --bb-hdr-nav-dur: 0.25s; /* скорость анимации nav */
}

#bb-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--bb-hdr-z);
    background: #fff; /* всегда белый, без blur */
    padding-bottom: 6px; /* небольшой отступ снизу */

    /* Только transform */
    transition: transform var(--bb-hdr-dur) cubic-bezier(0.4, 0, 0.2, 1);

    /* GPU-ускорение */
    will-change: transform;
}

/* WP Admin Bar offset */
html.admin-bar #bb-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    html.admin-bar #bb-header {
        top: 46px;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   СОСТОЯНИЯ: scrolled / hidden
   ════════════════════════════════════════════════════════════════════════════ */

/* При прокрутке фон и тень не меняются — хедер всегда белый */

/* Скрыт при прокрутке вниз */
#bb-header.bb-header--hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

/* Мега-меню открыто → всегда видим */
#bb-header.bb-header--mega-open {
    transform: translateY(0) !important;
}

/* Анимация header при загрузке страницы отключена —
   при каждом переходе между страницами раздражает */

/* ════════════════════════════════════════════════════════════════════════════
   SPACER — компенсирует position:fixed
   Высота = высота #bb-header, обновляется через JS
   ════════════════════════════════════════════════════════════════════════════ */

#bb-hdr-spacer {
    display: block;
    width: 100%;
    height: var(--bb-hdr-h, 104px);
}

/* scroll-padding-top чтобы якоря не перекрывались хедером */
html {
    scroll-padding-top: var(--bb-hdr-h, 104px);
}

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT — главная строка
   ════════════════════════════════════════════════════════════════════════════ */

.bb-hdr-main {
    height: var(--bb-hdr-main-h);
    position: relative; /* нужно для абсолютно-центрированного логотипа */
}

.bb-hdr-container {
    max-width: 1504px;
    margin: 0 auto;
    padding: 0 50px;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

/* ── Колонки ── */

.bb-hdr-col {
    display: flex;
    align-items: center;
}

.bb-hdr-left {
    gap: 10px;
    flex: 0 0 auto;
    z-index: 2;
}

/* Логотип: строго по центру через absolute */
.bb-hdr-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: auto;
}

.bb-hdr-right {
    gap: 10px;
    flex: 0 0 auto;
    margin-left: auto;
    z-index: 2;
}

/* ── Логотип ── */

.bb-hdr-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.bb-hdr-logo-img {
    height: 42px;
    width: auto;
    display: block;
    max-width: 200px;
    object-fit: contain;
    transition: opacity 0.2s;
}

.bb-hdr-logo-link:hover .bb-hdr-logo-img {
    opacity: 0.85;
}

.bb-hdr-logo-text {
    font-family: "als-hauss", sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
}

/* ── Поиск ── */

/* .bb-hdr-search-wrap — ширина определяется содержимым FiboSearch */

/* ════════════════════════════════════════════════════════════════════════════
   LAYOUT — нижняя nav-полоса
   ════════════════════════════════════════════════════════════════════════════ */

/* Nav-полоса: анимируется при скролле */
.bb-hdr-nav {
    height: var(--bb-hdr-nav-h);
    /* border убран по запросу */
    background: #fff;
    overflow: hidden;
    transition:
        max-height var(--bb-hdr-nav-dur) ease,
        opacity var(--bb-hdr-nav-dur) ease,
        visibility var(--bb-hdr-nav-dur) ease;
    max-height: var(--bb-hdr-nav-h);
    opacity: 1;
    visibility: visible;
}

/* Скрытое состояние nav (при прокрутке вниз) */
#bb-header.bb-header--nav-hidden .bb-hdr-nav {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.bb-hdr-nav .bb-hdr-container {
    height: var(--bb-hdr-nav-h);
    padding: 0 50px;
}

/* ════════════════════════════════════════════════════════════════════════════
   ВИДИМОСТЬ ПО BREAKPOINT
   ════════════════════════════════════════════════════════════════════════════ */

/* Desktop-only элементы скрыты на мобиле */
@media (max-width: 991px) {
    .bb-hdr-desktop-only {
        display: none !important;
    }
    .bb-hdr-nav {
        display: none !important;
    }

    .bb-hdr-mobile-only {
        display: flex !important;
    }

    /* Мобиль: logo по центру через flex */
    .bb-hdr-center {
        position: static;
        transform: none;
        flex: 1;
        justify-content: center;
        z-index: 1;
    }

    :root {
        --bb-hdr-h: 68px;
        --bb-hdr-main-h: 68px;
    }

    /* Лого чуть меньше */
    .bb-hdr-logo-img {
        height: 36px;
    }
}

/* Mobile-only элементы скрыты на десктопе */
@media (min-width: 992px) {
    .bb-hdr-mobile-only {
        display: none !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   MEGA-MENU PANEL — корректируется top при scrolled/hidden
   ════════════════════════════════════════════════════════════════════════════ */

/* Мега-меню прикреплено к нижнему краю #bb-header */
/* #bb-mega-menu-panel top устанавливается через JS:
   panel.style.top = header.getBoundingClientRect().bottom + 'px' */

/* ════════════════════════════════════════════════════════════════════════════
   МЕГАМЕНЮ TRIGGER — стиль в контексте нового header
   ════════════════════════════════════════════════════════════════════════════ */

.bb-hdr-left .bb-mm-trigger {
    /* Цвет унаследован из хедера (наследуется color) */
    --bb-trigger-c: #111;
}

#bb-header.bb-header--scrolled .bb-mm-trigger {
    --bb-trigger-c: #111;
}

/* ════════════════════════════════════════════════════════════════════════════
   WISHLIST + CART в хедере — выравнивание
   ════════════════════════════════════════════════════════════════════════════ */

.bb-hdr-right .bb-wl-header-wrap,
.bb-hdr-right .bb-cart-header-wrap {
    display: flex;
    align-items: center;
}

/* Небольшой разделитель между search и wl/cart на десктопе */
.bb-hdr-right .bb-hdr-search-wrap + .bb-wl-header-wrap {
    border-left: 1px solid var(--bb-hdr-border);
    padding-left: 10px;
    margin-left: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   REDUCED MOTION (дополнение к блоку выше)
   ════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    #bb-header {
        transition: none !important;
    }
    #bb-hdr-spacer {
        transition: none !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════════
   MEGA-MENU IMAGE POPUP
   Всплывающий превью с крупным изображением и тикером моделей.
   Все классы: bb-mm-popup-*
   ════════════════════════════════════════════════════════════════════════════ */

#bb-mm-popup {
    position: fixed;
    z-index: calc(var(--bb-mm-z, 8990) + 100);
    width: 240px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    padding: 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px) scale(0.97);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
    overflow: hidden;
}

#bb-mm-popup.bb-mm-popup--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.bb-mm-popup-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 8px;
    background: #f0f0f0;
}

.bb-mm-popup-title {
    font-family: "als-hauss", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Тикер моделей: горизонтальный wrap из пилюль */
.bb-mm-popup-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.bb-mm-popup-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: #f5f5f5;
    border-radius: 99px;
    font-size: 10px;
    font-family: "als-hauss", sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #555;
    white-space: nowrap;
    line-height: 1.4;
}

/* Разделитель между картинкой и пилюлями — тонкая линия */
.bb-mm-popup-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 8px -12px;
}
