/**
 * Блог Kapital77 — шапка без пунктов меню (крошки в статье); стиль по BLOG_ДИЗАЙН_КОНЦЕПЦИЯ.
 * Подключить header-sticky-design.css и header-burger.js для бургера/панели.
 */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.99) 0%,
        rgba(248, 250, 252, 0.97) 100%
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(37, 99, 235, 0.09);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 2px 8px rgba(15, 23, 42, 0.04),
        0 8px 28px rgba(37, 99, 235, 0.06);
    padding: 15px 0 16px;
}

/* Акцент primary — спокойная «финансовая» полоска (концепция §3–4) */
.header--chrome-lp::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 42%, #3b82f6 100%);
    pointer-events: none;
    z-index: 2;
}

.header__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
}

/* Лого слева; нав и блок «телефон + CTA» справа — одна линия на десктопе */
.header__logo {
    flex: 0 1 auto;
    min-width: 0;
}

.header__logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    max-width: 100%;
}

.header__logo-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.header__logo-tagline {
    display: block;
    margin-top: 2px;
    font-family: var(--font-family-base, Inter, system-ui, sans-serif);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: var(--color-text-light, var(--color-text-muted));
    max-width: min(24rem, 100%);
    white-space: normal;
}

.header__logo-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-sm, 8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header__logo-text {
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
}

/* Блок контактов и CTA — прижат вправо, без nav по центру */
.header__desktop-actions {
    display: none;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.header__messengers {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 4px;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    margin-right: 2px;
}

.header__messenger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.header__messenger:hover {
    background: rgba(37, 99, 235, 0.11);
    border-color: rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

.header__messenger img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.header__phone-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.header__contact-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, #94a3b8);
    line-height: 1.2;
}

.header__callback-desktop {
    padding: 8px 14px !important;
    min-height: 40px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap;
}

.header__desktop-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1240px) {
    .header--chrome-lp .header__messengers {
        display: none;
    }
}

@media (max-width: 1120px) {
    .header--chrome-lp .header__callback-desktop {
        display: none;
    }
}

.header__phone {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text) !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.header__phone:hover {
    color: var(--color-primary) !important;
}

.header__cta-desktop {
    padding: 10px 18px !important;
    font-size: 15px !important;
    min-height: 44px !important;
    line-height: 1.25 !important;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .header__desktop-actions {
        display: flex;
    }
}

/* Планшет: контакты в бургер-панели */
@media (max-width: 1040px) and (min-width: 769px) {
    .blog-list-page .header__burger,
    .blog-article-page .header__burger {
        display: flex !important;
    }
    .blog-list-page .header__desktop-actions,
    .blog-article-page .header__desktop-actions {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header__burger {
        margin-left: auto;
        flex-shrink: 0;
    }
}

.header__logo a,
.header__logo-link {
    font-family: var(--font-family-heading, Manrope, sans-serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text) !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
    line-height: var(--line-height-tight, 1.2);
    transition: color 0.2s ease;
}

.header__logo a:hover,
.header__logo-link:hover {
    color: var(--color-primary-light, var(--color-primary)) !important;
}

.header__logo a:visited,
.header__logo-link:visited {
    color: var(--color-text) !important;
}

.header__logo-link .header__logo-text {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: inherit;
    line-height: var(--line-height-tight, 1.2);
    display: inline-flex;
    align-items: baseline;
}

.header__logo-link .header__logo-brand {
    color: var(--brand-navy, #1E3A8A);
}

.header__logo-link .header__logo-accent {
    color: var(--cta-green, #059669);
    font-weight: 800;
    margin-left: 1px;
}

.header__logo-link .header__logo-tagline {
    color: var(--color-text-light, var(--color-text-muted));
}

/* Десктоп: бургер скрыт */
@media (min-width: 769px) {
    .header__burger {
        display: none !important;
    }
}

/* Бургер: по умолчанию скрыт (показывается на мобильной) */
.header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.header__burger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.header.open .header__burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.header.open .header__burger-line:nth-child(2) {
    opacity: 0;
}
.header.open .header__burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Оверлей и панель (мобильное меню) */
.header__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.header.open .header__overlay {
    display: block;
    opacity: 1;
}
.header__panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100%;
    z-index: 1002;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    visibility: hidden;
    pointer-events: none;
}
.header.open .header__panel {
    display: block;
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
}
.header__panel-lead {
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(37, 99, 235, 0.12);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted, #64748b);
}

.header__panel-contact {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header__panel-contact .header__contact-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted, #94a3b8);
}

.header__panel-phone {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary) !important;
    text-decoration: none !important;
}

.header__panel-messengers {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.header__panel-messengers .header__messenger {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.header__panel-messengers .header__messenger img {
    width: 22px;
    height: 22px;
}

.header__panel-cta-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header__panel-cta-row .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Мобильная: бургер */
@media (max-width: 768px) {
    .header__burger {
        display: flex !important;
    }
}
