/* ====================================
   HEADER (v1.5 FINAL STABLE)
   ==================================== */

header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 10002; /* Always above menu */
    padding: 1rem 0;
    transition: all 0.3s ease;
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* NAV */
nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
}

/* ====================================
   LOGO SWAP
   ==================================== */

.logo-img {
    height: 32px;
    display: block;
}

.logo-img--scrolled { display: none; }

header.scrolled .logo-img--default { display: none; }
header.scrolled .logo-img--scrolled { display: block; }

/* ====================================
   DESKTOP NAV
   ==================================== */

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    position: relative;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

header.scrolled .nav-links a {
    color: #000;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* CTA */
.cta-nav {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
}

/* ====================================
   MOBILE TOGGLE
   ==================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10003; /* Above header */
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: white;
    transition: 0.3s ease;
}

header.scrolled .mobile-menu-toggle span {
    background: black;
}

/* X animation */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px,6px);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px,-6px);
}

/* ====================================
   MOBILE MENU (FULL SCREEN)
   ==================================== */

.mobile-menu {
    position: fixed;
    inset: 0;
    background: rgba(10,10,30,0.98);
    backdrop-filter: blur(20px);
    z-index: 10001; /* Below header */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: 0.3s ease;
    overflow-y: auto;

    padding: calc(var(--header-h, 80px) + 1.5rem) 2rem 2rem;
}

.mobile-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu ul li {
    margin-bottom: 0.5rem;
}

.mobile-menu ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: 0.3s ease;
}

.mobile-menu ul li a:hover,
.mobile-menu ul li a.active {
    background: rgba(255,255,255,0.1);
    transform: translateX(8px);
}

/* ====================================
   RESPONSIVE
   ==================================== */

@media (max-width: 768px) {
    .nav-links { display: none; }
    .mobile-menu-toggle { display: flex; }
}
