/* ==========================================================================
   NBC Header v2.0 — Яровой Кофе (cream / navy / gold)
   ========================================================================== */

:root {
    --h-navy:       #1B2356;
    --h-navy-deep:  #0E1433;
    --h-gold:       #C49953;
    --h-gold-light: #D5B480;
    --h-cream:      #FAF6F0;
    --h-cream-dark: #F0E8DA;
    --h-white:      #FFFFFF;
    --h-text:       #2A2A2A;
    --h-text-light: #6B6B6B;
    --h-text-muted: #9B9B9B;
    --h-height:     72px;
}

/* ═══ Header bar ═══ */

.nbc-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(250,246,240,.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(196,153,83,.15);
    transition: all .4s;
    height: var(--h-height);
}
.nbc-header.scrolled {
    background: rgba(250,246,240,.97);
    box-shadow: 0 2px 40px rgba(27,35,86,.06);
}
.nbc-header-hidden {
    transform: translateY(-100%);
}

.nbc-header-inner {
    max-width: 1524px;
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ═══ Logo ═══ */

.nbc-header-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.nbc-header-logo img {
    height: 28px;
    width: auto;
}
.nbc-header-logo-text {
    font-family: 'Cormorant Garamond', 'Spectral', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--h-navy);
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ═══ Nav links ═══ */

.nbc-header-links {
    flex: 1;
    display: flex;
    justify-content: center;
}
.nbc-header-menu {
    display: flex;
    gap: 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nbc-header-menu li { list-style: none; }
.nbc-header-menu a {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--h-text);
    position: relative;
    padding: 4px 0;
    transition: color .3s;
}
.nbc-header-menu a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 1.5px;
    background: var(--h-gold);
    transition: width .35s;
}
.nbc-header-menu a:hover { color: var(--h-gold); }
.nbc-header-menu a:hover::after { width: 100%; }

/* ── Dropdown ── */
.nbc-header-menu li { position: relative; }
/* Стрелочка на пунктах с подменю */
.nbc-header-menu li.menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.nbc-header-menu li.menu-item-has-children > a::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    position: static;
    background: none;
    transition: transform .25s;
}
.nbc-header-menu li.menu-item-has-children > a:hover::after {
    width: 0;
    background: none;
}
.nbc-header-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}
.nbc-header-menu .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--h-white);
    border-radius: 12px;
    padding: 12px 0;
    padding-top: 20px;
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(27,35,86,.12);
    border: 1px solid rgba(196,153,83,.1);
    list-style: none;
    margin: 0;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    transform: translateX(-50%) translateY(6px);
}
/* Невидимый мост между ссылкой и дропдауном */
.nbc-header-menu li > .sub-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
.nbc-header-menu li:hover > .sub-menu {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.nbc-header-menu .sub-menu li { list-style: none; }
.nbc-header-menu .sub-menu a {
    display: block;
    padding: 8px 20px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .03em;
    text-transform: none;
    color: var(--h-text);
    white-space: nowrap;
}
.nbc-header-menu .sub-menu a::after { display: none; }
.nbc-header-menu .sub-menu a:hover {
    color: var(--h-gold);
    background: var(--h-cream);
}

/* ═══ Actions ═══ */

.nbc-header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.nbc-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--h-text);
    transition: all .3s;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.nbc-header-icon:hover { color: var(--h-gold); }
.nbc-header-icon svg { width: 20px; height: 20px; }

/* User icon — filled circle */
.nbc-header-user-icon {
    background: var(--h-navy);
    color: #FFFFFF !important;
    width: 32px;
    height: 32px;
}
.nbc-header-user-icon svg {
    width: 16px;
    height: 16px;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}
.nbc-header-user-icon:hover {
    background: var(--h-gold);
    color: var(--h-navy-deep) !important;
}
.nbc-header-user-icon:hover svg {
    color: var(--h-navy-deep) !important;
    stroke: var(--h-navy-deep) !important;
}

/* Hide default Hello Elementor site header/branding */
.site-header,
#site-header,
#masthead,
.page-header,
.entry-header,
.woocommerce-products-header,
.site-branding {
    display: none !important;
}

/* Username */
.nbc-header-username {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--h-text);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Logout */
.nbc-header-logout svg { width: 18px; height: 18px; }

/* Badge (count) */
.nbc-header-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--h-gold);
    color: var(--h-navy-deep);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 700;
    opacity: 0;
    transition: opacity .3s;
}
.nbc-header-badge.show { opacity: 1; }

/* ═══ Cart ═══ */

.nbc-header-cart {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--h-text);
    transition: all .3s;
    position: relative;
}
.nbc-header-cart:hover { color: var(--h-gold); text-decoration: none; }
.nbc-header-cart svg { width: 22px; height: 22px; position: relative; }
.nbc-header-cart-badge { left: -8px; right: auto; top: -4px; }
.nbc-header-cart-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
}
.nbc-header-cart-price {
    font-family: 'Spectral', Garamond, serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--h-navy);
}
.nbc-header-cart-count {
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    color: var(--h-text-muted);
    font-weight: 500;
}

/* ═══ Hamburger ═══ */

.nbc-hamburger {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}
.nbc-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--h-navy);
    border-radius: 2px;
    transition: all .3s;
}
.nbc-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nbc-hamburger.active span:nth-child(2) { opacity: 0; }
.nbc-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ Mobile menu ═══ */

.nbc-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14,20,51,.4);
    z-index: 999;
    opacity: 0;
    transition: opacity .3s;
}
.nbc-mobile-overlay.active { display: block; opacity: 1; }

.nbc-mobile-menu {
    position: fixed;
    top: 0; right: -300px;
    width: 280px;
    height: 100vh;
    background: var(--h-cream);
    z-index: 1001;
    transition: right .35s cubic-bezier(.25,.46,.45,.94);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}
.nbc-mobile-menu.active { right: 0; }

.nbc-mobile-menu-top {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(196,153,83,.15);
}
.nbc-mobile-logo img { height: 24px; width: auto; }

.nbc-mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nbc-mobile-menu-list li { list-style: none; }
.nbc-mobile-menu-list a {
    display: block;
    padding: 12px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--h-text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,.05);
    transition: color .3s;
}
.nbc-mobile-menu-list a:hover { color: var(--h-gold); }

.nbc-mobile-profile { margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(196,153,83,.15); }
.nbc-mobile-profile-name { font-size: 14px; font-weight: 600; color: var(--h-navy); margin-bottom: 8px; }
.nbc-mobile-profile-link,
.nbc-mobile-profile-logout {
    display: block;
    font-size: 13px;
    color: var(--h-text-light);
    text-decoration: none;
    padding: 6px 0;
}
.nbc-mobile-profile-logout { color: #e05555; }

/* ═══ Login modal ═══ */

.nbc-login-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14,20,51,.4);
    z-index: 10500;
    opacity: 0;
    transition: opacity .4s;
}
.nbc-login-overlay.active { opacity: 1; }

.nbc-login-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.95);
    background: var(--h-white);
    border-radius: 16px;
    padding: 32px;
    width: 350px;
    max-width: 92vw;
    z-index: 10501;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    opacity: 0;
    transition: all .4s cubic-bezier(.25,.46,.45,.94);
}
.nbc-login-modal.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.nbc-login-modal * { box-sizing: border-box; }

.nbc-login-close {
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    border: none;
    background: var(--h-cream);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--h-text);
    transition: background .3s;
}
.nbc-login-close:hover { background: var(--h-cream-dark); }

.nbc-login-title {
    font-family: 'Spectral', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--h-navy);
    margin: 0 0 24px;
}
.nbc-login-field { margin-bottom: 16px; }
.nbc-login-field label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: var(--h-text-light);
    margin-bottom: 6px;
}
.nbc-login-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(27,35,86,.12);
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: var(--h-text);
    outline: none;
    transition: border-color .3s;
}
.nbc-login-field input:focus { border-color: var(--h-gold); }

.nbc-login-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #dc2626;
    margin-bottom: 16px;
}
.nbc-login-submit {
    width: 100%;
    padding: 14px;
    background: var(--h-navy);
    color: var(--h-cream);
    border: none;
    border-radius: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .3s;
}
.nbc-login-submit:hover { background: var(--h-gold); color: var(--h-navy-deep); }

.nbc-login-links {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}
.nbc-login-links a {
    font-size: 12px;
    color: var(--h-text-muted);
    text-decoration: none;
    transition: color .3s;
}
.nbc-login-links a:hover { color: var(--h-gold); }

/* ═══ Responsive ═══ */

@media (max-width: 768px) {
    .nbc-header-inner { padding: 0 16px; }
    .nbc-header-links { display: none; }
    .nbc-header-username { display: none; }
    .nbc-header-logout { display: none; }
    .nbc-hamburger { display: flex; }

    .nbc-header-logo-text { font-size: 18px; }
    .nbc-header-logo img { height: 22px; }
    .nbc-header-cart-price { font-size: 18px; }
    .nbc-header-cart-count { font-size: 11px; }

    .nbc-header-icon#nbcHeaderFav { margin-right: -5px; }
}
