.floating-header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 1100px;
    pointer-events: none; /* Пропускает клики сквозь прозрачные области шапки */
}

.nav-capsule {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 14px 32px;
    border-radius: 24px;
    background-color: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    position: relative;
    pointer-events: auto;
}

.nav-capsule::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(90deg, var(--mm-blue), var(--mm-cyan), var(--mm-purple), var(--mm-blue));
    background-size: 300% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rgb-flow 6s linear infinite;
    pointer-events: none; /* Рамка не должна мешать кликам */
}

/* ИСПРАВЛЕНО: Даем колонкам относительное позиционирование и z-index, чтобы они не перекрывали друг друга */
.nav-col-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    z-index: 1010; /* Выталкивает логотип на самый верхний слой */
}

.nav-col-center {
    display: flex;
    gap: 32px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1005;
}

.nav-col-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    z-index: 1010;
}

.logo {
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    letter-spacing: -0.5px;
    cursor: pointer;
    display: inline-block; /* Позволяет ссылке занять честную физическую площадь */
    position: relative;
    z-index: 1020;
}


.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.25s;
    position: relative;
    padding: 6px 0;
    cursor: pointer;
}

.nav-link:hover, 
.nav-link.active {
    color: #fff;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background-color: #fff;
    border-radius: 50%;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    transition: all 0.3s;
}

@media (max-width: 767px) {
    .floating-header {
        top: 16px;
        width: calc(100% - 32px);
    }
    .nav-capsule {
        display: flex;
        grid-template-columns: none;
        justify-content: space-between;
        padding: 12px 24px;
    }
    .hamburger {
        display: flex;
    }
    .nav-capsule.menu-open {
        border-radius: 24px;
    }
    .nav-capsule.menu-open::before {
        border-radius: 24px;
    }
    .nav-col-center {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(10, 10, 10, 0.96);
        flex-direction: column;
        gap: 24px;
        padding: 0;
        height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        border-radius: 0 0 24px 24px;
        border-top: 1px solid var(--border-color);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .nav-capsule.menu-open .nav-col-center {
        height: auto;
        padding: 32px 0;
        opacity: 1;
        visibility: visible;
    }
    .nav-link {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
    }
    .nav-capsule.menu-open .hamburger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
        background-color: var(--mm-cyan);
    }
    .nav-capsule.menu-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .nav-capsule.menu-open .hamburger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
        background-color: var(--mm-cyan);
    }
}
