/* NAV */
.main-nav {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: var(--medida-ancho);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-secundario-op);
    backdrop-filter: blur(6px);
    padding: 12px 0;
    border-bottom: var(--borde-principal-1);
    z-index: 999;
}

/* Listas izquierda/derecha */
.nav-left,
.nav-right {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
}

.nav-left li:first-child {
    margin-left: 12px;
}

.nav-right li.theme-container {
    margin-right: 12px;
}

.main-nav a {
    color: var(--color-texto-principal);
    text-decoration: none;
    font-family: var(--font-family);
    font-weight: 600;
    padding: 6px 8px;
    transition: color 0.25s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--color-texto-encabezados);
}

/* SWITCH */
.theme-container { 
    display: flex; 
    align-items: center; 
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.theme-switch .track {
    width: 56px;
    height: 28px;
    background: rgba(255,255,255,0.08);
    border-radius: 40px;
    position: relative;
    display: inline-block;
    transition: background-color 0.45s ease, box-shadow 0.3s ease;
    border: var(--borde-principal-1);
    box-sizing: border-box;
}

.theme-switch .knob {
    position: absolute;
    top: 1px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 1s cubic-bezier(.2,.9,.3,1),
                background 0.35s ease,
                box-shadow 0.35s ease;
    transform: translateX(0);
}

html.light-mode .theme-switch .knob {
    transform: translateX(28px);
    background: #000000;
}

html.light-mode .theme-switch .track {
    background: rgba(0,0,0,0.06);
}

:root,
html.light-mode {
    transition: background-color 0.45s ease, color 0.45s ease;
}


/* 🟩🟩 ↓ RESPONSIVE ↓ 🟩🟩 */

/* Tablet */
@media (max-width: 992px) {
    .main-nav {
        width: 95%;
        padding: 10px 0;
    }

    .nav-left,
    .nav-right {
        gap: 12px;
    }

    .main-nav a {
        font-size: 0.95rem;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .main-nav {
        width: 95%;
        padding: 10px 0;
    }

    .nav-left,
    .nav-right {
        gap: 10px;
    }

    .main-nav a {
        padding: 5px 6px;
        font-size: 0.9rem;
    }

    .theme-switch .track {
        width: 48px;
        height: 24px;
    }

    .theme-switch .knob {
        width: 18px;
        height: 18px;
    }

    html.light-mode .theme-switch .knob {
        transform: translateX(24px);
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {

    .main-nav {
        padding: 8px 0;
        width: 100%;
        left: 0;
        transform: none;
        border-bottom: var(--borde-principal-1);
        justify-content: space-around;
    }

    .nav-left,
    .nav-right {
        gap: 8px;
    }

    .main-nav a {
        font-size: 0.85rem;
    }

    .theme-switch .track {
        width: 42px;
        height: 22px;
    }

    .theme-switch .knob {
        width: 16px;
        height: 16px;
    }

    html.light-mode .theme-switch .knob {
        transform: translateX(20px);
    }
}
