/* ── Layout ──────────────────────────────────────────────────────────────── */
.nexab-hd {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--nexa-global-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}
.nexab-hd--sticky { z-index: 9999; }
/* Компактный sticky-режим при скролле */
.nexab-hd--sticky.nexab-hd--scrolled {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    box-shadow: 0 2px 16px rgba(0,0,0,.1);
    animation: nexab-hd-fadein .18s ease;
}
@keyframes nexab-hd-fadein { from { transform: translateY(-6px); opacity: .7; } to { transform: none; opacity: 1; } }
/* Скрыть nav-strip → одна строка */
.nexab-hd--sticky.nexab-hd--scrolled .nexab-hd__nav-strip { display: none; }
/* Скрыть мобильный поиск в sticky */
.nexab-hd--sticky.nexab-hd--scrolled .nexab-hd__mobile-search { display: none; }
/* Немного компактнее main-bar */
.nexab-hd--sticky.nexab-hd--scrolled .nexab-hd__main-inner { height: 60px; }
/* Показать бургер на всех экранах в sticky для доступа к меню */
.nexab-hd--sticky.nexab-hd--scrolled .nexab-hd__burger { display: flex; }
/* Меню по бургеру в sticky-режиме — горизонтальная полоса внутри fixed-шапки */
.nexab-hd--sticky.nexab-hd--scrolled.nexab-hd--nav-open .nexab-hd__nav-strip {
    display: block;
    background: var(--nx-bg, #fff);
    border-bottom: 1px solid var(--nx-border, #e5e7eb);
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.nexab-hd--sticky.nexab-hd--scrolled.nexab-hd--nav-open .nexab-hd__nav-inner { height: 46px; }

/* ── Main bar ────────────────────────────────────────────────────────────── */
.nexab-hd__main-bar {
    background: var(--nx-bg, #fff);
    border-bottom: 1px solid var(--nx-border, #e5e7eb);
    position: relative;
}
.nexab-hd__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.nexab-hd__main-inner { height: 72px; }

/* ── Logo ────────────────────────────────────────────────────────────────── */
.nexab-hd__logo { text-decoration: none; flex-shrink: 0; }
.nexab-hd__logo img { display: block; max-height: 40px; width: auto; }
.nexab-hd__logo-text {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--nx-heading, #10243d);
}

/* ── Inline search bar ───────────────────────────────────────────────────── */
.nexab-hd__search-wrap {
    flex: 1;
    position: relative;
    min-width: 0;
}
.nexab-hd__search-bar {
    width: 100%;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--nx-border, #e5e7eb);
    border-radius: var(--nx-radius, 10px);
    background: var(--nx-surface, #f7f8fb);
    overflow: hidden;
    transition: border-color .15s;
    box-sizing: border-box;
}
.nexab-hd__search-bar:focus-within { border-color: var(--nx-accent, #0d9488); }
.nexab-hd__s-icon {
    flex-shrink: 0;
    margin: 0 .625rem 0 .875rem;
    color: var(--nx-muted, #6b7280);
}
.nexab-hd__s-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: .625rem 0;
    font-size: .9375rem;
    color: var(--nx-heading, #10243d);
    outline: none;
    min-width: 0;
    font-family: inherit;
}
.nexab-hd__s-input::placeholder { color: var(--nx-muted, #6b7280); }
.nexab-hd__s-btn {
    flex-shrink: 0;
    padding: .625rem 1.25rem;
    background: var(--nx-accent, #0d9488);
    color: #fff;
    border: none;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity .15s;
}
.nexab-hd__s-btn:hover { opacity: .88; }

/* Mobile search bar (always visible on mobile, hidden on desktop where inline bar shows) */
.nexab-hd__mobile-search {
    display: none;
    border-top: 1px solid var(--nx-border, #e5e7eb);
    padding: .625rem 0;
}
.nexab-hd__mobile-search .nexab-hd__inner { height: auto; gap: 0; }
.nexab-hd__search-wrap--mobile { flex: 1; }

/* ── Search suggest dropdown ─────────────────────────────────────────────── */
.nexab-suggest-drop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--nx-border, #e5e7eb);
    border-radius: var(--nx-radius, 10px);
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    z-index: 9100;
    max-height: 420px;
    overflow-y: auto;
}
.nexab-suggest-drop.is-open { display: block; }
.nexab-suggest-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--nx-border, #e5e7eb);
    transition: background .15s;
}
.nexab-suggest-item:last-child { border-bottom: none; }
.nexab-suggest-item:hover { background: var(--nx-surface, #f7f8fb); }
.nexab-suggest-img {
    width: 46px; height: 46px;
    object-fit: cover;
    border-radius: 7px;
    flex-shrink: 0;
    border: 1px solid var(--nx-border, #e5e7eb);
    background: var(--nx-surface, #f7f8fb);
    display: block;
}
.nexab-suggest-img--ph {
    background: var(--nx-surface, #f7f8fb);
    border: 1px dashed var(--nx-border, #e5e7eb);
}
.nexab-suggest-info { flex: 1; min-width: 0; }
.nexab-suggest-name {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--nx-heading, #10243d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nexab-suggest-section {
    display: block;
    font-size: .75rem;
    color: var(--nx-muted, #6b7280);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nexab-suggest-price {
    font-size: .875rem;
    font-weight: 700;
    color: var(--nx-accent, #0d9488);
    white-space: nowrap;
    flex-shrink: 0;
}
.nexab-suggest-empty {
    padding: 1rem;
    text-align: center;
    color: var(--nx-muted, #6b7280);
    font-size: .875rem;
}

/* ── Action icons ────────────────────────────────────────────────────────── */
.nexab-hd__actions {
    display: flex;
    align-items: center;
    gap: .375rem;
    flex-shrink: 0;
}
.nexab-hd__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--nx-heading, #10243d);
    border-radius: var(--nx-radius-sm, 6px);
    position: relative;
    text-decoration: none;
    transition: background .15s, color .15s;
    font-family: inherit;
}
.nexab-hd__action-btn:hover { background: var(--nx-surface, #f7f8fb); color: var(--nx-accent, #0d9488); }
.nexab-hd__auth.is-auth { background: var(--nx-surface, #f7f8fb); }

.nexab-hd__cart-badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 16px; height: 16px;
    border-radius: 8px;
    background: var(--nx-accent, #0d9488);
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
    line-height: 1;
}
.nexab-hd__cart-badge--hidden { display: none; }

/* ── Burger ──────────────────────────────────────────────────────────────── */
.nexab-hd__burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--nx-radius-sm, 6px);
    flex-shrink: 0;
}
.nexab-hd__burger span {
    display: block;
    width: 22px; height: 2px;
    background: var(--nx-heading, #10243d);
    border-radius: 2px;
    transition: .3s;
}

/* ── Nav strip ───────────────────────────────────────────────────────────── */
.nexab-hd__nav-strip {
    background: var(--nx-bg, #fff);
    border-bottom: 1px solid var(--nx-border, #e5e7eb);
}
.nexab-hd__nav-inner {
    height: 46px;
    gap: 0;
}
.nexab-hd__menu {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 0;
    align-items: center;
    height: 100%;
}
.nexab-hd__menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}
.nexab-hd__menu-item > a {
    display: flex;
    align-items: center;
    gap: .25rem;
    padding: 0 1rem;
    height: 100%;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
    color: var(--nx-muted, #6b7280);
    white-space: nowrap;
    transition: color .15s;
    border-bottom: 2px solid transparent;
}
.nexab-hd__menu-item > a:hover { color: var(--nx-heading, #10243d); }
.nexab-hd__menu-item.is-active > a { color: var(--nx-accent, #0d9488); border-bottom-color: var(--nx-accent, #0d9488); }

/* ── Catalog dropdown (shared) ───────────────────────────────────────────── */
.nexab-catalog__arr { font-size:.6em; margin-left:.3em; vertical-align:middle; display:inline-block; transition:transform .2s; }
.nexab-hd__menu-item.has-catalog-drop { position: relative; }
.nexab-hd__menu-item.has-catalog-drop:hover .nexab-catalog__arr { transform: rotate(-180deg); }
.nexab-hd__menu-item.has-catalog-drop::after { content:''; position:absolute; top:100%; left:-20px; right:-20px; height:12px; }
@media (min-width: 769px) {
    .nexab-hd__menu-item.has-catalog-drop > .nexab-catalog-drop { opacity:0; visibility:hidden; transform:translateY(-6px); transition:opacity .18s,transform .18s,visibility .18s; pointer-events:none; }
    .nexab-hd__menu-item.has-catalog-drop:hover > .nexab-catalog-drop { opacity:1; visibility:visible; transform:translateY(0); pointer-events:auto; }
}
.nexab-catalog-drop { position:absolute; top:100%; left:0; z-index:500; background:#fff; border:1px solid rgba(0,0,0,.09); border-radius:10px; box-shadow:0 12px 40px rgba(0,0,0,.13); }
.nexab-catalog-drop--simple { min-width:220px; padding:.5rem 0; }
.nexab-catalog-drop--mega { left:50%; transform:translateX(-50%) translateY(-6px); min-width:640px; max-width:960px; padding:1.5rem 2rem; }
.nexab-hd__menu-item.has-catalog-drop:hover .nexab-catalog-drop--mega { transform:translateX(-50%) translateY(0); }
.nexab-catalog-drop__list { list-style:none; margin:0; padding:0; }
.nexab-catalog-drop__list a { display:block; padding:.55rem 1.25rem; font-size:.875rem; color:#333; text-decoration:none; white-space:nowrap; transition:background .15s,color .15s; }
.nexab-catalog-drop__list a:hover { background:#f5f7fa; color:var(--nx-accent,#0d9488); }
.nexab-catalog-drop__list li.has-sub { position:relative; }
.nexab-catalog-drop__list li.has-sub > a { padding-right:2.25rem; }
.nexab-catalog-drop__list li.has-sub > a::after { content:'›'; position:absolute; right:.85rem; top:50%; transform:translateY(-50%); opacity:.45; font-size:1.1em; }
.nexab-catalog-sub__list { position:absolute; top:-6px; left:calc(100% + 1px); min-width:200px; background:#fff; border:1px solid rgba(0,0,0,.09); border-radius:10px; box-shadow:0 12px 40px rgba(0,0,0,.13); list-style:none; padding:.5rem 0; margin:0; opacity:0; visibility:hidden; transform:translateX(-4px); transition:opacity .15s,transform .15s,visibility .15s; pointer-events:none; z-index:600; }
.nexab-catalog-sub__list::before { content:''; position:absolute; top:0; left:-10px; width:12px; height:100%; }
.nexab-catalog-drop__list li.has-sub:hover > .nexab-catalog-sub__list { opacity:1; visibility:visible; transform:translateX(0); pointer-events:auto; }
.nexab-catalog-sub__list a { display:block; padding:.55rem 1.25rem; font-size:.875rem; color:#333; text-decoration:none; white-space:nowrap; transition:background .15s,color .15s; }
.nexab-catalog-sub__list a:hover { background:#f5f7fa; color:var(--nx-accent,#0d9488); }
.nexab-catalog-mega__inner { display:flex; gap:2rem; flex-wrap:wrap; }
.nexab-catalog-mega__col { flex:1; min-width:130px; }
.nexab-catalog-mega__title { display:block; font-size:.75rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:#0d1117; text-decoration:none; padding-bottom:.5rem; margin-bottom:.5rem; border-bottom:1px solid #e5e7eb; }
.nexab-catalog-mega__title:hover { color:var(--nx-accent,#0d9488); }
.nexab-catalog-mega__sub { list-style:none; margin:0; padding:0; }
.nexab-catalog-mega__sub a { display:block; padding:.3rem 0; font-size:.85rem; color:#555; text-decoration:none; transition:color .15s; }
.nexab-catalog-mega__sub a:hover { color:var(--nx-accent,#0d9488); }

/* ── Auth modal (shared) ─────────────────────────────────────────────────── */
.nexab-auth-modal { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; visibility:hidden; pointer-events:none; }
.nexab-auth-modal.is-open { visibility:visible; pointer-events:auto; }
.nexab-auth-modal__backdrop { position:absolute; inset:0; background:rgba(0,0,0,.45); opacity:0; transition:opacity .22s; }
.nexab-auth-modal.is-open .nexab-auth-modal__backdrop { opacity:1; }
.nexab-auth-modal__box { position:relative; background:#fff; border-radius:14px; padding:32px 28px 28px; width:100%; max-width:400px; margin:16px; box-shadow:0 24px 64px rgba(0,0,0,.18); transform:translateY(18px); transition:transform .22s,opacity .22s; opacity:0; }
.nexab-auth-modal.is-open .nexab-auth-modal__box { transform:none; opacity:1; }
.nexab-auth-modal__close { position:absolute; top:12px; right:14px; background:none; border:none; font-size:1.4rem; color:#bbb; cursor:pointer; padding:4px 8px; line-height:1; }
.nexab-auth-modal__close:hover { color:#555; }
.nexab-auth-modal__tabs { display:flex; border-bottom:2px solid #e9ecef; margin-bottom:20px; }
.nexab-auth-modal__tab { padding:8px 18px; border:none; background:none; font-size:.9rem; font-weight:600; color:#888; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; }
.nexab-auth-modal__tab.is-active { color:var(--nx-accent,#0d9488); border-bottom-color:var(--nx-accent,#0d9488); }
.nexab-auth-modal__form { display:none; }
.nexab-auth-modal__form.is-active { display:block; }
.nexab-auth-modal__field { display:flex; flex-direction:column; gap:4px; margin-bottom:12px; }
.nexab-auth-modal__field label { font-size:.8rem; font-weight:600; color:#555; }
.nexab-auth-modal__field input { padding:10px 12px; border:1px solid #ddd; border-radius:7px; font-size:.9rem; transition:border-color .15s; }
.nexab-auth-modal__field input:focus { outline:none; border-color:var(--nx-accent,#0d9488); }
.nexab-auth-modal__btn { display:block; width:100%; padding:11px; margin-top:6px; background:var(--nx-accent,#0d9488); color:#fff; border:none; border-radius:7px; font-size:.95rem; font-weight:700; cursor:pointer; transition:opacity .15s; }
.nexab-auth-modal__btn:hover { opacity:.88; }
.nexab-auth-modal__btn:disabled { opacity:.5; cursor:not-allowed; }
.nexab-auth-modal__error { color:#e53e3e; font-size:.8rem; margin-top:6px; min-height:16px; }
.nexab-auth-modal__forgot { display:inline-block; margin-top:10px; font-size:.8rem; color:#888; text-decoration:none; background:none; border:none; cursor:pointer; }
.nexab-auth-modal__forgot:hover { color:var(--nx-accent,#0d9488); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
    .nexab-hd__search-wrap:not(.nexab-hd__search-wrap--mobile) { display: none; }
    .nexab-suggest-wrap:not(.nexab-hd__search-wrap--mobile) { display: none; }
    .nexab-hd__search-bar:not(.nexab-hd__search-bar--mobile) { display: none; }
    .nexab-hd__mobile-search { display: block; }
}
@media (max-width: 767px) {
    .nexab-hd__burger { display: flex; }
    .nexab-hd__nav-strip { display: none; }
    .nexab-hd--nav-open .nexab-hd__nav-strip {
        display: block;
        position: absolute;
        left: 0; right: 0;
        background: var(--nx-bg, #fff);
        z-index: 100;
        box-shadow: 0 8px 24px rgba(0,0,0,.1);
    }
    .nexab-hd--nav-open .nexab-hd__nav-inner { height: auto; padding-top: .5rem; padding-bottom: .75rem; }
    .nexab-hd--nav-open .nexab-hd__menu { flex-direction: column; align-items: flex-start; gap: 0; height: auto; }
    .nexab-hd--nav-open .nexab-hd__menu-item { height: auto; width: 100%; }
    .nexab-hd--nav-open .nexab-hd__menu-item > a { height: auto; padding: .5rem 0; border-bottom: none; font-size: .9375rem; }
    .nexab-hd { position: relative; }
    /* mobile catalog dropdown */
    .nexab-catalog-drop { display:none; position:static; box-shadow:none; border:none; border-radius:0; padding:0 0 .25rem .75rem; border-left:2px solid #e5e7eb; margin:.2rem 0 .4rem; }
    .nexab-hd__menu-item.has-catalog-drop:hover .nexab-catalog-drop { display:block; opacity:1; visibility:visible; transform:none; pointer-events:auto; }
    .nexab-catalog-drop--mega { max-width:none; padding:0 0 .25rem .75rem; }
    .nexab-catalog-mega__inner { flex-direction:column; gap:.5rem; }
    .nexab-catalog-sub__list { position:static; transform:none !important; opacity:1; visibility:visible; box-shadow:none; border:none; border-radius:0; border-left:2px solid #e5e7eb; margin:.15rem 0 .25rem .75rem; pointer-events:auto; }
    .nexab-catalog-sub__list::before { display:none; }
}
