/* ===== HEADER CSS VARIABLES ===== */
:root {
    /* Colors needed for header */
    --primary: #7C3AED;
    --primary-dark: #6D28D9;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-200: #E5E7EB;
    --gray-600: #4B5563;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    
    /* Shadows */
    --shadow-primary: 0 4px 14px 0 rgba(124, 58, 237, 0.25);
    --shadow-primary-hover: 0 8px 20px 0 rgba(124, 58, 237, 0.35);
    --shadow-header: 0 4px 12px rgba(124, 58, 237, 0.15);
    
    /* Border radius */
    --radius-lg: 0.75rem;
}

/* ===== HEADER CONTAINER ===== */
header .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER STYLES ===== */
header {
    font-family: 'Inter', 'Inter-fallback', sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

header.scrolled {
    box-shadow: var(--shadow-header);
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

header .logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

header .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

header .nav-links {
    font-family: 'Inter', 'Inter-fallback', sans-serif !important;
    display: flex;
    gap: 36px;
    list-style: none;
    margin: 0;
    padding: 0;
}

header .nav-links a {
    font-family: 'Inter', 'Inter-fallback', sans-serif !important;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

header .nav-links a:hover {
    color: var(--primary);
}

header .nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

header .nav-links a:hover::after {
    width: 100%;
}

/* ===== DROPDOWN STYLES ===== */
header .dropdown {
    position: relative;
}

header .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

header .dropdown-toggle:hover::after {
    width: 0; /* Убираем подчеркивание у dropdown toggle */
}

header .dropdown-arrow {
    transition: transform 0.3s ease;
}

header .dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

header .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

header .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-right: none;
    border-bottom: none;
    transform: translateX(-50%) rotate(45deg);
}

header .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

header .dropdown-menu a {
    display: block;
    padding: 9px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

header .dropdown-menu a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

header .dropdown-menu a::after {
    display: none; /* Убираем подчеркивание у пунктов dropdown */
}

/* ===== HEADER CTA ===== */
header .nav-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== MOBILE MENU ===== */
header .mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    /* Убираем серое подсвечивание при тапе на мобильных */
    -webkit-tap-highlight-color: transparent;
}

header .mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-900);
    margin: 6px 0;
    /* Убрана анимация transition */
}

/* ===== HEADER BUTTONS ===== */
header .nav-cta .btn {
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

header .nav-cta .btn-primary {
    font-family: 'Inter', 'Inter-fallback', sans-serif !important;
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

header .nav-cta .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-hover);
}

header .nav-cta .btn-secondary {
    font-family: 'Inter', 'Inter-fallback', sans-serif !important;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--gray-200);
}

header .nav-cta .btn-secondary:hover {
    border-color: var(--primary);
    background: var(--gray-50);
}

/* ===== RESPONSIVE HEADER ===== */
@media (max-width: 1150px) {
    header .mobile-menu-toggle {
        display: block;
    }
    
    header .nav-links,
    header .nav-cta .btn-primary {
        display: none;
    }
}

@media (max-width: 768px) {
    header .nav-cta .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* ===== MOBILE MENU STYLES ===== */
/* Гамбургер остается неизменным в любом состоянии */

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100%;
    background: white;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0,0,0,0.1);
}

.mobile-menu::-webkit-scrollbar {
    width: 4px;
}

.mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

.mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.2);
    border-radius: 2px;
}

.mobile-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.4);
}

.mobile-menu.active {
    right: 0;
}

.menu-header {
    padding: 24px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FAFBFC;
}

.menu-title {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    /* Убираем серое подсвечивание при тапе на мобильных */
    -webkit-tap-highlight-color: transparent;
}

.close-btn:hover {
    background: #7C3AED;
    border-color: #7C3AED;
    color: white;
    transform: rotate(90deg);
}

.close-btn:hover svg {
    stroke: white;
}

.menu-content {
    padding: 10px 20px;
}

.menu-nav {
    list-style: none;
    margin-bottom: 40px;
    padding: 0;
}

.menu-nav li {
    margin-bottom: 0;
    border-bottom: 1px solid #f0f0f0;
}

.menu-nav li:last-child {
    border-bottom: none;
}

.menu-nav a {
    display: block;
    padding: 18px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 16px;
    position: relative;
}

.menu-nav a:hover {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
    padding-left: 30px;
}

.menu-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #7C3AED;
    transition: height 0.3s ease;
}

.menu-nav a:hover::after {
    height: 30px;
}

/* Animation for menu items */
.mobile-menu.active .menu-nav li {
    opacity: 0;
    transform: translateX(20px);
    animation: slideIn 0.3s ease forwards;
}

.mobile-menu.active .menu-nav li:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.active .menu-nav li:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu.active .menu-nav li:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu.active .menu-nav li:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu.active .menu-nav li:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu.active .menu-nav li:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu.active .menu-nav li:nth-child(7) { animation-delay: 0.4s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.mobile-menu .btn {
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 16px;
    width: 100%;
    display: block;
}

.mobile-menu .btn-primary {
    background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
    border: none;
}

.mobile-menu .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.35);
}

.mobile-menu .btn-secondary {
    background: white;
    color: #7C3AED;
    border: 2px solid #E5E7EB;
}

.mobile-menu .btn-secondary:hover {
    border-color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
}

.menu-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 30px;
}

.contact-info {
    margin-bottom: 25px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    color: #6B7280;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item:hover {
    color: #7C3AED;
}

.contact-item span {
    color: #7C3AED;
}

.social-links {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-link {
    width: 44px;
    height: 44px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
}

.social-link:hover svg {
    fill: white;
}

header .dropdown-arrow {
    margin-right: -11px;
    transition: transform 0.3s ease;
}

header .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 16px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    min-width: 220px; /* Увеличено с 180px */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

header .dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
    white-space: nowrap; /* Запрещаем перенос текста */
}

/* ===== MOBILE MENU ACCORDION STYLES ===== */
/* Accordion item */
.menu-accordion {
    border-bottom: 1px solid #f0f0f0;
}

/* Accordion toggle button */
.menu-accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    font-family: inherit;
    position: relative;
}

.menu-accordion-toggle:hover {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
    padding-left: 30px;
}

.menu-accordion-toggle::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #7C3AED;
    transition: height 0.3s ease;
}

.menu-accordion-toggle:hover::after {
    height: 30px;
}

/* Accordion arrow */
.menu-accordion-arrow {
    transition: transform 0.3s ease;
    color: #7C3AED;
    flex-shrink: 0;
}

.menu-accordion-toggle.active .menu-accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion content */
.menu-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-accordion-content.active {
    max-height: 200px;
}

.menu-accordion-content a {
    display: block;
    padding: 14px 20px 14px 40px;
    color: #666;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.menu-accordion-content a:hover {
    color: #7C3AED;
    background: rgba(124, 58, 237, 0.05);
    border-left-color: #7C3AED;
}

/* Remove border from last accordion item link */
.menu-accordion-content a:last-child {
    border-bottom: none;
}

/* Animation for accordion items */
.mobile-menu.active .menu-accordion-content.active a {
    opacity: 0;
    transform: translateX(20px);
    animation: accordionSlideIn 0.3s ease forwards;
}

.mobile-menu.active .menu-accordion-content.active a:nth-child(1) { 
    animation-delay: 0.1s; 
}
.mobile-menu.active .menu-accordion-content.active a:nth-child(2) { 
    animation-delay: 0.15s; 
}
.mobile-menu.active .menu-accordion-content.active a:nth-child(3) { 
    animation-delay: 0.2s; 
}

@keyframes accordionSlideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .menu-accordion-toggle {
        padding: 16px 20px;
    }
    
    .menu-accordion-content a {
        padding: 12px 20px 12px 35px;
        font-size: 14px;
    }
}