/* ==========================================================================
   Header / Sticky Navigation Bar — Swiss Private Banking Canon 2026
   Kapital77.ru · Модуль T-STICKY
   ========================================================================== */

/* Корректировка скролла и отступ страницы под фиксированную шапку */
html {
    scroll-padding-top: 68px !important;
}

body {
    padding-top: 58px !important;
}

/* 1. Стиль полосы навигации: 56–60px (58px), фон #FFFFFF с легким размытием, тонкая граница */
.section-sticky-bar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    width: 100% !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
    transition: box-shadow 0.2s ease, background 0.2s ease !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.section-sticky-bar.scrolled {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
    background: rgba(255, 255, 255, 0.98) !important;
}

/* Распорка для плавности макета */
.sticky-bar-spacer {
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    width: 100% !important;
    display: block !important;
    visibility: hidden !important;
    pointer-events: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Контейнер бара */
.section-sticky-bar .container,
.sticky-bar__container {
    height: 100% !important;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.sticky-bar {
    width: 100%;
    height: 100%;
    min-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 2. Логотип и статус: четкий Kapital77 + сдержанный бейдж 102-ФЗ */
.sticky-bar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sticky-bar__logo {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    line-height: 1;
}

.sticky-bar__logo .logo-brand {
    font-family: var(--font-family-heading, 'Manrope', 'Inter', -apple-system, sans-serif);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0F172A;
    transition: color 0.15s ease;
}

.sticky-bar__logo .logo-accent {
    font-family: var(--font-family-heading, 'Manrope', 'Inter', -apple-system, sans-serif);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #059669;
}

.sticky-bar__logo:hover .logo-brand {
    color: #059669;
}

/* Текстовый бейдж статуса */
.sticky-bar__badge {
    display: inline-flex !important;
    align-items: center;
    font-family: var(--font-family, 'Inter', -apple-system, sans-serif);
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 4px;
    padding: 3px 8px;
    line-height: 1.25;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Скрываем устаревшие подписи слогана, если они присутствовали */
.sticky-bar__logo .logo-tagline {
    display: none !important;
}

/* 3. Навигация: лаконичные якорные ссылки, цвет #475569 -> #0F172A, никаких дерганий */
.sticky-bar__nav {
    display: flex !important;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sticky-nav-link {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-family, 'Inter', -apple-system, sans-serif);
    font-size: 13px;
    font-weight: 500;
    color: #475569 !important;
    text-decoration: none !important;
    padding: 6px 10px;
    border-radius: 6px;
    border: none !important;
    background: transparent;
    transition: color 0.15s ease, background-color 0.15s ease;
    white-space: nowrap;
    line-height: 1.2;
    cursor: pointer;
}

.sticky-nav-link:hover,
.sticky-nav-link:focus-visible {
    color: #0F172A !important;
    background-color: rgba(15, 23, 42, 0.04);
}

/* 4. Правый блок: телефон (tel:), статус (зеленая точка 6px #059669) + кнопка «Оценить объект» */
.sticky-bar__right {
    display: flex !important;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.sticky-bar__contact-group {
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.sticky-phone-link {
    display: inline-flex !important;
    align-items: center;
    font-family: var(--font-family-heading, 'Manrope', 'Inter', -apple-system, sans-serif) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0F172A !important;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.2;
    transition: color 0.15s ease;
}

.sticky-phone-link:hover {
    color: #059669 !important;
}

.sticky-status {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    font-family: var(--font-family, 'Inter', -apple-system, sans-serif);
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    white-space: nowrap;
    line-height: 1;
}

.sticky-status__dot {
    width: 6px;
    height: 6px;
    min-width: 6px;
    min-height: 6px;
    border-radius: 50%;
    background-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
    display: inline-block;
    flex-shrink: 0;
}

/* Компактная кнопка «Рассчитать условия» (высота 36px, изумруд #059669) */
.btn-sticky-estimate {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 16px !important;
    box-sizing: border-box;
    background-color: #059669 !important;
    color: #FFFFFF !important;
    font-family: var(--font-family, 'Inter', -apple-system, sans-serif);
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-sticky-short {
    display: none;
}

@media (max-width: 640px) {
    .btn-sticky-full {
        display: none !important;
    }
    .btn-sticky-short {
        display: inline !important;
    }
}

.btn-sticky-estimate:hover {
    background-color: #047857 !important;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.btn-sticky-estimate:active {
    transform: scale(0.98);
}

/* 5. Бургер-кнопка в шапке */
.header__burger {
    display: none;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.header__burger:hover {
    background-color: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.2);
}

.header__burger-line {
    display: block;
    width: 18px;
    height: 2px;
    background-color: #0F172A;
    border-radius: 1px;
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.header.open .header__burger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header.open .header__burger-line:nth-child(2) {
    opacity: 0;
}

.header.open .header__burger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 6. Мобильное бургер-меню (плавное открывание, не перекрывает весь экран) */
.header__overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.header.open .header__overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.header__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    background: #FFFFFF;
    box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
    z-index: 10002;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(24px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.header.open .header__panel {
    transform: translateX(0);
}

.header__panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.header__panel-brand {
    font-family: var(--font-family-heading, 'Manrope', 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 800;
    color: #0F172A;
    letter-spacing: -0.02em;
}

.header__panel-brand span {
    color: #059669;
}

.header__panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F8FAFC;
    border-radius: 6px;
    color: #475569;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header__panel-close:hover {
    background-color: #E2E8F0;
    color: #0F172A;
}

.header__panel-lead {
    margin: 10px 0 16px;
    font-size: 11px;
    font-weight: 500;
    color: #64748B;
    line-height: 1.35;
}

.header__panel-nav {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.header__panel-nav a {
    display: flex;
    align-items: center;
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: 15px;
    font-weight: 500;
    color: #0F172A;
    text-decoration: none;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    transition: color 0.15s ease, padding-left 0.15s ease;
}

.header__panel-nav a:hover {
    color: #059669;
    padding-left: 4px;
}

.header__panel-contacts {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header__panel-phone {
    font-family: var(--font-family-heading, 'Manrope', 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #0F172A;
    text-decoration: none;
    transition: color 0.15s ease;
}

.header__panel-phone:hover {
    color: #059669;
}

.header__panel-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
}

.btn-sticky-panel-estimate {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    min-height: 42px;
    margin-top: 14px;
    background: #059669;
    color: #FFFFFF !important;
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background-color 0.15s ease;
}

.btn-sticky-panel-estimate:hover {
    background-color: #047857;
}

.header__panel-messengers {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.header__panel-msg-link {
    flex: 1;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-family, 'Inter', sans-serif);
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.header__panel-msg-link:hover {
    background-color: #F1F5F9;
    color: #0F172A;
}

/* 7. Адаптивность для планшетов и мобильных устройств */
@media (max-width: 1024px) {
    .sticky-bar__nav {
        display: none !important;
    }
    .header__burger {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .section-sticky-bar .container,
    .sticky-bar__container {
        padding: 0 16px !important;
    }
    .sticky-bar__badge {
        display: none !important;
    }
    .sticky-status {
        display: none !important;
    }
    .sticky-bar__right {
        gap: 10px;
    }
    .sticky-phone-link {
        font-size: 13px !important;
    }
    .btn-sticky-estimate {
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        padding: 0 12px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .sticky-bar__contact-group {
        display: none !important;
    }
    .sticky-bar__logo .logo-brand,
    .sticky-bar__logo .logo-accent {
        font-size: 18px;
    }
}
