/**
 * Стили шапки и навигации
 */

/* ==========================================================================
   1. СИНЯЯ ШАПКА
   ========================================================================== */
.site-header-main {
    background-color: var(--vstts-header-bg);
    color: #ffffff;
    padding: var(--font-body-m) 0;
}

/* Брендинг */
.header-brand {
    text-decoration: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: var(--font-body-m);
}

.header-brand:hover {
    color: #ffffff;
}

.header-brand-logo {
    max-height: 52px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.header-brand-title {
    font-size: var(--font-body-m);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-brand-subtitle {
    font-size: var(--font-body-xs);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 3px;
    line-height: 1.2;
}

.header-brand:not([href]) {
    cursor: default;
}

/* Кнопка слабовидящих */
.header-bvi-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    gap: 10px;
    cursor: pointer;
    text-decoration: none;
}

.header-bvi-icon-circle {
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    color: var(--vstts-header-bg);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-h4);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-bvi-btn:hover .header-bvi-icon-circle {
    transform: scale(1.06);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-bvi-text {
    color: #ffffff;
    font-size: var(--font-body-m);
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.header-bvi-btn:hover .header-bvi-text {
    opacity: 0.85;
}

/* Гамбургер */
.header-burger-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: var(--font-h3);
    line-height: 1;
    padding: 4px;
    cursor: pointer;
}

/* ==========================================================================
   2. ДЕСКТОПНОЕ МЕНЮ
 */
.site-nav-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 0;
}

.desktop-nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav-link {
    font-size: var(--font-body-l);
    font-weight: 500;
    color: var(--vstts-text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.desktop-nav-link:hover,
.desktop-dropdown:hover > .desktop-nav-link {
    color: var(--bs-link-hover-color);
}

.desktop-dropdown {
    position: relative;
    padding-bottom: 4px;
}

/* Раскрытие меню */
@media (min-width: 992px) {
    .desktop-dropdown:hover .desktop-dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .desktop-dropdown:hover .desktop-nav-link .bi-chevron-down {
        transform: rotate(180deg);
    }
}

.desktop-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    min-width: 280px;
    z-index: 1000;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.desktop-dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #334155;
    text-decoration: none;
    font-size: var(--font-body-m);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.desktop-dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--vstts-accent-primary);
}

/* Активный пункт меню */
.desktop-dropdown-item.is-active,
.desktop-nav-link.is-active,
.drawer-sub-link.is-active,
.drawer-nav-link.is-active {
    color: var(--vstts-accent-primary);
    font-size: var(--font-body-l);
    font-weight: 500;
    color: var(--vstts-text-primary);
    cursor: default;
    pointer-events: none;
}

/* ==========================================================================
   3. МОБИЛЬНОЕ БУРГЕР-ОКНО
   ========================================================================== */
.mobile-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99998;
}

.mobile-drawer-overlay.is-active {
    display: block;
}

/* Карточка меню */
.mobile-drawer-card {
    position: fixed;
    top: 20px;
    left: 20px;
    width: calc(100vw - 40px);
    max-width: 360px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--vstts-bg-base-03);
    border-radius: var(--vstts-radius);
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-drawer-card.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--vstts-accent-primary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.drawer-nav-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: var(--font-body-m);
}

.drawer-nav-link {
    font-size: 15px;
    font-weight: 500;
    color: var(--vstts-text-primary);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.drawer-nav-link:hover {
    color: var(--vstts-accent-primary);
}

.drawer-sub-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 10px 0 4px 16px;
    margin: 0;
    width: 100%;
}

.drawer-item-dropdown.is-open .drawer-sub-menu {
    display: flex;
    flex-direction: column;
}

.drawer-item-dropdown.is-open .drawer-nav-chevron {
    transform: rotate(180deg);
}

.drawer-sub-link {
    font-size: var(--font-body-m);
    color: #475569;
    text-decoration: none;
    line-height: 1.3;
    display: block;
}

.drawer-sub-link:hover {
    color: var(--vstts-accent-primary);
}

.drawer-item-dropdown:hover .drawer-nav-chevron {
    transform: rotate(180deg);
}

.drawer-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-nav-chevron {
    transition: transform 0.2s ease;
    color: #475569;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
}

.drawer-muted-link {
    color: #94a3b8;
    cursor: not-allowed;
    font-size: var(--font-body-m);
    list-style: none;
}


/* ==========================================================================
   4. МЕДИА-ЗАПРОСЫ АДАПТИВНОСТИ
   */
@media (min-width: 992px) {
    .mobile-drawer-card,
    .mobile-drawer-overlay {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .site-nav-bar {
        display: none;
    }
}

@media (max-width: 575px) {
    .header-brand-title {
        font-size: var(--font-body-s);
    }
    .header-brand-subtitle {
        display: none;
    }
    .header-brand-logo {
        max-height: 40px;
    }
    .header-bvi-text {
        display: none;
    }
    .header-bvi-btn {
        padding: 8px;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        justify-content: center;
    }
}