/* Базові стилі ПК */
.navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #ffffffd7;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
}

nav {
    display: flex;
    gap: 30px; 
    align-items: center;
    height: 100%;
}

nav a {
    text-decoration: none;
    color: #444;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 450;
    transition: 0.3s;
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
}

/* Синя лінія (тільки ПК) */
nav a::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 35px;
    height: 3px;
    background-color: #0066ff;
    border-radius: 2px;
    transition: 0.3s;
}

nav a:hover { color: #0066ff; }
nav a:hover::after { transform: translateX(-50%) scaleX(1); }

/* Стиль для активного посилання */
nav a.active {
    color: #007bff !important; /* Синій колір, як у твоїх кнопках */
    position: relative;
}

/* Додатково: лінія під активним посиланням */
nav a.active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 35px;
    height: 3px;
    background-color: #0066ff;
    border-radius: 2px;
}

.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
}

.burger-menu span {
    width: 28px;
    height: 3px;
    background-color: #0066ff;
    border-radius: 2px;
    transition: 0.3s;
}

/* --- МОБІЛЬНА ВЕРСІЯ (Виправлена підкладка) --- */
@media (max-width: 768px) {
    .navigation {
        background-color: transparent; /* Прибираємо білу смугу зверху */
        backdrop-filter: none;
        justify-content: flex-end; /* Бургер праворуч */
        height: 60px;
    }

    .burger-menu {
        display: flex;
        margin-right: 10px;
    }

    /* Анімація хрестика */
    .burger-menu.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger-menu.open span:nth-child(2) { opacity: 0; }
    .burger-menu.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    nav {
        display: none; /* Сховано за замовчуванням */
        position: absolute;
        top: 55px; /* Прямо під бургер-кнопкою */
        right: 20px;
        
        /* Виправлення підкладки */
        background-color: white !important;
        height: auto !important; /* Розтягується по контенту */
        width: max-content; /* Ширина по тексту */
        min-width: 130px;
        
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 20px; /* Рівномірні відступи */
        gap: 12px;
        
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        z-index: 1050;
        box-sizing: border-box;
    }

    nav.active {
        display: flex; /* Показуємо весь блок при кліку */
    }

    nav a {
        height: auto !important; /* Скидаємо висоту 100% з ПК версії */
        width: 100%;
        font-size: 16px;
        color: #444;
        padding: 4px 0;
        justify-content: flex-start;
    }

    /* Вимикаємо синю лінію на мобілках */
    nav a::after {
        display: none !important;
    }

    /* Тільки зміна кольору тексту при натисканні */
    nav a:active, nav a:hover {
        color: #0066ff;
        background: none;
    }
}