:root {
    --bg: #08090c;
    --surface: #111319;
    --surface-hover: #181b23;
    --text: #f5f5f5;
    --muted: #969aa5;
    --accent: #7c5cff;
    --border: #242733;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}


/* HEADER */

/* =========================
   HEADER
========================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(8, 9, 12, .92);
    backdrop-filter: blur(12px);

    border-bottom: 1px solid var(--border);

    transition: transform .35s ease;
}

/* Ocultar TODA la barra */

.site-header.nav-hidden {
    transform: translateY(-100%);
}

.navbar {
    max-width: 1400px;
    margin: auto;
    padding: 18px 30px;

    display: flex;
    align-items: center;
    gap: 35px;
}
.nav-menu {
    display: flex;
    align-items: center;

    gap: 0;

    list-style: none;

    margin: 0;
    padding: 0;
}


/* CADA ELEMENTO */

.nav-menu li {
    display: flex;
    align-items: center;
}


/* SEPARADORES */

.nav-menu li:not(:last-child)::after {
    content: "";

    width: 1px;
    height: 20px;

    margin: 0 22px;

    background: var(--border);

    opacity: .8;
}


/* ENLACES */

.nav-menu a {
    position: relative;

    display: flex;
    align-items: center;

    padding: 8px 0;

    color: var(--muted);

    font-weight: 500;
    text-decoration: none;

    transition:
        color .25s ease,
        transform .25s ease;
}


/* HOVER */

.nav-menu a:hover {
    color: var(--text);

    transform: translateY(-1px);
}


/* LÍNEA DEL HOVER */

.nav-menu a::after {
    content: "";

    position: absolute;

    left: 0;
    bottom: 0;

    width: 0;
    height: 2px;

    background: var(--accent);

    border-radius: 10px;

    transition: width .25s ease;
}


/* ACTIVAR LÍNEA */

.nav-menu a:hover::after,
.nav-menu a[aria-current="page"]::after {
    width: 100%;
}


/* ELEMENTO ACTIVO */

.nav-menu a[aria-current="page"] {
    color: var(--text);
}
.logo {
    display: flex;
    align-items: center;

    width: 150px;
    height: 100px;

    flex-shrink: 0;

    text-decoration: none;
}

.logo img {
    width: 100%;
    height: 100%;

    object-fit: contain;
    display: block;
}

.logo:hover img {
    transform: scale(1.03);
}

.logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-menu a {
    color: var(--muted);
    transition: .2s;
}

.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
    color: var(--text);
}


/* SEARCH */

.search-form {
    margin-left: auto;

    display: flex;
    align-items: center;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;

    overflow: hidden;
}

.search-form input {
    width: 230px;
    padding: 11px 14px;

    background: transparent;
    border: 0;
    outline: none;

    color: white;
}

.search-form button {
    padding: 11px 14px;

    background: transparent;
    border: 0;

    color: white;
    cursor: pointer;
}


/* =========================
   HERO
========================= */
/* =========================================
   HERO
========================================= */

.hero {
    position: relative;
    width: 100%;
    min-height: 700px;

    display: flex;
    align-items: center;

    padding: 80px 6vw;

    overflow: hidden;

    background: #08090c;
}


/* =========================================
   IMAGEN INICIAL
========================================= */

.hero-poster {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    z-index: 1;

    opacity: 1;

    transition:
        opacity 1.5s ease;

    pointer-events: none;
}


/* Cuando el video comienza correctamente */

.hero-poster.hidden {
    opacity: 0;
}


/* =========================================
   VIDEO
========================================= */

.hero-video {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    z-index: 0;

    background: #08090c;
}


/* =========================================
   OVERLAY
========================================= */

.hero-overlay {
    position: absolute;

    inset: 0;

    z-index: 2;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(8, 9, 12, 0.98) 0%,
            rgba(8, 9, 12, 0.88) 25%,
            rgba(8, 9, 12, 0.55) 55%,
            rgba(8, 9, 12, 0.20) 100%
        );
}


/* Oscurecimiento inferior */

.hero::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 180px;

    z-index: 2;

    pointer-events: none;

    background:
        linear-gradient(
            to top,
            rgba(8, 9, 12, 0.95),
            transparent
        );
}


/* =========================================
   CONTENIDO
========================================= */

.hero-content {
    position: relative;

    z-index: 3;

    width: 100%;
    max-width: 600px;
}


/* =========================================
   BADGE
========================================= */

.hero-badge {
    display: inline-block;

    margin-bottom: 18px;

    padding: 7px 14px;

    border-radius: 6px;

    background: var(--accent);

    color: #fff;

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 1px;
}


/* =========================================
   TITULO
========================================= */

.hero-content h1 {
    margin: 0 0 20px;

    font-size: clamp(
        42px,
        6vw,
        76px
    );

    line-height: 1.02;

    font-weight: 800;

    color: #fff;
}


/* =========================================
   DESCRIPCION
========================================= */

.hero-content p {
    max-width: 520px;

    margin: 0 0 30px;

    color: rgba(255, 255, 255, 0.78);

    font-size: 18px;

    line-height: 1.6;
}


/* =========================================
   BOTONES
========================================= */

.hero-actions {
    display: flex;

    align-items: center;

    gap: 14px;

    flex-wrap: wrap;
}


.hero-actions .btn {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 48px;

    padding: 0 22px;

    border-radius: 8px;

    text-decoration: none;

    font-weight: 700;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease,
        background 0.2s ease;
}


.hero-actions .btn:hover {
    transform: translateY(-2px);
}


/* Botón principal */

.hero-actions .btn-primary {
    background: var(--accent);

    color: #fff;
}


/* Botón secundario */

.hero-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.12);

    color: #fff;

    border: 1px solid rgba(255, 255, 255, 0.18);

    backdrop-filter: blur(8px);
}


/* =========================================
   CONTROLES DEL VIDEO
========================================= */

.hero-video-controls {
    position: absolute;

    right: 30px;
    bottom: 30px;

    z-index: 5;

    display: flex;

    align-items: center;

    gap: 10px;
}


/* =========================================
   BOTON MUTE
========================================= */

.hero-control {
    width: 44px;
    height: 44px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.20);

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.55);

    color: #fff;

    font-size: 18px;

    cursor: pointer;

    backdrop-filter: blur(8px);

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


.hero-control:hover {
    background: rgba(0, 0, 0, 0.75);

    transform: scale(1.05);
}


/* =========================================
   CONTROL DE VOLUMEN
========================================= */

.hero-volume {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 8px 12px;

    border-radius: 25px;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(8px);
}


.hero-volume span {
    font-size: 15px;

    color: #fff;
}


#heroVolume {
    width: 100px;

    cursor: pointer;

    accent-color: var(--accent);
}


/* =========================================
   TABLET
========================================= */

@media (max-width: 900px) {

    .hero {
        min-height: 620px;

        padding:
            70px 5vw;
    }


    .hero-content {
        max-width: 560px;
    }


    .hero-content h1 {
        font-size: clamp(
            38px,
            8vw,
            60px
        );
    }


    .hero-content p {
        font-size: 17px;
    }

}


/* =========================================
   MOVIL
========================================= */

@media (max-width: 600px) {

    .hero {
        min-height: 600px;

        padding:
            100px 24px 100px;
    }


    .hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(8, 9, 12, 0.94),
                rgba(8, 9, 12, 0.62)
            );
    }


    .hero-content {
        max-width: 100%;
    }


    .hero-content h1 {
        font-size: 40px;

        line-height: 1.08;
    }


    .hero-content p {
        font-size: 16px;

        line-height: 1.5;
    }


    .hero-actions {
        gap: 10px;
    }


    .hero-actions .btn {
        min-height: 46px;

        padding: 0 18px;
    }


    .hero-video-controls {
        right: 20px;

        bottom: 20px;
    }


    #heroVolume {
        width: 80px;
    }

}


/* =========================================
   MOVIL PEQUEÑO
========================================= */

@media (max-width: 400px) {

    .hero {
        min-height: 570px;

        padding:
            90px 20px 100px;
    }


    .hero-content h1 {
        font-size: 34px;
    }


    .hero-video-controls {
        right: 15px;

        bottom: 15px;
    }


    .hero-volume {
        display: none;
    }

}

/* =========================
   SECCIONES
========================= */

.content-section,
.genres {
    max-width: 1400px;
    margin: auto;
    padding: 55px 30px 0;
}


.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;

    margin-bottom: 22px;
}


.section-heading h2,
.genres h2 {
    font-size: 28px;
}


.section-heading a {
    color: var(--accent);

    text-decoration: none;

    transition: .25s ease;
}


.section-heading a:hover {
    opacity: .75;
}


/* =========================
   CARRUSEL
========================= */

.movie-carousel {
    display: flex;

    gap: 20px;

    width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    padding: 5px 2px 18px;

    scroll-behavior: smooth;

    scrollbar-width: none;

    cursor: grab;
}


.movie-carousel::-webkit-scrollbar {
    display: none;
}


.movie-carousel:active {
    cursor: grabbing;
}


/* =========================
   TARJETAS
========================= */

.movie-card {
    flex: 0 0 180px;

    width: 180px;

    min-width: 180px;
}


.movie-card a {
    display: block;

    color: inherit;

    text-decoration: none;
}


/* =========================
   POSTER
========================= */

.movie-poster {
    position: relative;

    width: 100%;

    aspect-ratio: 2 / 3;

    overflow: hidden;

    border-radius: 9px;

    background: var(--surface);

    border: 1px solid transparent;

    transition:
        transform .3s ease,
        border-color .3s ease,
        box-shadow .3s ease;
}


.movie-poster img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .4s ease;
}



/* =========================
   TARJETAS
========================= */

.movie-card {
    flex: 0 0 180px;

    width: 180px;

    min-width: 180px;
}


.movie-card a {
    display: block;

    color: inherit;

    text-decoration: none;
}


/* =========================
   POSTER
========================= */

.movie-poster {
    position: relative;

    width: 100%;

    aspect-ratio: 2 / 3;

    overflow: hidden;

    border-radius: 9px;

    background: var(--surface);

    border: 1px solid transparent;

    transition:
        transform .3s ease,
        border-color .3s ease,
        box-shadow .3s ease;
}


.movie-poster img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .4s ease;
}


/* =========================
   HOVER DE TARJETA
========================= */

.movie-card:hover .movie-poster {
    transform: translateY(-5px);

    border-color: var(--accent);

    box-shadow:
        0 10px 30px rgba(0, 0, 0, .45);
}


.movie-card:hover .movie-poster img {
    transform: scale(1.06);
}


/* =========================
   ETIQUETA
========================= */

.movie-type {
    position: absolute;

    top: 10px;
    left: 10px;

    padding: 4px 8px;

    background: rgba(0, 0, 0, .78);

    border: 1px solid rgba(255, 255, 255, .1);

    border-radius: 5px;

    color: #fff;

    font-size: 11px;
    font-weight: 700;

    backdrop-filter: blur(5px);
}


/* =========================
   INFORMACIÓN
========================= */

.movie-info {
    padding: 10px 2px;
}


.movie-info h3 {
    margin: 0;

    color: var(--text);

    font-size: 15px;
    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.movie-meta {
    display: flex;

    gap: 12px;

    margin-top: 5px;

    color: var(--muted);

    font-size: 13px;
}


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

@media (max-width: 768px) {

    .content-section,
    .genres {
        padding: 45px 20px 0;
    }


    .section-heading h2,
    .genres h2 {
        font-size: 24px;
    }


    .movie-carousel {
        gap: 14px;

        padding-bottom: 14px;
    }


    .movie-card {
        flex: 0 0 145px;

        width: 145px;

        min-width: 145px;
    }

}


/* =========================
   RESPONSIVE MÓVIL
========================= */

@media (max-width: 480px) {

    .content-section,
    .genres {
        padding: 40px 16px 0;
    }


    .section-heading {
        margin-bottom: 16px;
    }


    .section-heading h2,
    .genres h2 {
        font-size: 21px;
    }


    .section-heading a {
        font-size: 13px;
    }


    .movie-carousel {
        gap: 12px;
    }


    .movie-card {
        flex: 0 0 130px;

        width: 130px;

        min-width: 130px;
    }


    .movie-info {
        padding-top: 8px;
    }


    .movie-info h3 {
        font-size: 14px;
    }


    .movie-meta {
        font-size: 12px;
    }

}


/* =========================
   GÉNEROS
========================= */

.genre-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 12px;

    margin-top: 20px;
}


.genre-grid a {
    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 8px;

    color: var(--text);

    text-decoration: none;

    transition:
        background .2s ease,
        border-color .2s ease,
        transform .2s ease;
}


.genre-grid a:hover {
    background: var(--surface-hover);

    border-color: var(--accent);

    transform: translateY(-2px);
}


@media (max-width: 768px) {

    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


@media (max-width: 480px) {

    .genre-grid a {
        padding: 15px;

        font-size: 14px;
    }

}
/* FOOTER */

.site-footer {
    margin-top: 80px;

    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1400px;
    margin: auto;
    padding: 50px 30px;

    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-content h2 {
    font-size: 16px;
    margin-bottom: 15px;
}

.footer-content ul {
    list-style: none;
}

.footer-content li {
    margin-bottom: 8px;
}

.footer-content a:not(.logo) {
    color: var(--muted);
}

.footer-bottom {
    padding: 20px 30px;

    text-align: center;

    color: var(--muted);

    border-top: 1px solid var(--border);
}


/* ACCESSIBILITY */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}



/* =========================
   VENTANA DE REPRODUCCIÓN
========================= */

.watch-modal {
    position: fixed;
    inset: 0;

    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity .3s ease,
        visibility .3s ease;
}

.watch-modal.active {
    opacity: 1;
    visibility: visible;
}


/* FONDO */

.watch-overlay {
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, .88);

    backdrop-filter: blur(10px);
}


/* VENTANA */

.watch-window {
    position: relative;

    z-index: 2;

    width: min(1100px, 100%);

    max-height: 92vh;

    overflow-y: auto;

    background: #0d0f14;

    border: 1px solid var(--border);

    border-radius: 14px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .65);

    transform: scale(.95) translateY(20px);

    transition:
        transform .3s ease;
}

.watch-modal.active .watch-window {
    transform: scale(1) translateY(0);
}


/* BOTÓN CERRAR */

.watch-close {
    position: absolute;

    top: 15px;
    right: 15px;

    z-index: 10;

    width: 42px;
    height: 42px;

    border: 0;

    border-radius: 50%;

    background: rgba(0, 0, 0, .7);

    color: #fff;

    font-size: 28px;

    line-height: 1;

    cursor: pointer;

    transition: .25s ease;
}

.watch-close:hover {
    background: var(--accent);

    transform: scale(1.08);
}


/* =========================
   VIDEO
========================= */

.video-container {
    width: 100%;

    background: #000;

    aspect-ratio: 16 / 9;
}

.video-container video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    background: #000;
}


/* =========================
   INFORMACIÓN
========================= */

.watch-info {
    display: flex;

    gap: 25px;

    padding: 25px;
}

.watch-poster {
    flex: 0 0 150px;
}

.watch-poster img {
    width: 150px;

    aspect-ratio: 2 / 3;

    display: block;

    object-fit: cover;

    border-radius: 8px;
}

.watch-details {
    flex: 1;

    min-width: 0;
}

.watch-label {
    display: inline-block;

    margin-bottom: 8px;

    color: var(--accent);

    font-size: 12px;

    font-weight: 700;

    letter-spacing: 2px;
}

.watch-details h2 {
    margin: 0 0 12px;

    font-size: clamp(25px, 4vw, 38px);

    line-height: 1.1;
}

.watch-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 18px;
}

.watch-meta span {
    padding: 6px 10px;

    border: 1px solid var(--border);

    border-radius: 5px;

    color: var(--muted);

    font-size: 13px;
}

.watch-details p {
    max-width: 750px;

    margin: 0;

    color: #b9bbc2;

    line-height: 1.7;
}


/* =========================
   TARJETA
========================= */

.movie-card-button {
    display: block;

    width: 100%;

    padding: 0;

    border: 0;

    background: none;

    color: inherit;

    text-align: left;

    cursor: pointer;
}

.movie-card-button:focus-visible {
    outline: 2px solid var(--accent);

    outline-offset: 5px;

    border-radius: 8px;
}

.movie-card-button:hover .movie-poster img {
    transform: scale(1.05);
}


/* =========================
   MÓVIL
========================= */

@media (max-width: 700px) {

    .watch-modal {
        padding: 10px;
    }

    .watch-window {
        width: 100%;

        max-height: 95vh;

        border-radius: 10px;
    }

    .watch-info {
        flex-direction: column;

        padding: 20px;
    }

    .watch-poster {
        flex: none;
    }

    .watch-poster img {
        width: 110px;
    }

    .watch-details h2 {
        font-size: 26px;
    }

    .watch-close {
        top: 10px;
        right: 10px;
    }

}



/* =========================
   BOTONES DEL REPRODUCTOR
========================= */

.watch-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.watch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    padding: 0 22px;

    border-radius: 8px;
    border: 1px solid transparent;

    font-size: 15px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition:
        background .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

/* VER AHORA */

.watch-btn-primary {
    background: var(--accent);
    color: #fff;
}

.watch-btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* DESCARGAR */

.watch-btn-secondary {
    background: rgba(255, 255, 255, .06);
    border-color: var(--border);
    color: var(--text);
}

.watch-btn-secondary:hover {
    background: rgba(255, 255, 255, .12);
    border-color: var(--accent);
    color: var(--text);
    transform: translateY(-2px);
}


/* =========================
   MÓVIL
========================= */

@media (max-width: 600px) {

    .watch-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .watch-btn {
        width: 100%;
    }

}


/* ========================================
   SELECCIÓN DE REPRODUCTORES
   ESTILO STELARFLIX
======================================== */

.player-options {
    margin-top: 25px;
    padding-top: 20px;

    border-top: 1px solid var(--border);

    animation: playerOptionsIn .25s ease;
}

.player-options[hidden] {
    display: none;
}


/* ========================================
   TÍTULO
======================================== */

.player-options-title {
    margin: 0 0 14px;

    color: var(--text);

    font-size: 14px;
    font-weight: 600;

    letter-spacing: .3px;
}


/* ========================================
   LISTA
======================================== */

.player-options-list {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;
}


/* ========================================
   BOTONES
======================================== */

.player-option {
    position: relative;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 18px;

    border: 1px solid var(--border);

    border-radius: 7px;

    background:
        var(--surface);

    color:
        var(--muted);

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        color .25s ease,
        background .25s ease,
        border-color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}


/* ========================================
   HOVER
======================================== */

.player-option:hover {

    color:
        var(--text);

    background:
        rgba(255, 255, 255, .06);

    border-color:
        var(--accent);

    transform:
        translateY(-2px);

}


/* ========================================
   ACTIVO
======================================== */

.player-option.active {

    background:
        var(--accent);

    border-color:
        var(--accent);

    color:
        #fff;

    box-shadow:
        0 6px 20px rgba(0, 0, 0, .25);

}


/* ========================================
   ICONO DEL REPRODUCTOR
======================================== */

.player-option::before {

    content:
        "▶";

    margin-right:
        8px;

    font-size:
        10px;

}


/* ========================================
   ANIMACIÓN
======================================== */

@keyframes playerOptionsIn {

    from {

        opacity: 0;

        transform:
            translateY(-8px);

    }

    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 600px) {

    .player-options-list {

        display:
            grid;

        grid-template-columns:
            repeat(2, 1fr);

        gap:
            8px;

    }


    .player-option {

        width:
            100%;

        padding:
            0 10px;

        font-size:
            13px;

    }

}



/* =========================================================
   REPRODUCTOR MEGA
========================================================= */

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}


#moviePlayer {
    width: 100%;
    height: 100%;
    display: none;
    background: #000;
}


#megaPlayer {
    width: 100%;
    height: 100%;
    display: none;
    border: 0;
    background: #000;
}


/* =========================================================
   BOTONES DE REPRODUCTORES
========================================================= */

.player-options {
    margin-top: 20px;
    padding: 20px;
    border-top: 1px solid var(--border);
}


.player-options h3 {
    margin-bottom: 15px;
}


.player-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.player-option {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: .2s ease;
}


.player-option:hover {
    background: var(--surface-hover);
}


.player-option.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
#youtubePlayer {
    width: 100%;
    height: 100%;
    display: none;
    border: 0;
    background: #000;
}



/* ========================================
   PÁGINA DE PELÍCULAS
======================================== */

.movies-page {

    width: 100%;

    max-width: 1450px;

    margin: 0 auto;

    padding: 50px 30px 80px;

}


.movies-intro {

    margin-bottom: 10px;

}


.movies-intro h1 {

    margin: 8px 0;

    font-size: clamp(32px, 5vw, 48px);

}


.movies-intro p {

    margin: 0;

    color: var(--muted);

}


/* ========================================
   CATEGORÍAS
======================================== */

.movie-category {

    width: 100%;

    margin-top: 55px;

}


.movie-category .section-heading {

    margin-bottom: 20px;

}


.movie-category .section-heading h2 {

    margin: 5px 0 0;

    font-size: 28px;

}


/* ========================================
   CARRUSEL HORIZONTAL
======================================== */

.movie-category .movie-carousel {

    display: flex;

    gap: 18px;

    width: 100%;

    overflow-x: auto;

    overflow-y: hidden;

    padding: 5px 3px 18px;

    scrollbar-width: none;

    scroll-behavior: smooth;

    scroll-snap-type: x proximity;

}


.movie-category .movie-carousel::-webkit-scrollbar {

    display: none;

}


/* ========================================
   TARJETAS
======================================== */

.movie-category .movie-card {

    flex: 0 0 190px;

    width: 190px;

    min-width: 190px;

    scroll-snap-align: start;

}


.movie-card-button {

    width: 100%;

    padding: 0;

    border: 0;

    background: transparent;

    color: inherit;

    text-align: left;

    cursor: pointer;

}


/* ========================================
   POSTER
======================================== */

.movie-category .movie-poster {

    position: relative;

    width: 100%;

    aspect-ratio: 2 / 3;

    overflow: hidden;

    border-radius: 9px;

    background: var(--surface);

}


.movie-category .movie-poster img {

    display: block;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transition:
        transform .35s ease;

}


.movie-card-button:hover
.movie-poster img {

    transform: scale(1.05);

}


/* ========================================
   INFORMACIÓN
======================================== */

.movie-category .movie-info {

    padding-top: 10px;

}


.movie-category .movie-info h3 {

    margin: 0;

    overflow: hidden;

    color: var(--text);

    font-size: 15px;

    white-space: nowrap;

    text-overflow: ellipsis;

}


.movie-category .movie-meta {

    display: flex;

    gap: 10px;

    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 768px) {

    .movies-page {

        padding:
            35px 18px 60px;

    }


    .movie-category {

        margin-top: 40px;

    }


    .movie-category .movie-carousel {

        gap: 14px;

    }


    .movie-category .movie-card {

        flex: 0 0 150px;

        width: 150px;

        min-width: 150px;

    }

}


@media (max-width: 480px) {

    .movies-page {

        padding-left: 14px;

        padding-right: 14px;

    }


    .movie-category .movie-carousel {

        gap: 12px;

        margin-right: -14px;

        padding-right: 14px;

    }


    .movie-category .movie-card {

        flex: 0 0 135px;

        width: 135px;

        min-width: 135px;

    }

}

/* ========================================
   FILTRO DE CATEGORÍAS
======================================== */

.movie-filters {
    max-width: 1400px;
    margin: 0 auto;

    padding: 35px 30px 10px;
}


/* ENCABEZADO */

.filter-header {
    margin-bottom: 18px;
}

.filter-header h2 {
    margin: 5px 0 0;

    color: var(--text);

    font-size: 24px;
}


/* BOTONES */

.filter-buttons {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;
}


.category-filter {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 18px;

    border: 1px solid var(--border);
    border-radius: 7px;

    background: var(--surface);

    color: var(--muted);

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition:
        color .25s ease,
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}


/* HOVER */

.category-filter:hover {
    color: var(--text);

    border-color: var(--accent);

    transform: translateY(-2px);
}


/* ACTIVO */

.category-filter.active {
    background: var(--accent);

    border-color: var(--accent);

    color: #fff;
}


/* ========================================
   CATEGORÍAS OCULTAS
======================================== */

.movie-category.category-hidden {
    display: none;
}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 600px) {

    .movie-filters {
        padding: 25px 20px 5px;
    }

    .filter-buttons {
        display: grid;

        grid-template-columns: repeat(2, 1fr);

        gap: 8px;
    }

    .category-filter {
        width: 100%;

        padding: 0 10px;

        font-size: 13px;
    }

}


/* ========================================
   FOOTER
======================================== */

.site-footer {
    margin-top: 80px;
    padding: 55px 30px 0;

    background: #07080b;

    border-top: 1px solid var(--border);
}


/* CONTENEDOR */

.footer-container {
    width: min(1400px, 100%);
    margin: 0 auto;

    display: grid;

    grid-template-columns:
        2fr
        1fr
        1fr
        1fr;

    gap: 60px;

    padding-bottom: 45px;
}


/* ========================================
   LOGO IZQUIERDO
======================================== */

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    text-align: left;

    max-width: 300px;
}


.footer-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    width: 160px;
    height: 55px;

    text-decoration: none;
}


.footer-logo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    object-position: left center;

    transition: transform .25s ease;
}


.footer-logo:hover img {
    transform: scale(1.04);
}


.footer-brand p {
    margin: 18px 0 0;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.7;
}


/* ========================================
   COLUMNAS
======================================== */

.footer-column {
    display: flex;
    flex-direction: column;

    align-items: flex-start;

    gap: 11px;
}


.footer-column h3 {
    margin: 0 0 8px;

    color: var(--text);

    font-size: 15px;
    font-weight: 600;
}


.footer-column a {
    color: var(--muted);

    font-size: 14px;

    text-decoration: none;

    transition:
        color .25s ease,
        transform .25s ease;
}


.footer-column a:hover {
    color: var(--accent);

    transform: translateX(4px);
}


/* ========================================
   PARTE INFERIOR
======================================== */

.footer-bottom {
    width: min(1400px, 100%);
    margin: 0 auto;

    padding: 20px 0;

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    border-top: 1px solid var(--border);
}


.footer-bottom p {
    margin: 0;

    color: var(--muted);

    font-size: 13px;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 850px) {

    .footer-container {
        grid-template-columns:
            1fr
            1fr;

        gap: 35px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 550px) {

    .site-footer {
        margin-top: 60px;
        padding: 45px 20px 0;
    }


    .footer-container {
        grid-template-columns: 1fr;

        gap: 30px;
    }


    .footer-brand {
        grid-column: auto;
    }


    .footer-logo {
        width: 150px;
        height: 48px;
    }


    .footer-bottom {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }

}

/* ========================================
   PANTALLA DE CARGA
======================================== */

.page-loader {
    position: fixed;

    inset: 0;

    z-index: 99999;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #08090c;

    opacity: 1;

    visibility: visible;

    transition:
        opacity .6s ease,
        visibility .6s ease;
}


/* Cuando termina de cargar */

.page-loader.loader-hidden {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* CONTENIDO */

.loader-content {
    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;
}


/* LOGO */

.loader-logo {
    width: 190px;

    height: 70px;

    object-fit: contain;

    animation:
        loaderLogo .8s ease-in-out;
}


/* SPINNER */

.loader-spinner {
    width: 38px;

    height: 38px;

    margin-top: 25px;

    border: 3px solid rgba(255,255,255,.12);

    border-top-color: var(--accent);

    border-radius: 50%;

    animation:
        loaderSpin .8s linear infinite;
}


/* TEXTO */

.loader-text {
    margin-top: 18px;

    color: var(--muted);

    font-size: 14px;

    letter-spacing: .5px;

    animation:
        loaderText 1.2s ease-in-out infinite alternate;
}


/* ========================================
   ANIMACIONES
======================================== */

@keyframes loaderSpin {

    to {
        transform: rotate(360deg);
    }

}


@keyframes loaderLogo {

    from {
        opacity: 0;

        transform:
            scale(.85)
            translateY(10px);
    }

    to {
        opacity: 1;

        transform:
            scale(1)
            translateY(0);
    }

}


@keyframes loaderText {

    from {
        opacity: .45;
    }

    to {
        opacity: 1;
    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 600px) {

    .loader-logo {
           width: 280px;
    height: 110px;
    }

    .loader-spinner {
        width: 32px;

        height: 32px;

        margin-top: 22px;
    }

    .loader-text {
        font-size: 13px;
    }

}
@media (max-width: 600px) {

    .loader-logo {
        width: 230px;
        height: 90px;
    }

}

/* ========================================
   CONSENTIMIENTO DE COOKIES
======================================== */

.cookie-consent {
    position: fixed;

    inset: 0;

    z-index: 999999;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, .78);

    backdrop-filter: blur(10px);

    opacity: 1;
    visibility: visible;

    transition:
        opacity .35s ease,
        visibility .35s ease;
}


/* OCULTO */

.cookie-consent.cookie-hidden {
    opacity: 0;

    visibility: hidden;

    pointer-events: none;
}


/* ========================================
   CAJA
======================================== */

.cookie-box {
    width: min(620px, 100%);

    padding: 30px;

    display: grid;

    grid-template-columns:
        auto 1fr;

    gap: 20px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, .6);

    animation: cookieBoxIn .4s ease;
}


/* ICONO */

.cookie-icon {
    width: 55px;
    height: 55px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: rgba(255, 255, 255, .05);

    font-size: 28px;
}


/* CONTENIDO */

.cookie-content h2 {
    margin: 0;

    color: var(--text);

    font-size: 23px;
}


.cookie-content p {
    margin: 10px 0 0;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.7;
}


.cookie-policy {
    display: inline-block;

    margin-top: 10px;

    color: var(--accent);

    font-size: 13px;

    text-decoration: none;
}


.cookie-policy:hover {
    text-decoration: underline;
}


/* ========================================
   BOTÓN
======================================== */

.cookie-actions {
    grid-column: 1 / -1;

    display: flex;

    justify-content: flex-end;
}


.cookie-accept {
    min-height: 44px;

    padding: 0 22px;

    border: 1px solid var(--accent);

    border-radius: 7px;

    background: var(--accent);

    color: #fff;

    font-family: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        transform .25s ease,
        opacity .25s ease;
}


.cookie-accept:hover {
    transform: translateY(-2px);

    opacity: .9;
}


/* ========================================
   ANIMACIÓN
======================================== */

@keyframes cookieBoxIn {

    from {
        opacity: 0;

        transform:
            translateY(20px)
            scale(.97);
    }

    to {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }

}


/* ========================================
   MÓVIL
======================================== */

@media (max-width: 600px) {

    .cookie-box {
        display: block;

        padding: 25px;
    }


    .cookie-icon {
        margin-bottom: 16px;
    }


    .cookie-content h2 {
        font-size: 21px;
    }


    .cookie-actions {
        margin-top: 22px;
    }


    .cookie-accept {
        width: 100%;
    }

}
/* =========================================================
   NAVEGACIÓN - BUSCADOR + INICIAR SESIÓN
========================================================= */

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.nav-actions .search-form {
    margin-left: 0;
}

.nav-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition:
        background .25s ease,
        border-color .25s ease,
        transform .25s ease;
}

.nav-login-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}


/* =========================================================
   USUARIO CON SESIÓN EN LA NAVEGACIÓN
========================================================= */
.nav-user-wrap { position: relative; flex-shrink: 0; }
.nav-user-button {
    gap: 8px;
    cursor: pointer;
}
.nav-user-avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg,var(--accent),#5b21b6);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.nav-user-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.nav-user-name { max-width: 130px; overflow:hidden; text-overflow:ellipsis; }
.nav-user-chevron { opacity:.7; font-size:11px; }
.nav-user-dropdown {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 1000;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #12121b;
    box-shadow: 0 18px 45px rgba(0,0,0,.45);
}
.nav-user-dropdown[hidden] { display:none !important; }
.nav-user-dropdown-header { padding:10px 10px 8px; border-bottom:1px solid #292936; margin-bottom:6px; }
.nav-user-dropdown-header strong,
.nav-user-dropdown-header span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-user-dropdown-header strong { color:#fff; font-size:13px; }
.nav-user-dropdown-header span { color:#858596; font-size:11px; margin-top:3px; }
.nav-user-dropdown a,
.nav-user-dropdown button {
    width:100%;
    min-height:38px;
    display:flex;
    align-items:center;
    gap:9px;
    border:0;
    border-radius:8px;
    padding:8px 10px;
    background:transparent;
    color:#ddd;
    text-decoration:none;
    font:inherit;
    font-size:13px;
    cursor:pointer;
    text-align:left;
}
.nav-user-dropdown a:hover,
.nav-user-dropdown button:hover { background:#20202c; color:#fff; }
.nav-user-dropdown .nav-user-logout { color:#fecaca; }
@media(max-width:700px){
    .nav-user-name { display:none; }
    .nav-user-button { padding:0 9px; }
    .nav-user-dropdown { right:-4px; width:210px; }
}


.catalog-count {
    margin: -8px 0 22px;
    color: #9b9bab;
    font-size: 13px;
    font-weight: 600;
}

.movie-poster:empty {
    min-height: 240px;
    background:
        radial-gradient(circle at 50% 35%, rgba(139,92,246,.18), transparent 42%),
        linear-gradient(145deg, #181824, #0d0d14);
}


/* =========================================================
   CATÁLOGO LEGAL 100
========================================================= */

.legal-placeholder-poster {
    position: relative;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 32%, rgba(139, 92, 246, .22), transparent 38%),
        linear-gradient(145deg, #1a1a28, #0c0c13);
}

.legal-placeholder-icon {
    font-size: 54px;
    opacity: .78;
}

.legal-catalog-card .movie-card-button {
    height: 100%;
}

.legal-generated-section {
    scroll-margin-top: 90px;
}

/* =========================================================
   BÚSQUEDA EN VIVO - SUGERENCIAS CON CARÁTULA
========================================================= */

.search-form-live {
    position: relative;
    overflow: visible;
    z-index: 80;
}

.live-search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(390px, 92vw);
    max-height: min(520px, 70vh);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(14, 14, 18, 0.98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
}

.live-search-results[hidden] {
    display: none !important;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    padding: 7px;
    border-radius: 9px;
    color: var(--text);
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.live-search-item:hover,
.live-search-item.is-active {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(2px);
}

.live-search-poster {
    width: 46px;
    height: 62px;
    flex: 0 0 46px;
    overflow: hidden;
    border-radius: 7px;
    background: #1f1f24;
}

.live-search-poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-search-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.live-search-title {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-search-meta {
    color: var(--muted);
    font-size: 12px;
}

.live-search-empty {
    padding: 15px 13px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* =========================================================
   STELARFLIX - VISTA PREVIA AUTOMÁTICA DE TRÁILER
========================================================= */

.movie-card {
    transition: transform .22s ease, filter .22s ease;
    transform-origin: center center;
}

.movie-card.preview-hover-active {
    position: relative;
    z-index: 45;
    transform: translateY(-4px) scale(1.035);
    filter: brightness(1.04);
}

.st-preview-popover {
    position: fixed;
    z-index: 9998;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: #0b0b0d;
    box-shadow: 0 18px 55px rgba(0,0,0,.62);
    opacity: 0;
    transform: translateY(7px) scale(.97);
    transform-origin: center center;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.st-preview-popover.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.st-preview-media-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.st-preview-media {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.st-preview-video {
    object-fit: cover;
}

.st-preview-badge,
.st-preview-muted {
    position: absolute;
    z-index: 2;
    top: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.68);
    color: #fff;
    backdrop-filter: blur(6px);
}

.st-preview-badge {
    left: 10px;
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.st-preview-muted {
    right: 10px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
}

.st-preview-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px 11px;
}

.st-preview-title {
    min-width: 0;
    overflow: hidden;
    color: var(--text, #fff);
    font-size: 14px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.st-preview-meta {
    flex: none;
    color: var(--muted, #aaa);
    font-size: 11px;
    white-space: nowrap;
}

@media (hover: none), (pointer: coarse) {
    .movie-card.preview-hover-active {
        transform: none;
    }

    .st-preview-popover {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .movie-card,
    .st-preview-popover {
        transition: none;
    }
}
