/**
 * Централизованные стили для динамической шапки сайта
 * КОНТЕНТЗАВОД - header.css
 */

/* === NAVIGATION MENU GLASSMORPHISM === */
.nav-menu {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 1200px;
    height: 60px;
    z-index: 1000;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    background: rgba(252, 251, 252, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    padding: 0 40px;
}

.nav-menu.scrolled {
    background: rgba(252, 251, 252, 0.7);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    top: 10px;
}

/* Скрытие шапки при скролле вниз (опционально) */
.nav-menu.nav-hidden {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
    padding: 0;
    gap: 20px;
}

/* === BRAND/LOGO === */
.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo {
    font-family: 'Unbounded', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #000000;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.fittin-badge {
    transition: all 0.3s ease;
    display: inline-block;
}

.nav-brand:hover .fittin-badge {
    color: #000000 !important;
}

.fittin-badge:hover {
    transform: scale(1.05);
}

/* === NAVIGATION LINKS === */
.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #3E3E3E;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    padding: 8px 0;
    white-space: nowrap;
}

.nav-link:hover {
    color: #007670;
    transform: translateY(-1px);
}

/* Активная страница */
.nav-link.active {
    color: #007670;
    font-weight: 600;
}

/* Активная секция на главной странице */
.nav-link.active-section {
    color: #007670;
}

/* Подчеркивание активной ссылки */
.nav-link.active::after,
.nav-link.active-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #007670, #00a39e);
    border-radius: 2px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

/* === CTA BUTTONS === */
/* Контейнер кнопок внутри nav-links (для мобильного меню) */
.nav-links .nav-button-container {
    display: none; /* Скрыты по умолчанию */
}

/* Контейнер кнопок на десктопе */
.nav-button-desktop {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav-button {
    font-family: 'Unbounded', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #007670;
    background: transparent;
    border: 2px solid #007670;
    border-radius: 20px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-button:hover {
    background: #007670;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 118, 112, 0.3);
}

.nav-button:active {
    transform: translateY(0);
}

.nav-button-login {
    font-family: 'Unbounded', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #007670, #005b58);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 118, 112, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.nav-button-login:hover {
    background: linear-gradient(135deg, #005b58, #004a47);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 118, 112, 0.4);
}

.nav-button-login:active {
    transform: translateY(0);
}

/* === MOBILE TOGGLE === */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    gap: 4px;
}

.nav-mobile-toggle span {
    width: 24px;
    height: 2px;
    background-color: #3E3E3E;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.nav-mobile-toggle.active span:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
}

.nav-mobile-toggle.active span:nth-child(2) {
    transform: translateY(-3px) rotate(-45deg);
}

/* === RESPONSIVE DESIGN === */

/* Планшеты и небольшие десктопы */
@media (max-width: 1200px) {
    .nav-menu {
        padding: 0 30px;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 14px;
    }
}

/* Принудительная мобильная версия когда элементы не помещаются */
.nav-menu.force-mobile .nav-links {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: calc(100% - 30px);
    background: rgba(252, 251, 252, 1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: flex-start;
    gap: 24px;
    padding: 30px 20px 20px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.nav-menu.force-mobile.active .nav-links {
    opacity: 1;
    visibility: visible;
}

.nav-menu.force-mobile .nav-link {
    font-size: 16px;
    color: #000000;
    padding: 8px 0;
    text-align: center;
}

.nav-menu.force-mobile .nav-link.active::after,
.nav-menu.force-mobile .nav-link.active-section::after {
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
}

/* В force-mobile скрываем десктопные кнопки */
.nav-menu.force-mobile .nav-button-desktop {
    display: none;
}

/* Показываем кнопки внутри мобильного меню при активном состоянии */
.nav-menu.force-mobile.active .nav-links .nav-button-container {
    display: flex;
    flex-direction: row; /* В одну строку */
    gap: 10px;
    width: 100%;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 118, 112, 0.1);
}

.nav-menu.force-mobile.active .nav-links .nav-button {
    flex: 1; /* Занимают равную ширину */
    font-size: 14px;
    padding: 12px 20px;
    text-align: center;
    justify-content: center;
}

.nav-menu.force-mobile.active .nav-links .nav-button-login {
    flex: 1; /* Занимают равную ширину */
    font-size: 14px;
    padding: 12px 20px;
    text-align: center;
    justify-content: center;
}

.nav-menu.force-mobile .nav-mobile-toggle {
    display: flex;
}

/* Переход на мобильную версию когда элементы не помещаются */
@media (max-width: 950px) {
    .nav-menu {
        top: 15px;
        height: 50px;
        width: calc(100% - 30px);
        max-width: calc(100% - 30px);
        padding: 0 20px;
        border-radius: 25px;
    }
    
    .nav-menu.scrolled {
        top: 8px;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 30px);
        max-width: calc(100% - 30px);
        background: rgba(252, 251, 252, 1);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        justify-content: flex-start;
        gap: 24px;
        padding: 30px 20px;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active .nav-links {
        opacity: 1;
        visibility: visible;
    }
    
    .nav-link {
        font-size: 16px;
        color: #000000;
        padding: 8px 0;
        text-align: center;
    }
    
    .nav-link.active::after,
    .nav-link.active-section::after {
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
    }
    
    /* Скрываем десктопные кнопки */
    .nav-button-desktop {
        display: none;
    }
    
    /* Показываем кнопки внутри мобильного меню */
    .nav-menu.active .nav-links .nav-button-container {
        display: flex;
        flex-direction: row; /* В одну строку */
        gap: 10px;
        width: 100%;
        margin-top: 8px;
        padding-top: 20px;
        border-top: 1px solid rgba(0, 118, 112, 0.1);
    }
    
    .nav-menu.active .nav-links .nav-button {
        flex: 1; /* Занимают равную ширину */
        font-size: 14px;
        padding: 12px 20px;
        text-align: center;
        justify-content: center;
    }
    
    .nav-menu.active .nav-links .nav-button-login {
        flex: 1; /* Занимают равную ширину */
        font-size: 14px;
        padding: 12px 20px;
        text-align: center;
        justify-content: center;
    }
    
    .nav-mobile-toggle {
        display: flex;
    }
    
    .nav-logo {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        top: 10px;
        height: 45px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        padding: 0 16px;
        border-radius: 22px;
    }
    
    .nav-menu.scrolled {
        top: 5px;
    }
    
    .nav-links {
        top: 60px;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        padding: 25px 15px;
        gap: 20px;
    }
    
    .nav-link {
        font-size: 15px;
    }
    
    .nav-logo {
        font-size: 14px;
    }
    
    .nav-mobile-toggle span {
        width: 24px;
        height: 2px;
    }
    
    /* Кнопки друг под другом на маленьких экранах */
    .nav-menu.active .nav-links .nav-button-container,
    .nav-menu.force-mobile.active .nav-links .nav-button-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-menu.active .nav-links .nav-button,
    .nav-menu.active .nav-links .nav-button-login,
    .nav-menu.force-mobile.active .nav-links .nav-button,
    .nav-menu.force-mobile.active .nav-links .nav-button-login {
        width: 100%;
        font-size: 14px;
        padding: 10px 16px;
    }
}

/* === SMOOTH SCROLL PADDING === */
html {
    scroll-padding-top: 100px;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 80px;
    }
}

@media (max-width: 480px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* === ДИНАМИЧЕСКИЙ КОНТЕЙНЕР ШАПКИ === */
#dynamic-header {
    /* Контейнер не требует дополнительных стилей */
    /* Все стили применяются к nav-menu внутри */
}

/* === ACCESSIBILITY === */
.nav-link:focus,
.nav-button:focus,
.nav-button-login:focus,
.nav-mobile-toggle:focus {
    outline: 2px solid #007670;
    outline-offset: 2px;
}

/* === PRINT STYLES === */
@media print {
    .nav-menu {
        display: none;
    }
}

