/* common.css - общие компоненты, анимации и навигация */
/* ==================== АНИМАЦИИ ==================== */
@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;
    }
}

@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 fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes slideFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==================== ШАПКА И НАВИГАЦИЯ ==================== */
.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 > * {
    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; }

/* Бренд и логотип */
.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;
}

.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;
    overflow: hidden;
}

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

.contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(30, 58, 138, 0.05), transparent);
    transition: var(--transition);
}

.contact-item:hover::before {
    left: 100%;
}

.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);
    position: relative;
    z-index: 2;
}

.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);
    position: relative;
    z-index: 2;
}

.contact-info {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.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);
    position: relative;
    z-index: 2;
}

/* Действия и кнопки в навигации */
.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;
}

/* ==================== ВТОРАЯ НАВИГАЦИОННАЯ СТРОКА ==================== */
.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%;
}

/* Стили для кнопки "НАЗАД НА ГЛАВНУЮ" */
.sub-nav-button.back-button {
    background: var(--gradient-primary);
    border: 1px solid var(--primary-blue);
    color: var(--white);
    min-width: 100px;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.15);
}

.sub-nav-button.back-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px) translateX(-2px);
    box-shadow: 0 3px 8px rgba(30, 58, 138, 0.25);
}

.sub-nav-button.back-button .sub-nav-button__icon {
    background: rgba(255, 255, 255, 0.2);
}

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

.sub-nav-button.back-button.active {
    background: var(--gradient-gold);
    border-color: var(--accent-gold);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.15);
}

.sub-nav-button.back-button.active:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}


/* ==================== ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ ==================== */
.page-content {
    margin-top: 102px;
    background-color: #f8f9fa;
    padding: 0;
}

.hero-section {
    padding: 40px 0;
    background: white;
    animation: fadeIn 0.6s ease-out forwards;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 30px;
    color: #1a1a1a;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.1s;
}

.hero-title .title-accent {
    color: #2d5be3;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: #1a1a1a;
    position: relative;
    padding-bottom: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.1s;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #2d5be3;
    border-radius: 2px;
}

.content-section {
    padding: 60px 0;
    animation: fadeIn 0.6s ease-out forwards;
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 768px) {
    .page-content {
        margin-top: 70px;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }
    
    .content-section {
        padding: 40px 0;
    }

    
    .document-text {
        font-size: 0.9rem;
    }
    
    .document-download {
        width: 34px;
        height: 34px;
        margin-left: 0.5rem;
    }
}

.leaflet-control-attribution {
    font-size: 11px;
    line-height: 1.35;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(2px);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.leaflet-control-attribution a {
    color: #334155;
}


/* ===== desktop-only header logo enlargement ===== */
@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;
    }
}
