* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
 
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px; /* Уменьшаем высоту */
    background: #6259c3; /* Оптимальный фиолетовый, гармонирующий с градиентами */
    box-shadow: 0 3px 10px rgba(98, 89, 195, 0.15); /* Тень в том же цвете для единства */
    border-bottom: none; /* Убираем бордер для современного вида */
    color: #fff; /* Меняем цвет текста для лучшей читаемости */
    padding: 0 20px; /* Отступы по бокам для мобильной версии */
    flex-wrap: nowrap; /* Запрещаем перенос элементов */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
 
@media (min-width: 769px) {
    .header {
        padding: 0 200px; /* Увеличиваем отступы для десктопа */
    }
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Запрещаем сжатие логотипа */
}

.logo-image {
    width: 50px; /* Установите желаемую ширину логотипа */
    height: auto; /* Сохраняем пропорции */
}

.logo a {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Добавляем легкую тень для лучшей читаемости */
}

.logo a:hover {
    opacity: 0.95;
}

.nav {
    display: flex;
    gap: 20px; /* Увеличиваем расстояние между пунктами */
}

.nav a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85); /* Слегка приглушенный для неактивных элементов */
    font-size: 14px; /* Немного уменьшаем размер шрифта */
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

.nav a:hover {
    color: #fff;
    opacity: 1;
}

/* Стиль для активного пункта меню */
.nav a.active {
    color: #fff;
    font-weight: 500;
}

/* Нижний бордер для активного пункта */
.nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.3); /* Мягкое свечение для подчеркивания */
}

/* Делаем активным текущий пункт (Сервисы) */
.nav a[href="#services"] {
    color: #fff;
    font-weight: 500;
}

.nav a[href="#services"]::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.3);
}

.search-container {
    display: flex;
    font-family: Montserrat, Arial, sans-serif;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2); /* Полупрозрачная белая граница */
    border-radius: 18px; /* Скругляем углы */
    padding: 0 10px;
    flex: 1; /* Занимает доступное пространство */
    margin: 0 20px; /* Отступы по бокам */
    max-width: 500px; /* Максимальная ширина */
    z-index: 3;
    height: 36px; /* Уменьшаем высоту */
    position: relative;
    background-color: rgba(255, 255, 255, 0.15); /* Полупрозрачный фон */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.2);
}

.search-container input {
    font-family: Montserrat, Arial, sans-serif;
    border: none;
    outline: none;
    width: 100%;
    padding: 0 10px;
    font-size: 14px;
    overflow: hidden; /* Скрывает переполнение */
    white-space: nowrap; /* Запрещает перенос текста */
    background-color: transparent;
    height: 100%;
    color: #fff; /* Белый текст */
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.7); /* Полупрозрачный белый для плейсхолдера */
}

.search-container button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: rgba(255, 255, 255, 0.8); /* Подходящий цвет для иконки */
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2; /* Добавляем z-index для уверенности, что кнопка всегда сверху */
}

.search-container button:hover {
    color: #fff;
}

.search-container svg {
    width: 16px;
    height: 16px;
}

.burger-menu {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
    z-index: 10;
    flex-shrink: 0;
}

.burger-menu:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.burger-menu.active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: rotate(90deg);
}

.mobile-menu {
    display: none;
    position: fixed; /* Изменяем с absolute на fixed */
    top: 64px; /* Совпадает с высотой хедера, но теперь относительно viewport */
    left: 0;
    background: #6259c3; /* Тот же цвет, что и у header */
    width: 200px;
    box-shadow: 0 5px 15px rgba(98, 89, 195, 0.2);
    z-index: 9999; /* Увеличиваем z-index для отображения поверх всего */
    border-radius: 0 0 8px 0; /* Скругляем только нижний правый угол для современного вида */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.active {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.mobile-menu a {
    padding: 12px 15px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-size: 14px;
}

.mobile-menu a:last-child {
    border-bottom: none;
}

.mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.mobile-menu a.active {
    font-weight: 500;
    color: #fff;
    border-left: 3px solid #fff;
    background-color: rgba(255, 255, 255, 0.07);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .burger-menu {
        display: block;
        position: relative;
        z-index: 100;
        order: 1;
    }

    .header {
        padding: 0 15px; /* Уменьшаем отступы для мобильных */
        position: fixed;
    }

    /* Улучшенные стили для мобильного меню */
    .mobile-menu {
        width: 200px; /* Возвращаем фиксированную ширину */
        max-width: 200px; /* Ограничиваем максимальную ширину */
        left: 0; /* Прижимаем к левой стороне */
        right: auto; /* Убираем right: 0 */
        margin: 0; /* Убираем центрирование */
    }

    .search-container {
        margin: 0 10px; /* Уменьшаем отступы для мобильных */
        max-width: calc(100% - 120px); /* Максимальная ширина с учетом логотипа и бургер-кнопки */
        order: 3;
    }
    
    .logo {
        order: 2;
        margin: 0 auto 0 10px; /* Центрируем логотип */
    }
    
    /* На маленьких экранах показываем и иконку поиска, и поле ввода */
    .search-container button {
        display: flex; /* Всегда показываем иконку поиска */
    }
    
    .search-container input {
        padding: 0 30px 0 5px; /* Отступ справа для иконки */
        display: block; /* Всегда показываем поле ввода */
        width: 100%;
    }
    
    /* Стили для свернутого/развернутого поиска в мобильной версии */
    .search-container.collapsed {
        width: auto;
        min-width: 40px;
        padding: 0 5px;
        justify-content: flex-start;
    }
    
    .search-container.collapsed input {
        display: block; /* Всегда показываем поле ввода */
        width: calc(100% - 30px); /* Учитываем место для иконки */
    }
    
    .search-container.collapsed button {
        position: absolute;
        right: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-container.expanded {
        position: absolute;
        top: 15px;
        left: 50px; /* Отступ слева, чтобы не закрывать кнопку меню */
        right: 50px; /* Отступ справа */
        width: calc(100% - 100px); /* Фиксированная ширина с учетом отступов */
        max-width: 600px; /* Максимальная ширина на больших экранах */
        background-color: #f9f9f9;
        border: 1px solid #ddd;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1001;
    }
    
    .search-container.expanded input {
        display: block;
        width: calc(100% - 30px); /* Учитываем место для иконки */
    }
    
    .search-container.expanded button {
        position: absolute;
        right: 5px;
        display: flex;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .mobile-menu {
        width: 200px; /* Фиксированная ширина */
        left: 0; /* Прижимаем к левой стороне */
        right: auto; /* Убираем right */
        margin: 0; /* Убираем отступы */
        max-width: 200px; /* Ограничиваем максимальную ширину */
    }
    
    .mobile-menu a {
        padding: 15px 20px; /* Увеличиваем padding для лучшего touch-интерфейса */
        font-size: 16px; /* Увеличиваем размер шрифта */
    }
}

@media (min-width: 769px) {
    .search-container {
        margin-left: 7.625vw; /* Отступ для десктопа */
        width: 27.041vw; /* Ширина для десктопа */
        max-width: 400px; /* Максимальная ширина */
    }
}

/* Добавляем отступ для основного содержимого, чтобы оно не перекрывалось хедером */
.main {
    padding-top: 80px; /* 64px высота хедера + дополнительный отступ */
} 