/* home-header.css - шапка и навигация главной */

/* Базовый фундамент вынесен в foundation.css */
/* Общие анимации вынесены в home-animations.css */

/* ==================== 3. НАВИГАЦИЯ ==================== */
.header {
    background: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(40px);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
    height: 102px;
}

/* Основная навигационная панель */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    gap: 2rem;
    height: 70px;
    border-bottom: 1px solid var(--gray-100);
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-container {
    position: relative;
    padding: 0.5rem;
}

.nav__logo {
    height: 36px;
    width: auto;
    border-radius: 8px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 12px rgba(30, 58, 138, 0.15));
}

.brand-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: 10px;
    opacity: 0.1;
    filter: blur(8px);
    animation: glowPulse 3s ease-in-out infinite;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.nav__company-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.05em;
    line-height: 1;
}

.nav__tagline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--gray-600);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.nav__contacts {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

/* Плавное появление */
.nav > * {
    animation: fadeInDown 0.8s ease-out both;
}

.nav__brand { animation-delay: 0.1s; }
.nav__contacts { animation-delay: 0.2s; }
.nav__actions { animation-delay: 0.3s; }

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
}

.contact-item:hover {
    background: var(--gray-50);
}

.contact-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 8px;
    transition: var(--transition);
}

.contact-item:hover .contact-icon-wrapper {
    background: var(--gradient-primary);
    transform: scale(1.05);
}

.contact-item:hover .contact-icon {
    color: var(--white);
}

.contact-icon {
    width: 18px;
    height: 18px;
    color: var(--gray-600);
    transition: var(--transition);
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.contact-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

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

.contact-divider {
    width: 1px;
    height: 32px;
    background: var(--gray-200);
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.trust-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.875rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.trust-indicator:hover {
    background: var(--white);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.trust-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.1), transparent);
    transition: var(--transition);
}

.trust-indicator:hover::before {
    left: 100%;
}

.trust-stars {
    display: flex;
    gap: 0.1rem;
}

.trust-star {
    color: var(--accent-gold);
    font-size: 0.8rem;
    animation: starTwinkle 2s ease-in-out infinite;
}

.trust-star:nth-child(2) { animation-delay: 0.2s; }
.trust-star:nth-child(3) { animation-delay: 0.4s; }
.trust-star:nth-child(4) { animation-delay: 0.6s; }
.trust-star:nth-child(5) { animation-delay: 0.8s; }

.trust-text {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

.trust-indicator:hover .trust-text {
    color: var(--accent-gold);
    font-weight: 600;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn--primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-icon {
    width: 16px;
    height: 16px;
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ==================== 3.1. Вторая навигационная строка ==================== */
.sub-nav {
    background: transparent;
    position: relative;
    z-index: 999;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-nav__content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.2rem 0;
    justify-content: flex-start;
    margin-left: 0;
    padding-left: 0;
}

.sub-nav__buttons {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    position: absolute;
    left: 0;
    margin-left: calc(50% - 600px);
    padding-left: 1rem;
}

/* Анимация появления кнопок поднавигации */
.sub-nav-button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.68rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    white-space: nowrap;
    min-width: 75px;
    justify-content: center;
    height: 24px;
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    animation: slideUpFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Задержки для каждой кнопки: учитываем обычные ссылки и обёртку выпадающего меню "Услуги" */
.sub-nav__buttons > .sub-nav-button:nth-child(1) { animation-delay: 0.4s; }
.sub-nav__buttons > .sub-nav-button:nth-child(2) { animation-delay: 0.5s; }
.sub-nav__buttons > .sub-nav-button:nth-child(3) { animation-delay: 0.6s; }
.sub-nav__buttons > .sub-nav-services:nth-child(3) .sub-nav-button { animation-delay: 0.6s; }
.sub-nav__buttons > .sub-nav-button:nth-child(4) { animation-delay: 0.7s; }
.sub-nav__buttons > .sub-nav-services:nth-child(4) .sub-nav-button { animation-delay: 0.7s; }
.sub-nav__buttons > .sub-nav-button:nth-child(5) { animation-delay: 0.8s; }

.sub-nav-button:hover {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.15);
}

.sub-nav-button:hover .sub-nav-button__icon {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sub-nav-button:hover .sub-nav-button__icon svg {
    color: var(--white);
}

.sub-nav-button__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--gradient-light);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    transform-origin: center;
    animation: iconAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
    transform: scale(0);
}

.sub-nav-button__icon svg {
    width: 10px;
    height: 10px;
    color: var(--primary-blue);
    transition: all 0.3s ease;
    animation: iconRotateIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.4s;
    opacity: 0;
    transform: rotate(-90deg);
}

.sub-nav-button__text {
    position: relative;
    z-index: 1;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-size: 0.65rem;
    opacity: 0;
    transform: translateX(-5px);
    animation: textAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 0.5s;
}

.sub-nav-button.active {
    background: var(--gradient-primary);
    color: var(--white);
    border-color: var(--primary-blue);
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.15);
}

.sub-nav-button.active .sub-nav-button__icon {
    background: rgba(255, 255, 255, 0.2);
    animation: iconBounce 0.6s ease;
}

.sub-nav-button.active .sub-nav-button__icon svg {
    color: var(--white);
}

/* Эффект вспышки при наведении */
.sub-nav-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: var(--transition);
}

.sub-nav-button:hover::before {
    left: 100%;
}

/* Анимации для кнопок навигации */
@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconAppear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes iconRotateIn {
    from {
        opacity: 0;
        transform: rotate(-90deg);
    }
    to {
        opacity: 1;
        transform: rotate(0deg);
    }
}

@keyframes textAppear {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}


/* Анимации */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.15;
        transform: translate(-50%, -50%) scale(1.05);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@media (min-width: 769px) {
    .logo-container {
        padding: 0.7rem;
    }

    .nav__logo {
        height: 54px;
        border-radius: 12px;
    }

    .brand-glow {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }
}
