/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    background: linear-gradient(180deg, #000000 0%, #000244 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: white;
}

/* Reset global de links — sin margen automático */
a {
    color: white;
    text-decoration: none;
    margin: 0;
    padding: 0;
}

hr {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.25);
}

h2, h3, p { color: white; }

/* ============================================================
   NAVBAR
   ============================================================ */
nav {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#paginas {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    width: 100%;
}

/* --- Iconos perfil + carrito (izquierda) --- */
.nav-iconos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.nav-iconos a {
    display: flex;
    align-items: center;
    line-height: 0;
}

.nav-iconos a img {
    filter: brightness(0) invert(1);
    width: 26px;
    height: 26px;
    display: block;
    transition: opacity 0.2s;
}

.nav-iconos a:hover img { opacity: 0.65; }

/* --- Hamburger (solo mobile) --- */
.hamburger {
    display: none;           /* oculto en desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    line-height: 0;
}

.hamburger img {
    filter: brightness(0) invert(1);
    width: 26px;
    height: 26px;
    display: block;
}

/* --- Links de navegación (desktop, izquierda después de iconos) --- */
.paginas-botones {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
}

.paginas-botones a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.87rem;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    margin: 0;
}

.paginas-botones a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Logo: siempre a la derecha con margin-left: auto --- */
#Tjust {
    margin-left: auto;
    color: white;
    font-size: clamp(1.1rem, 2.5vw, 1.55rem);
    white-space: nowrap;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* --- Menú desplegable mobile --- */
/* Por defecto: completamente oculto */
.mobile-menu {
    display: none;
    flex-direction: column;
    background: rgba(0, 2, 30, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Solo se muestra cuando JS añade la clase .open */
.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin: 0;
    transition: background 0.2s, color 0.2s;
}

.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

/* ============================================================
   HERO
   ============================================================ */
.Padre {
    display: flex;
    /* El contenido crece con la página, el footer queda abajo */
    min-height: calc(100vh - 60px);
}
 
/* --- ÍNDICE LATERAL --- */
.Izquierda {
    width: 240px;
    flex-shrink: 0;
    padding: 24px 20px;
    position: sticky;
    top: 60px;              /* pega debajo de la navbar */
    height: calc(100vh - 60px);
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
 
.indice-titulo {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.55;
    margin-bottom: 6px;
}
 
.nav-link {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    padding: 7px 10px;
    border-radius: 6px;
    display: block;
    transition: color 0.2s, background 0.2s;
    line-height: 1.4;
}
 
.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.07);
}
 
/* Enlace activo (añadido por JS) */
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}
 
/* --- ZONA DE CONTENIDO --- */
.Derecha {
    flex: 1;
    /* El scroll ocurre en la página, no en un div interno */
    padding: 32px 40px;
    max-width: 860px;
}
 
/* ============================================================
   SECCIONES DE TÉRMINOS
   ============================================================ */
.section {
    margin-bottom: 48px;
    padding: 28px 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    scroll-margin-top: 80px;   /* compensa la navbar sticky */
}
 
.section h2 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 14px;
    font-weight: 600;
}
 
.section p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    line-height: 1.75;
}
 
.mail-link-inline {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
    transition: color 0.2s;
}
 
.mail-link-inline:hover { color: white; }
/* ============================================================
   FOOTER
   ============================================================ */
.creditos {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: clamp(28px, 5vw, 80px);
    padding: clamp(32px, 5vw, 52px) clamp(20px, 5vw, 60px);
}

.creditos > div { display: flex; flex-direction: column; gap: 10px; }

.creditos-brand h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: white;
}

.creditos-brand p {
    font-size: 0.88rem;
    opacity: 0.6;
    color: white;
}

.creditos-redes h3,
.creditos-contacto h3 {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    color: white;
    margin: 0 0 8px 0;
}

.social-links {
    display: flex;
    gap: 14px;
    align-items: center;
}

.social-links a img {
    filter: brightness(0) invert(1);
    width: 28px;
    height: 28px;
    display: block;
    transition: opacity 0.2s, transform 0.2s;
}

.social-links a:hover img {
    opacity: 0.7;
    transform: scale(1.1);
}

.mail-link {
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    word-break: break-all;
    margin: 0;
    transition: color 0.2s;
}

.mail-link:hover { color: white; }

/* ============================================================
   RESPONSIVE — TABLET  ≤ 900px
   ============================================================ */
@media (max-width: 900px) {

    /* Ocultar links de desktop, mostrar hamburger */
    .paginas-botones { display: none; }
    .hamburger { display: block; }

    /* Hero: apilar índice arriba, contenido abajo */
    .Padre {
        flex-direction: column;
    }

    /* Índice: de sidebar vertical a barra horizontal de chips */
    .Izquierda {
        width: 100%;
        height: auto;
        position: static;          /* deja de ser sticky */
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 14px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        overflow-x: auto;
    }

    .indice-titulo { display: none; }

    /* Separador horizontal del índice también se oculta */
    .Izquierda hr { display: none; }

    .nav-link {
        font-size: 0.8rem;
        padding: 5px 10px;
        white-space: nowrap;
        border: 1px solid rgba(255, 255, 255, 0.18);
    }

    /* Contenido ocupa todo el ancho */
    .Derecha {
        max-width: 100%;
        padding: 24px 20px;
    }
}

/* ============================================================
   RESPONSIVE — MOBILE  ≤ 480px
   ============================================================ */
@media (max-width: 480px) {

    #paginas { padding: 10px 14px; gap: 8px; }

    .nav-iconos a img,
    .hamburger img { width: 22px; height: 22px; }

    #Tjust { font-size: 1rem; }

    .Derecha { padding: 16px 14px; }

    .section {
        padding: 20px 16px;
        margin-bottom: 28px;
    }

    .section h2 { font-size: 1.1rem; }

    /* Footer columna única */
    .creditos {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
        padding: 24px 16px;
    }
}

/* ============================================================
   ACCESIBILIDAD
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .slide, #central button, .social-links a img { transition: none; }
}