﻿/* ========================================
   HEADER STYLES
   Топбар, шапка, навигация, мобильное меню
======================================== */

/* ----------------------------------------
   TOPBAR — верхняя полоска с контактами
---------------------------------------- */
.topbar {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 36px;
    display: flex;
    align-items: center;
    min-height: 36px;
}

.topbar-container {
    max-width: 1400px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    min-width: 0;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.topbar-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.topbar-divider {
    color: rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-phone {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.topbar-phone:hover {
    opacity: 0.8;
    color: var(--secondary-color);
}

.topbar-messengers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.topbar-messenger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all var(--transition-fast);
    color: white;
    opacity: 0.75;
}

.topbar-messenger:hover {
    opacity: 1;
    transform: translateY(-1px);
    color: white;
}

.topbar-tg:hover  { background: rgba(41, 182, 246, 0.25); }
.topbar-vk:hover  { background: rgba(0, 119, 255, 0.25); }
.topbar-max:hover { background: rgba(42, 82, 152, 0.35); }

.topbar-email-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
}

.topbar-email-link:hover {
    color: white;
}

/* Скрываем почту на средних экранах — см. responsive.css */

/* ----------------------------------------
   HEADER — основная шапка с логотипом и навигацией
---------------------------------------- */
.header {
    background: linear-gradient(135deg, rgba(255,255,255,.82) 0%, rgba(240,247,242,.85) 60%, rgba(232,244,236,.88) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(27, 58, 107, .12);
    transition: all var(--transition-normal);
}

.header-container {
    max-width: 1400px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.header-phone {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
    display: none;
}

.header-phone:hover {
    color: var(--primary-dark);
}

/* ----------------------------------------
   LOGO
---------------------------------------- */
.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: transform var(--transition-fast);
}

.logo a:hover .logo-image {
    transform: scale(1.05);
}

.logo-text-block {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-top: 2px;
    line-height: 1;
}

/* ----------------------------------------
   DESKTOP NAVIGATION
---------------------------------------- */
.nav-list {
    display: flex;
    list-style: none;
    gap: 1.2rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-list a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-normal);
}

.nav-list a.active,
.nav-list a:hover {
    color: var(--primary-color);
}

.nav-list a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown > a::after {
    content: ' ▾';
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform var(--transition-normal);
}

.nav-dropdown:hover > a::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 1001;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
    position: relative;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background: var(--primary-color);
    color: white;
}

/* ----------------------------------------
   MOBILE MENU BUTTON
---------------------------------------- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
    transform-origin: center;
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; transform: scale(0); }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ========================================
   MOBILE NAVIGATION — полноэкранное меню
---------------------------------------- */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 999;
    padding-top: 80px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(-100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-content {
    padding: 2rem 1.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    text-align: center;
}

.mobile-nav-list {
    list-style: none;
    text-align: center;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
}

.mobile-nav-list li {
    margin: 1rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-nav.active .mobile-nav-list li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav.active .mobile-nav-list li:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav.active .mobile-nav-list li:nth-child(2) { transition-delay: 0.2s; }
.mobile-nav.active .mobile-nav-list li:nth-child(3) { transition-delay: 0.3s; }
.mobile-nav.active .mobile-nav-list li:nth-child(4) { transition-delay: 0.4s; }
.mobile-nav.active .mobile-nav-list li:nth-child(5) { transition-delay: 0.5s; }
.mobile-nav.active .mobile-nav-list li:nth-child(6) { transition-delay: 0.6s; }
.mobile-nav.active .mobile-nav-list li:nth-child(7) { transition-delay: 0.7s; }
.mobile-nav.active .mobile-nav-list li:nth-child(8) { transition-delay: 0.8s; }

.mobile-nav-list a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.mobile-nav-list a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(42, 82, 152, 0.1), transparent);
    transition: left 0.5s ease;
}

.mobile-nav-list a:hover::before {
    left: 100%;
}

.mobile-nav-list a:hover,
.mobile-nav-list a.active {
    color: var(--primary-color);
    background: rgba(42, 82, 152, 0.05);
    transform: scale(1.05);
}

.mobile-nav-cta {
    margin-top: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
    max-width: 100%;
}

.mobile-nav.active .mobile-nav-cta {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

/* ========================================
   Mobile nav messengers — мессенджеры в меню
======================================== */
.mobile-nav-messengers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0 1rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-nav.active .mobile-nav-messengers {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.85s;
}

.mobile-nav-messengers .topbar-messenger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(27, 58, 107, 0.1);
    color: var(--primary-color);
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-nav-messengers .topbar-messenger:hover {
    transform: scale(1.1);
    background: rgba(27, 58, 107, 0.15);
}

.mobile-nav-messengers .topbar-tg { 
    background: rgba(41, 182, 246, 0.12); 
    color: #29b6f6; 
}

.mobile-nav-messengers .topbar-tg:hover { 
    background: rgba(41, 182, 246, 0.2); 
}

.mobile-nav-messengers .topbar-vk { 
    background: rgba(0, 119, 255, 0.12); 
    color: #0077ff; 
}

.mobile-nav-messengers .topbar-vk:hover { 
    background: rgba(0, 119, 255, 0.2); 
}

.mobile-nav-messengers .topbar-max { 
    background: rgba(27, 58, 107, 0.12); 
    color: var(--primary-color); 
}

.mobile-nav-messengers .topbar-max:hover { 
    background: rgba(27, 58, 107, 0.2); 
}

