/* ==========================================================================
   NBC Header v1.0 — кастомная шапка + модалка входа
   ========================================================================== */

/* ══════════ VARIABLES (наследуем из каталога) ══════════ */

.nbc-header,
.nbc-mobile-menu,
.nbc-login-modal {
    --nbc-primary:      #FFD54F;
    --nbc-primary-dark: #FFC107;
    --nbc-text:         #1a1a1a;
    --nbc-text-light:   #737373;
    --nbc-bg:           #ffffff;
    --nbc-border:       #e5e5e5;
    --nbc-radius:       12px;
    --nbc-radius-sm:    8px;
    --nbc-shadow:       0 2px 12px rgba(0,0,0,.08);
    --nbc-tr:           .2s ease;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ══════════ HEADER ══════════ */

/* Hide default theme header */
header#masthead,
.site-header,
.elementor-location-header { display: none !important; }

.nbc-header {
    position: sticky; top: 0; z-index: 9999;
    background: #FFC107;
    border-bottom: none;
    height: 64px;
    transition: transform 0.3s ease;
}
.nbc-header.nbc-header-hidden {
    transform: translateY(-100%);
}

.nbc-header-inner {
    max-width: 1400px; margin: 0 auto;
    display: flex; align-items: center; gap: 16px;
    height: 100%; padding: 0 24px;
}

/* Гамбургер — только мобайл */
.nbc-hamburger {
    display: none; background: none; border: none; cursor: pointer;
    width: 32px; height: 32px; position: relative; padding: 0;
    flex: 0 0 auto;
}
.nbc-hamburger span {
    display: block; position: absolute; left: 4px;
    width: 24px; height: 2px; background: var(--nbc-text);
    transition: all 400ms ease;
    border-radius: 2px;
}
.nbc-hamburger span:nth-child(1) { top: 8px; }
.nbc-hamburger span:nth-child(2) { top: 15px; }
.nbc-hamburger span:nth-child(3) { top: 22px; }

/* Hamburger → X animation */
.nbc-hamburger.active span:nth-child(1) { top: 15px; transform: rotate(45deg); }
.nbc-hamburger.active span:nth-child(2) { opacity: 0; }
.nbc-hamburger.active span:nth-child(3) { top: 15px; transform: rotate(-45deg); }

/* Лого */
.nbc-header-logo {
    flex: 0 0 auto; display: flex; align-items: center;
    text-decoration: none; color: var(--nbc-text);
}
.nbc-header-logo img { height: 40px; width: auto; display: block; }
.nbc-header-logo-text { font-size: 18px; font-weight: 700; }

/* График */
.nbc-header-schedule {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--nbc-text-light); white-space: nowrap;
}
.nbc-header-schedule svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Навигация */
.nbc-header-nav { flex: 1 1 auto; display: flex; justify-content: center; }
.nbc-header-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.nbc-header-menu li { margin: 0; }
.nbc-header-menu a {
    text-decoration: none; color: var(--nbc-text); font-size: 14px; font-weight: 500;
    padding: 8px 14px; border-radius: var(--nbc-radius-sm);
    transition: background var(--nbc-tr), color var(--nbc-tr);
    white-space: nowrap;
}
.nbc-header-menu a:hover { background: var(--nbc-primary); color: var(--nbc-text); }
.nbc-header-menu .current-menu-item a { background: var(--nbc-primary); font-weight: 600; }

/* Соцсети */
.nbc-header-social { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.nbc-social-link {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--nbc-text); transition: background var(--nbc-tr);
}
.nbc-social-link svg { width: 20px; height: 20px; }
.nbc-social-link:hover { background: var(--nbc-primary); }

/* Телефон */
.nbc-header-phone {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    text-decoration: none; color: var(--nbc-text); font-weight: 600; font-size: 14px;
    white-space: nowrap;
}
.nbc-header-phone svg { width: 18px; height: 18px; }
.nbc-header-phone:hover { color: var(--nbc-primary-dark); }

/* Кнопка Войти */
.nbc-header-auth { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

.nbc-header-login-btn {
    display: flex; align-items: center; gap: 6px;
    background: var(--nbc-primary); border: none; border-radius: var(--nbc-radius-sm);
    padding: 8px 16px; cursor: pointer; font-family: inherit;
    font-size: 14px; font-weight: 600; color: var(--nbc-text);
    transition: background var(--nbc-tr);
}
.nbc-header-login-btn svg { width: 18px; height: 18px; }
.nbc-header-login-btn:hover { background: var(--nbc-primary-dark); }

/* Авторизованный пользователь */
.nbc-header-user {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--nbc-text); font-size: 14px; font-weight: 500;
    white-space: nowrap;
}
.nbc-header-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.nbc-header-user-icon { width: 28px; height: 28px; }
.nbc-header-user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.nbc-header-logout {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%; color: var(--nbc-text-light);
    transition: background var(--nbc-tr), color var(--nbc-tr);
}
.nbc-header-logout svg { width: 18px; height: 18px; }
.nbc-header-logout:hover { background: #fee; color: #c00; }

/* ══════════ MOBILE MENU (slide) ══════════ */

.nbc-mobile-overlay {
    display: none; position: fixed; inset: 0; z-index: 9998;
    background: rgba(0,0,0,.4); opacity: 0;
    transition: opacity 400ms ease;
}
.nbc-mobile-overlay.active { display: block; opacity: 1; }

.nbc-mobile-menu {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 300px; max-width: 85vw;
    background: var(--nbc-bg); z-index: 10000;
    transform: translateX(-100%);
    transition: transform 400ms ease;
    display: flex; flex-direction: column;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.nbc-mobile-menu.active { transform: translateX(0); }

.nbc-mobile-menu-top { padding: 16px 20px; border-bottom: 1px solid var(--nbc-border); }
.nbc-mobile-logo img { height: 36px; width: auto; }

.nbc-mobile-nav { flex: 1 1 auto; padding: 12px 0; }
.nbc-mobile-menu-list { list-style: none; margin: 0; padding: 0; }
.nbc-mobile-menu-list li { margin: 0; }
.nbc-mobile-menu-list a {
    display: block; padding: 14px 24px; text-decoration: none;
    color: var(--nbc-text); font-size: 16px; font-weight: 500;
    border-bottom: 1px solid var(--nbc-border);
    transition: background var(--nbc-tr);
}
.nbc-mobile-menu-list a:hover { background: #fafafa; }
.nbc-mobile-menu-list .current-menu-item a { color: var(--nbc-primary-dark); font-weight: 600; }

.nbc-mobile-info { padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.nbc-mobile-phone {
    display: flex; align-items: center; gap: 8px;
    color: var(--nbc-text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.nbc-mobile-phone svg { width: 18px; height: 18px; }
.nbc-mobile-schedule { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--nbc-text-light); }
.nbc-mobile-schedule svg { width: 16px; height: 16px; }

.nbc-mobile-profile {
    border-top: 1px solid var(--nbc-border);
    padding: 16px 24px; margin-top: auto;
}
.nbc-mobile-profile-info { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.nbc-mobile-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.nbc-mobile-avatar-icon { width: 40px; height: 40px; color: var(--nbc-text-light); }
.nbc-mobile-profile-name { font-weight: 600; font-size: 14px; }
.nbc-mobile-profile-email { font-size: 12px; color: var(--nbc-text-light); }
.nbc-mobile-profile-link,
.nbc-mobile-profile-logout {
    display: inline-block; margin-right: 16px; font-size: 13px;
    text-decoration: none; color: var(--nbc-primary-dark); font-weight: 500;
}
.nbc-mobile-profile-logout { color: #c00; }

/* ══════════ LOGIN MODAL ══════════ */

.nbc-login-overlay {
    display: none; position: fixed; inset: 0; z-index: 10001;
    background: rgba(0,0,0,.45); opacity: 0;
    transition: opacity 500ms ease;
}
.nbc-login-overlay.active { display: block; opacity: 1; }

.nbc-login-modal {
    display: none; position: fixed;
    top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.9);
    z-index: 10002;
    width: 320px; min-height: 380px; max-height: 90vh;
    background: var(--nbc-bg); border-radius: var(--nbc-radius);
    padding: 32px 28px; box-shadow: 0 8px 40px rgba(0,0,0,.18);
    opacity: 0;
    transition: opacity 500ms ease, transform 500ms ease;
}
.nbc-login-modal.active {
    display: block; opacity: 1; transform: translate(-50%, -50%) scale(1);
}

.nbc-login-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; font-size: 28px; line-height: 1;
    cursor: pointer; color: var(--nbc-text-light);
    transition: color var(--nbc-tr);
}
.nbc-login-close:hover { color: var(--nbc-text); }

.nbc-login-title {
    margin: 0 0 24px; font-size: 20px; font-weight: 700; text-align: center;
}

.nbc-login-field { margin-bottom: 16px; }
.nbc-login-field label {
    display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--nbc-text-light);
}
.nbc-login-field input {
    width: 100%; padding: 12px 14px; border: 1px solid var(--nbc-border);
    border-radius: var(--nbc-radius-sm); font-family: inherit; font-size: 14px;
    transition: border-color var(--nbc-tr);
    outline: none; box-sizing: border-box;
}
.nbc-login-field input:focus { border-color: var(--nbc-primary-dark); }

.nbc-login-error {
    background: #fff3f3; color: #c00; padding: 10px 14px;
    border-radius: var(--nbc-radius-sm); font-size: 13px; margin-bottom: 16px;
    text-align: center;
}

.nbc-login-submit {
    width: 100%; padding: 14px; border: none;
    background: var(--nbc-primary); border-radius: var(--nbc-radius-sm);
    font-family: inherit; font-size: 16px; font-weight: 600;
    color: var(--nbc-text); cursor: pointer;
    transition: background var(--nbc-tr);
}
.nbc-login-submit:hover { background: var(--nbc-primary-dark); }
.nbc-login-submit:disabled { opacity: .6; cursor: not-allowed; }

.nbc-login-hint {
    margin-top: 16px; font-size: 12px; color: var(--nbc-text-light);
    text-align: center; line-height: 1.4;
}

.nbc-login-links {
    display: flex; justify-content: space-between;
    margin-top: 16px; font-size: 13px;
}
.nbc-login-links a { color: #003399 !important; text-decoration: none; font-weight: 500; }
.nbc-login-links a:hover { text-decoration: underline; }

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

@media (max-width: 991px) {
    .nbc-hamburger { display: flex; align-items: center; justify-content: center; }
    .nbc-header-schedule,
    .nbc-header-nav,
    .nbc-header-social,
    .nbc-header-phone { display: none; }
    .nbc-header-logo { flex: 1 1 auto; justify-content: center; }
    .nbc-header-logo-text { font-size: 15px; }
    .nbc-header-inner { padding: 0 12px; gap: 8px; }
    .nbc-header { height: 56px; }

    .nbc-header-user-name { display: none; }

    /* Login modal — полная ширина */
    .nbc-login-modal { width: 320px; max-width: calc(100vw - 32px); min-height: 380px; padding: 28px 20px; }
}

@media (max-width: 480px) {
    .nbc-login-modal { width: 300px; max-width: calc(100vw - 16px);  min-height: 360px; }
}
