/* Стили для шапки сайта */

.header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: all var(--transition-fast);
}

.header.scrolled {
    box-shadow: var(--shadow-lg);
}

.header__top {
    background: var(--color-gray-50);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-gray-200);
}

.header__contacts {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
}

.contact-icon {
    font-size: var(--font-size-base);
    color: var(--color-primary);
}

.contact-link {
    color: var(--color-gray-700);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.contact-link:hover {
    color: var(--color-primary);
}

.contact-text {
    color: var(--color-gray-600);
}

.header__main {
    padding: var(--spacing-lg) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.header__logo {
    flex-shrink: 0;
}

.logo-link {
    display: block;
    transition: transform var(--transition-fast);
}

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

.logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.header__company {
    flex-grow: 1;
    text-align: center;
}

.company-name {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    margin: 0 0 var(--spacing-xs) 0;
    line-height: var(--line-height-tight);
}

.company-description {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-secondary);
    margin: 0;
    letter-spacing: 0.5px;
}

.header__nav {
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background-color: var(--color-gray-700);
    margin: 2px 0;
    transition: all var(--transition-fast);
    transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--spacing-lg);
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: all var(--transition-fast);
    transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary);
    background-color: var(--color-gray-50);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Мобильное меню */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .header__contacts {
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .company-name {
        font-size: var(--font-size-xl);
    }
    
    .company-description {
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 768px) {
    .header__top {
        padding: var(--spacing-xs) 0;
    }
    
    .header__contacts {
        gap: var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 2px;
    }
    
    .header__main {
        padding: var(--spacing-md) 0;
        flex-wrap: wrap;
    }
    
    .header__company {
        order: -1;
        width: 100%;
        margin-bottom: var(--spacing-md);
    }
    
    .company-name {
        font-size: var(--font-size-lg);
    }
    
    .company-description {
        font-size: var(--font-size-xs);
    }
    
    .logo-image {
        height: 50px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--color-white);
        flex-direction: column;
        padding: var(--spacing-3xl) var(--spacing-lg) var(--spacing-lg);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal);
        z-index: var(--z-modal);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
        text-align: center;
        font-size: var(--font-size-lg);
    }
    
    .nav-link::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .header__contacts {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .contact-item {
        font-size: 11px;
    }
    
    .company-name {
        font-size: var(--font-size-base);
    }
    
    .company-description {
        font-size: 11px;
    }
    
    .logo-image {
        height: 40px;
    }
    
    .nav-menu {
        width: 280px;
        padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-md);
    }
}

/* Анимации для шапки */
.header-animate {
    animation: slideInDown 0.8s ease-out;
}

.logo-animate {
    animation: bounceIn 1s ease-out 0.2s both;
}

.company-animate {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.nav-animate {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.contacts-animate .contact-item {
    animation: fadeInDown 0.6s ease-out both;
}

.contacts-animate .contact-item:nth-child(1) { animation-delay: 0.1s; }
.contacts-animate .contact-item:nth-child(2) { animation-delay: 0.2s; }
.contacts-animate .contact-item:nth-child(3) { animation-delay: 0.3s; }

/* Эффекты при скролле */
.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.header.scrolled .logo-image {
    transform: scale(0.9);
}

.header.scrolled .company-name {
    font-size: var(--font-size-xl);
}

.header.scrolled .company-description {
    font-size: var(--font-size-sm);
}

/* Состояния загрузки */
.header.loading {
    opacity: 0.7;
}

.header.loading * {
    pointer-events: none;
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
    .header,
    .nav-link,
    .logo-link,
    .nav-toggle span,
    .nav-menu {
        transition: none;
    }
    
    .header-animate,
    .logo-animate,
    .company-animate,
    .nav-animate,
    .contacts-animate .contact-item {
        animation: none;
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .header {
        background: var(--color-gray-900);
        color: var(--color-white);
    }
    
    .header__top {
        background: var(--color-gray-800);
        border-bottom-color: var(--color-gray-700);
    }
    
    .contact-link {
        color: var(--color-gray-300);
    }
    
    .contact-link:hover {
        color: var(--color-primary-light);
    }
    
    .contact-text {
        color: var(--color-gray-400);
    }
    
    .company-name {
        color: var(--color-primary-light);
    }
    
    .company-description {
        color: var(--color-gray-300);
    }
    
    .nav-link {
        color: var(--color-gray-300);
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--color-primary-light);
        background-color: var(--color-gray-800);
    }
    
    .nav-toggle span {
        background-color: var(--color-gray-300);
    }
    
    .nav-menu {
        background: var(--color-gray-900);
    }
}
