/* ═══════════════════════════════════════════════════════════════════════
   HEADER — Neumorphism светлый (как референс Themesberg)
   ═══════════════════════════════════════════════════════════════════════ */

.main-header {
    background: var(--bg) !important;
    box-shadow: 0 4px 14px rgba(194,200,208,0.8), 0 1px 0 #fff !important;
    border-bottom: none !important;
    position: relative;
    z-index: 200;
}

/* Контейнер */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 70px;
    gap: 16px;
}

/* ── Логотип ─────────────────────────────────────────────────────────── */
.header-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Объёмный квадрат-контейнер для логотипа */
.header-logo-box {
    /* Прямоугольник — на 5px больше логотипа со всех сторон */
    padding: 5px;
    border-radius: var(--radius) ;
    background: var(--bg);
    box-shadow: var(--neu-out);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: box-shadow 0.2s ease;
}
.header-logo:hover .header-logo-box {
    box-shadow: var(--neu-in);
}
.header-logo-box img {
    height: 46px;
    width: auto;
    display: block;
}

/* Текст логотипа */
.header-logo-text { display: flex; flex-direction: column; }
.header-brand {
    font-size: 1.8rem;
    color: var(--primary);
    line-height: 1;
    letter-spacing: 1px;
    white-space: nowrap;
}
.header-brand span { color: var(--gold); }
.header-subtitle {
    font-size: 0.42rem;
    color: var(--muted);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: nowrap;
    margin-top: 2px;
}

/* ── Навигация ────────────────────────────────────────────────────────── */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    /* Сдвигаем к логотипу — НЕ в конец */
    margin-right: auto;
}

.nav-item { position: relative; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    padding: 8px 10px;
    border-radius: var(--radius-sm) ;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}
a.nav-link,
.main-nav a.nav-link,
.nav-item a.nav-link {
    color: var(--primary) !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
}
.nav-link:hover,
.nav-item.open .nav-link,
.nav-item:hover .nav-link {
    background: var(--bg);
    box-shadow: var(--neu-in);
    color: var(--accent);
}

.nav-arrow {
    font-size: 0.6rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
    display: inline-block;
}
.nav-item:hover .nav-arrow,
.nav-item.open .nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* ── Дропдаун ────────────────────────────────────────────────────────── */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    min-width: 200px;
    background: var(--bg);
    border-radius: var(--radius) ;
    box-shadow: 6px 6px 14px #c2c8d0, -4px -4px 10px #ffffff;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 300;
    pointer-events: none;
}

.nav-item:hover .nav-dropdown,
.nav-item.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
    transition-delay: 0s;
}

/* Задержка скрытия — меню не убирается мгновенно */
.nav-dropdown {
    transition-delay: 0.25s;
}
.nav-item:hover .nav-dropdown {
    transition-delay: 0s;
}

/* Невидимый мост между кнопкой и дропдауном */
.nav-item::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

/* Ссылки дропдауна */
.nav-drop-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 11px 18px;
    border-radius: var(--radius-sm) ;
    text-decoration: none;
    color: #1a3a5c !important;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 1.3;
}
.nav-drop-item:hover {
    background: rgba(194,200,208,0.35);
    box-shadow: inset 2px 2px 5px #c2c8d0, inset -2px -2px 5px #fff;
    color: var(--accent) !important;
}

/* Разделитель в дропдауне */
.nav-drop-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(194,200,208,0.8), transparent);
    margin: 6px 8px;
}

/* Тикер — под светлым хедером */


/* Бургер — тёмный на светлом фоне */
.burger span { background: var(--primary) !important; }

/* ═══════════════════════════════════════════════════════════════════════
   FOOTER — Neumorphism
   ═══════════════════════════════════════════════════════════════════════ */

.main-footer {
    box-shadow: 0 -6px 24px rgba(26,58,92,0.18) !important;
}

/* VK кнопки — вытянутые, одинаковая ширина, с названием */
.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}
.footer-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    width: 320px;
    background: rgba(255,255,255,0.07);
    border: none;
    border-radius: var(--radius-sm) ;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.18s ease;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.28), -2px -2px 6px rgba(255,255,255,0.06);
}
.footer-social-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.03);
    box-shadow: inset 3px 3px 8px rgba(0,0,0,0.3), inset -2px -2px 5px rgba(255,255,255,0.05);
}
.footer-social-btn svg { flex-shrink: 0; }
.footer-social-btn span { display: inline; }

.copyright-legal {
    font-size: 0.7rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.28);
    text-align: justify;
    margin-top: 14px;
    font-weight: 400;
}

/* ── Мобайл header ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .header-container {
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 14px;
        gap: 0;
        height: auto;
        min-height: 60px;
    }
    .header-logo { flex: 1 1 auto; gap: 10px; }
    .header-logo-box { height: 40px; border-radius: var(--radius-sm) ; }
    .header-logo-box img { height: 26px; }
    .header-subtitle { display: none; }
    .burger { display: flex; }

    /* Навигация — полноширинная вертикальная */
    .main-nav {
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100%;
        order: 10;
        flex-basis: 100%;
        background: var(--bg);
        border-top: 1px solid rgba(194,200,208,0.5);
        padding: 6px 8px 10px;
        gap: 2px;
        margin-right: 0;
        box-shadow: 0 4px 10px rgba(194,200,208,0.5);
    }
    .main-nav.nav-open { display: flex !important; }

    .nav-item { width: 100%; }
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 12px 14px;
        font-size: 0.88rem;
        border-radius: var(--radius-sm) ;
    }

    /* Дропдаун вертикально */
    .nav-dropdown {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: var(--neu-in);
        background: rgba(194,200,208,0.2);
        border-radius: var(--radius-sm) ;
        padding: 4px 4px 4px 12px;
        margin-top: 2px;
        display: none;
        pointer-events: all;
    }
    .nav-item.open .nav-dropdown { display: block; }
    .nav-drop-item {
        color: var(--primary);
        font-size: 0.82rem;
        padding: 9px 12px;
        border-radius: var(--radius-xs) ;
    }
    .nav-drop-item:hover {
        color: var(--accent);
        box-shadow: var(--neu-in);
    }
    .nav-drop-divider { margin: 4px 6px; }
}

@media (max-width: 480px) {
    .header-brand { font-size: 1.5rem; }
    .footer-social-btn span { font-size: 0.78rem; }
}

/* ═══════════════════════════════════════════════════════════════════════
   БЕЙДЖ СООБЩЕНИЙ В ХЕДЕРЕ (подключён глобально через header.css)
   ═══════════════════════════════════════════════════════════════════════ */

.header-msg-link {
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: var(--radius-xs);
    transition: all 0.18s ease;
}

.header-msg-link:hover {
    background: var(--bg);
    box-shadow: var(--neu-in);
}

.header-msg-icon {
    display: block;
}

.header-msg-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #f26a6b;
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.header-msg-badge.has-unread {
    display: flex;
}