/* assets/css/header-styles.css - Полная исправленная версия */

/* ========== RESET ДЛЯ HEADER ========== */
.fc-header * {
    box-sizing: border-box;
}

/* ========== ОСНОВНОЙ HEADER ========== */
.fc-header {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1050;
    border-bottom: 1px solid #e1e5e9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fc-header__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== DESKTOP HEADER ========== */
.fc-header__desktop {
    display: block;
}

.fc-header__mobile {
    display: none;
}

/* Верхняя панель */
.fc-header__top {
    background: #f8fafc;
    padding: 10px 0;
    border-bottom: 1px solid #e1e5e9;
    font-size: 13px;
}

.fc-header__top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fc-header__contacts {
    display: flex;
    gap: 28px;
}

.fc-contact {
    color: #64748b;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.fc-contact:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

.fc-contact__icon {
    font-size: 14px;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.fc-contact:hover .fc-contact__icon {
    filter: grayscale(0);
}

.fc-header__actions {
    display: flex;
    align-items: center;
}

.fc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fc-btn--primary {
    background: #000000;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.fc-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    background: #1a1a1a;
}

.fc-btn--dark {
    background: #1a1a1a;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.fc-btn--dark:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    background: #000000;
}

.fc-btn--small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Основная панель */
.fc-header__main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 40px;
}

/* Логотип */
.fc-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.fc-logo:hover {
    transform: scale(1.02);
}

.fc-logo__title {
    font-size: 28px;
    font-weight: 900;
    color: #000000;
    margin: 0;
    letter-spacing: -0.5px;
    display: block;
}

.fc-logo__subtitle {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Навигация */
.fc-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.fc-nav__list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 40px;
}

.fc-nav__item {
    position: relative;
}

.fc-nav__link {
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 0;
    position: relative;
    transition: color 0.3s ease;
}

.fc-nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #000000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fc-nav__link:hover {
    color: #000000;
}

.fc-nav__link:hover::after,
.fc-nav__link--active::after {
    width: 100%;
}

.fc-nav__link--active {
    color: #000000;
}

/* Поиск */
.fc-search {
    position: relative;
}

.fc-search__form {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 280px;
}

.fc-search__form:focus-within {
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.fc-search__input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #334155;
    outline: none;
}

.fc-search__button {
    padding: 10px 14px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.fc-search__button:hover {
    color: #000000;
}

/* ========== MOBILE HEADER ========== */
.fc-header__mobile-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.fc-logo--mobile .fc-logo__title {
    font-size: 26px;
}

.fc-logo--mobile .fc-logo__subtitle {
    display: none;
}

.fc-mobile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-search-toggle {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #64748b;
}

.fc-search-toggle:hover {
    background: #f1f5f9;
    color: #000000;
}

.fc-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.fc-hamburger:hover {
    background: #f1f5f9;
}

.fc-hamburger__line {
    width: 24px;
    height: 3px;
    background: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.fc-hamburger--active .fc-hamburger__line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.fc-hamburger--active .fc-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.fc-hamburger--active .fc-hamburger__line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Search */
.fc-mobile-search {
    display: none;
    padding: 16px 0;
    border-top: 1px solid #e1e5e9;
    animation: slideDown 0.3s ease;
}

.fc-mobile-search--active {
    display: block;
}

.fc-mobile-search__form {
    display: flex;
    gap: 12px;
}

.fc-mobile-search__input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    color: #334155;
    background: #ffffff;
    transition: all 0.3s ease;
}

.fc-mobile-search__input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.fc-mobile-search__button {
    padding: 14px 20px;
    background: #000000;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.fc-mobile-search__button:hover {
    background: #1a1a1a;
    transform: translateY(-1px);
}

/* ========== MOBILE NAVIGATION - ИСПРАВЛЕННАЯ ВЕРСИЯ ========== */

/* КРИТИЧЕСКИ ВАЖНО: правильный z-index и pointer-events */
.fc-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1998; /* УВЕЛИЧИВАЕМ z-index */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: none; /* ВАЖНО: отключаем события по умолчанию */
}

.fc-mobile-overlay--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Включаем события только когда активен */
}

.fc-mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    z-index: 1999; /* МАКСИМАЛЬНЫЙ z-index для навигации */
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

.fc-mobile-nav--active {
    right: 0;
}

.fc-mobile-nav__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8fafc;
    position: relative;
    z-index: 20; /* Дополнительный z-index для заголовка */
}

.fc-mobile-nav__title {
    font-weight: 700;
    font-size: 18px;
    color: #1e293b;
}

.fc-mobile-nav__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #64748b;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 21; /* Максимальный z-index для кнопки закрытия */
}

.fc-mobile-nav__close:hover {
    background: #e2e8f0;
    color: #334155;
}

.fc-mobile-nav__list {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    position: relative;
    z-index: 15; /* z-index для списка */
}

.fc-mobile-nav__item {
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    z-index: 16; /* z-index для элементов списка */
}

.fc-mobile-nav__link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 17; /* МАКСИМАЛЬНЫЙ z-index для ссылок */
    background: transparent; /* Явно указываем прозрачный фон */
    cursor: pointer; /* Явно указываем курсор */
}

.fc-mobile-nav__link:hover {
    background: #f8fafc !important;
    color: #000000 !important;
    transform: translateX(4px);
}

.fc-mobile-nav__link:active {
    background: #e2e8f0 !important;
}

.fc-mobile-nav__icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    position: relative;
    z-index: 18;
}

.fc-mobile-nav__divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e1e5e9 50%, transparent 100%);
    margin: 12px 24px;
}

.fc-mobile-nav__cta {
    color: white !important;
    background: #000000 !important;
    font-weight: 700 !important;
    margin: 8px 16px;
    border-radius: 12px;
}

.fc-mobile-nav__cta:hover {
    background: #1a1a1a !important;
    transform: translateX(0) !important;
}

.fc-mobile-nav__footer {
    padding: 24px;
    border-top: 1px solid #e1e5e9;
    background: #f8fafc;
    position: relative;
    z-index: 15;
}

.fc-mobile-contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fc-mobile-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    z-index: 16;
}

.fc-mobile-contact:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

.fc-mobile-contact__icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* КРИТИЧЕСКИ ВАЖНО: правильная блокировка скролла */
body.fc-mobile-nav-open {
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
    /* НЕ используем overflow: hidden - это может блокировать клики */
}

/* ========== ANIMATIONS ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .fc-header__main {
        gap: 20px;
    }
    
    .fc-search__form {
        width: 250px;
    }
    
    .fc-nav__list {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .fc-header__desktop {
        display: none;
    }
    
    .fc-header__mobile {
        display: block;
    }
    
    .fc-header__container {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .fc-mobile-nav {
        width: 100%;
        right: -100%;
    }
    
    .fc-logo--mobile .fc-logo__title {
        font-size: 22px;
    }
    
    .fc-mobile-search__input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    .fc-header *,
    .fc-header *::before,
    .fc-header *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
.fc-header a:focus,
.fc-header button:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .fc-header {
        border-bottom-width: 2px;
    }
    
    .fc-nav__link::after {
        height: 4px;
    }
}

/* ДОПОЛНИТЕЛЬНЫЕ ИСПРАВЛЕНИЯ ДЛЯ КЛИКАБЕЛЬНОСТИ */
.fc-mobile-nav__link * {
    pointer-events: none; /* Отключаем события на дочерних элементах */
}

.fc-mobile-nav__link {
    pointer-events: auto !important; /* Включаем события только на самой ссылке */
}

/* ===== МОБИЛЬНОЕ МЕНЮ НА ЧИСТОМ CSS для FindCert ===== */
/* Добавить в конец файла header-styles.css */

/* ===== СКРЫВАЕМ СТАРОЕ JS МЕНЮ ===== */
.fc-mobile-overlay,
.fc-mobile-nav {
    display: none !important;
}

/* ===== CHECKBOX TRICK ===== */
.css-menu-toggle {
    display: none;
}

/* ===== ОБНОВЛЯЕМ ГАМБУРГЕР ===== */
.fc-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2000;
}

.fc-hamburger:hover {
    background: #f1f5f9;
}

.fc-hamburger__line {
    width: 24px;
    height: 3px;
    background: #475569;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    transform-origin: center;
}

/* ===== АНИМАЦИЯ ГАМБУРГЕРА ===== */
.css-menu-toggle:checked + .fc-hamburger .fc-hamburger__line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.css-menu-toggle:checked + .fc-hamburger .fc-hamburger__line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.css-menu-toggle:checked + .fc-hamburger .fc-hamburger__line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== CSS OVERLAY ===== */
.css-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1998;
    backdrop-filter: blur(4px);
}

.css-menu-toggle:checked ~ .css-menu-overlay {
    opacity: 1;
    visibility: visible;
}

/* ===== CSS МОБИЛЬНОЕ МЕНЮ ===== */
.css-mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    z-index: 1999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.css-menu-toggle:checked ~ .css-mobile-nav {
    right: 0;
}

/* ===== ЗАГОЛОВОК МЕНЮ ===== */
.css-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5e9;
    background: #f8fafc;
    position: relative;
    z-index: 20;
}

.css-menu-title {
    font-weight: 700;
    font-size: 18px;
    color: #1e293b;
}

.css-menu-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #64748b;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 21;
}

.css-menu-close:hover {
    background: #e2e8f0;
    color: #334155;
}

/* ===== СПИСОК МЕНЮ ===== */
.css-menu-list {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    position: relative;
    z-index: 15;
}

.css-menu-item {
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    z-index: 16;
}

.css-menu-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    text-decoration: none;
    color: #475569;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 17;
    background: transparent;
    cursor: pointer;
}

.css-menu-link:hover {
    background: #f8fafc !important;
    color: #000000 !important;
    transform: translateX(4px);
}

.css-menu-link:active {
    background: #e2e8f0 !important;
}

.css-menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    position: relative;
    z-index: 18;
}

/* ===== РАЗДЕЛИТЕЛЬ ===== */
.css-menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #e1e5e9 50%, transparent 100%);
    margin: 12px 24px;
}

/* ===== CTA КНОПКА ===== */
.css-menu-cta {
    color: white !important;
    background: #000000 !important;
    font-weight: 700 !important;
    margin: 8px 16px;
    border-radius: 12px;
}

.css-menu-cta:hover {
    background: #1a1a1a !important;
    transform: translateX(0) !important;
}

/* ===== CTA ТЕМНАЯ КНОПКА (для Оформить документ) ===== */
.css-menu-cta-dark {
    color: white !important;
    background: #1a1a1a !important;
    font-weight: 700 !important;
    margin: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
}

.css-menu-cta-dark:hover {
    background: #000000 !important;
    transform: translateX(0) !important;
}

/* ===== ФУТЕР МЕНЮ ===== */
.css-menu-footer {
    padding: 24px;
    border-top: 1px solid #e1e5e9;
    background: #f8fafc;
    position: relative;
    z-index: 15;
}

.css-menu-contacts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.css-menu-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    z-index: 16;
}

.css-menu-contact:hover {
    color: #000000;
    background: rgba(0, 0, 0, 0.05);
}

.css-menu-contact-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ===== ЗАКРЫТИЕ ПО КЛИКУ НА OVERLAY ===== */
.css-menu-overlay-close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ===== БЛОКИРОВКА СКРОЛЛА ===== */
.css-menu-toggle:checked ~ .main-content {
    position: fixed;
    width: 100%;
    overflow: hidden;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 320px) {
    .css-mobile-nav {
        width: 100%;
        right: -100%;
    }
    
    .css-menu-toggle:checked ~ .css-mobile-nav {
        right: 0;
    }
}

/* ===== СКРЫВАЕМ НА ДЕСКТОПЕ ===== */
@media (min-width: 769px) {
    .css-menu-toggle,
    .css-menu-overlay,
    .css-mobile-nav {
        display: none !important;
    }
}