/* NVS Multimedios — web de TV en vivo. Colores tomados de la app y del logo. */
:root {
  --fondo: #0B1120;
  --fondo-2: #0F172A;
  --tarjeta: #1E293B;
  --tarjeta-foco: #334155;
  --texto: #F1F5F9;
  --texto-2: #CBD5E1;
  --tenue: #94A3B8;
  --celeste: #3AAEF0;
  --celeste-texto: #7cc8f5;
  --rojo: #E50914;
  --radio: 12px;
  --margen: 40px;
  --titulos: "Montserrat", "Inter", system-ui, sans-serif;
}
@media (max-width: 720px) { :root { --margen: 16px; } }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body { font-family: "Inter", system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--celeste-texto); }
a:hover { color: #a9dcfa; }
img { display: block; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--celeste); outline-offset: 2px; }
[hidden] { display: none !important; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Encabezado ---------- */
.encabezado { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 10px var(--margen); background: rgba(11, 17, 32, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--tarjeta); }
.encabezado .logo img { height: 46px; width: auto; }
.menu { display: flex; gap: 24px; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; font-weight: 600; }
.menu::-webkit-scrollbar { display: none; }
.menu a { color: var(--texto-2); text-decoration: none; padding: 8px 0 6px; border-bottom: 3px solid transparent; white-space: nowrap; }
.menu a:hover { color: #fff; }
.menu a[aria-current="page"] { color: #fff; border-bottom-color: var(--celeste); }
.acciones { display: flex; align-items: center; gap: 10px; }
.boton-icono { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--tarjeta); color: var(--texto); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }
.boton-icono:hover { background: var(--tarjeta-foco); color: #fff; }
.avatar { border: 2px solid var(--celeste); background: #13213A; font-weight: 700; }
.menu-cuenta { position: relative; }
.menu-cuenta [role="menu"] { position: absolute; right: 0; top: 52px; min-width: 220px; background: var(--fondo-2); border: 1px solid var(--tarjeta); border-radius: var(--radio); padding: 8px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.menu-cuenta [role="menu"] p { margin: 4px 10px 10px; color: var(--tenue); font-size: 13px; }
.menu-cuenta [role="menuitem"] { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--texto); cursor: pointer; }
.menu-cuenta [role="menuitem"]:hover { background: var(--tarjeta); }
@media (max-width: 720px) {
  .encabezado { flex-wrap: wrap; gap: 8px 16px; }
  .encabezado .logo img { height: 38px; }
  .menu { order: 3; flex-basis: 100%; gap: 20px; }
}

/* ---------- Botones ---------- */
.boton { display: inline-flex; align-items: center; gap: 10px; padding: 12px 24px; border-radius: 10px; font-weight: 700; font-size: 16px; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.boton-principal { background: var(--celeste); color: var(--fondo); }
.boton-principal:hover { background: #64c1f4; color: var(--fondo); }
.boton-secundario { background: transparent; color: var(--texto); border-color: var(--texto); }
.boton-secundario:hover { background: rgba(255,255,255,.08); color: #fff; }
.boton-rojo { background: var(--rojo); color: #fff; }
.boton-rojo:hover { background: #f5333c; color: #fff; }

/* ---------- Etiquetas ---------- */
.en-vivo { display: inline-flex; align-items: center; gap: 7px; background: var(--rojo); color: #fff; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; }
.en-vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.chip-canal { background: var(--texto); color: var(--fondo); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; }
.barra { position: relative; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); overflow: hidden; }
.barra > span { position: absolute; inset: 0 auto 0 0; background: var(--rojo); }

/* ---------- Destacados (carrusel) ---------- */
.destacados { position: relative; height: min(560px, 72vh); min-height: 420px; overflow: hidden; background: var(--fondo-2); }
.destacado { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; }
.destacado.activo { opacity: 1; pointer-events: auto; }
.destacado > img, .destacado > .sin-imagen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.destacado .sombra { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,17,32,.96) 0%, rgba(11,17,32,.72) 40%, rgba(11,17,32,0) 72%), linear-gradient(0deg, var(--fondo) 0%, rgba(11,17,32,0) 32%); }
.destacado .contenido { position: relative; max-width: 640px; padding: 72px var(--margen) 0; display: flex; flex-direction: column; gap: 16px; }
.destacado .etiquetas { display: flex; gap: 10px; flex-wrap: wrap; }
.destacado .bajada { margin: 0; color: var(--celeste-texto); font-weight: 600; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.destacado .titulo-destacado { margin: 0; font-family: var(--titulos); font-weight: 800; font-size: clamp(30px, 4.2vw, 54px); line-height: 1.06; }
.destacado .descripcion { margin: 0; color: var(--texto-2); font-size: 17px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.destacado .horario { display: flex; align-items: center; gap: 14px; color: var(--texto-2); font-size: 14px; }
.destacado .horario .barra { flex: 0 0 220px; }
.destacado .botones { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.puntos { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.puntos button { width: 10px; height: 6px; padding: 0; border: 0; border-radius: 3px; background: #475569; cursor: pointer; transition: width .3s; }
.puntos button[aria-current="true"] { width: 28px; background: var(--celeste); }
@media (max-width: 720px) {
  .destacados { height: 440px; }
  .destacado .contenido { padding-top: 0; position: absolute; bottom: 64px; }
  .destacado .sombra { background: linear-gradient(0deg, rgba(11,17,32,.97) 0%, rgba(11,17,32,.55) 55%, rgba(11,17,32,.15) 100%); }
  .destacado .descripcion { display: none; }
}

/* ---------- Filas de tarjetas ---------- */
.filas { display: flex; flex-direction: column; gap: 36px; padding: 12px 0 56px; }
.fila-titulo { display: flex; align-items: baseline; gap: 14px; padding: 0 var(--margen); margin-bottom: 12px; }
.fila-titulo h2 { margin: 0; font-family: var(--titulos); font-size: 22px; font-weight: 700; }
.fila-titulo a { font-size: 14px; font-weight: 600; text-decoration: none; }
.carril-contenedor { position: relative; }
.carril { display: flex; gap: 18px; overflow-x: auto; scroll-behavior: smooth; padding: 4px var(--margen) 8px; scroll-padding: 0 var(--margen); scrollbar-width: none; }
.carril::-webkit-scrollbar { display: none; }
.flecha { position: absolute; top: 0; bottom: 64px; width: 48px; border: 0; background: linear-gradient(90deg, rgba(11,17,32,.95), rgba(11,17,32,0)); color: #fff; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; }
.flecha.derecha { right: 0; background: linear-gradient(270deg, rgba(11,17,32,.95), rgba(11,17,32,0)); }
.flecha.izquierda { left: 0; }
.carril-contenedor:hover .flecha, .flecha:focus-visible { opacity: 1; }
@media (hover: none) { .flecha { display: none; } }

.tarjeta { position: relative; flex: 0 0 300px; width: 300px; }
.tarjeta > a { display: flex; flex-direction: column; gap: 10px; color: var(--texto); text-decoration: none; border-radius: var(--radio); }
.tarjeta .imagen { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radio); overflow: hidden; background: var(--tarjeta); transition: transform .2s, box-shadow .2s; }
.tarjeta > a:hover .imagen, .tarjeta > a:focus-visible .imagen { transform: scale(1.03); box-shadow: 0 0 0 3px var(--celeste); }
.tarjeta > a:focus-visible { outline: none; }
.tarjeta .imagen img { width: 100%; height: 100%; object-fit: cover; }
.tarjeta .imagen .chip { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 90px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: rgba(11,17,32,.85); color: #fff; font-weight: 700; font-size: 13px; padding: 5px 10px; border-radius: 6px; }
.tarjeta .imagen .vivo { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; background: var(--rojo); color: #fff; font-weight: 700; font-size: 11px; padding: 4px 8px; border-radius: 5px; }
.tarjeta .imagen .vivo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.tarjeta .imagen .barra { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; }
.tarjeta .titulo { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 36px; }
.tarjeta .meta { font-size: 13px; color: var(--tenue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tarjeta .favorito { position: absolute; right: 0; bottom: 18px; width: 36px; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--tenue); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tarjeta .favorito:hover { color: #fff; background: var(--tarjeta); }
.tarjeta .favorito[aria-pressed="true"] { color: #FFC107; }
@media (max-width: 720px) { .tarjeta { flex-basis: 220px; width: 220px; } }

/* Imagen de respaldo cuando no hay captura: logo o iniciales */
.sin-imagen { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #1f2d47 0%, #111a2e 70%); }
.sin-imagen img { max-width: 55%; max-height: 55%; object-fit: contain; }
.sin-imagen span { font-family: var(--titulos); font-weight: 800; font-size: 34px; color: rgba(255,255,255,.85); letter-spacing: .02em; }

/* ---------- Páginas con grilla (Canales, Favoritos) ---------- */
.pagina { padding: 28px var(--margen) 56px; }
.pagina h1 { margin: 0 0 18px; font-family: var(--titulos); font-size: 30px; }
.herramientas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 22px; }
.buscador { flex: 1 1 280px; max-width: 460px; position: relative; }
.buscador input { width: 100%; padding: 12px 14px 12px 44px; border-radius: 10px; border: 2px solid transparent; background: var(--tarjeta); color: var(--texto); font: inherit; }
.buscador input:focus { outline: none; border-color: var(--celeste); }
.buscador svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--tenue); }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtros button { border: 0; padding: 10px 16px; border-radius: 22px; background: var(--tarjeta); color: var(--texto); font-weight: 600; cursor: pointer; }
.filtros button:hover { background: var(--tarjeta-foco); }
.filtros button[aria-pressed="true"] { background: var(--celeste); color: var(--fondo); }
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px 18px; }
.grilla .tarjeta { width: auto; }
.vacio { color: var(--tenue); text-align: center; padding: 60px 16px; }

/* ---------- Guía de TV ---------- */
.guia-pagina { padding: 24px 0 0; }
.guia-pagina .encabezado-guia { display: flex; align-items: baseline; gap: 16px; padding: 0 var(--margen) 14px; flex-wrap: wrap; }
.guia-pagina h1 { margin: 0; font-family: var(--titulos); font-size: 30px; }
.guia { position: relative; overflow: auto; height: calc(100vh - 160px); min-height: 420px; border-top: 1px solid var(--tarjeta); }
.guia-interior { position: relative; }
.guia-horas { position: sticky; top: 0; z-index: 4; display: flex; height: 40px; background: var(--fondo-2); }
.guia-horas .esquina { position: sticky; left: 0; z-index: 5; flex: 0 0 var(--col-canal); background: var(--fondo-2); display: flex; align-items: center; justify-content: center; color: var(--tenue); font-size: 12px; font-weight: 700; }
.guia-horas .hora { flex: 0 0 auto; display: flex; align-items: center; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.08); font-weight: 600; font-size: 13px; }
.guia-fila { display: flex; height: 68px; border-bottom: 1px solid var(--fondo); }
.guia-canal { position: sticky; left: 0; z-index: 3; flex: 0 0 var(--col-canal); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: var(--tarjeta); color: var(--texto); text-decoration: none; font-size: 12px; font-weight: 700; padding: 4px 6px; }
.guia-canal:hover { background: var(--tarjeta-foco); color: #fff; }
.guia-canal img { max-width: 76px; max-height: 30px; object-fit: contain; }
.guia-canal .nombre { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--texto-2); }
.guia-programas { position: relative; flex: 0 0 auto; background: #0d1528; }
.programa { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 10px; border-right: 1px solid var(--fondo); background: var(--tarjeta); color: var(--texto); text-decoration: none; overflow: hidden; }
.programa:hover, .programa:focus-visible { background: var(--tarjeta-foco); outline: none; box-shadow: inset 0 0 0 2px var(--celeste); }
.programa.actual { background: #2a3a55; }
.programa.pasado { color: var(--tenue); }
.programa .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.programa .h { font-size: 11px; color: var(--tenue); white-space: nowrap; position: relative; }
.programa .avance { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.06); }
.programa.vacio-guia { color: var(--tenue); font-size: 13px; background: rgba(30,41,59,.55); }
.linea-ahora { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--celeste); z-index: 2; pointer-events: none; }
.linea-ahora::before { content: ""; position: absolute; top: 34px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--celeste); }

/* ---------- Reproductor ---------- */
.reproductor { position: fixed; inset: 0; background: #000; z-index: 50; }
.reproductor video { width: 100%; height: 100%; background: #000; }
.capa { position: absolute; left: 0; right: 0; z-index: 2; transition: opacity .3s; }
.reproductor.quieto .capa { opacity: 0; pointer-events: none; }
.capa-arriba { top: 0; display: flex; align-items: flex-start; gap: 16px; padding: 16px var(--margen) 48px; background: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,0)); }
.capa-arriba .info { flex: 1 1 auto; min-width: 0; }
.capa-arriba .canal { display: flex; align-items: center; gap: 12px; }
.capa-arriba .canal h1 { margin: 0; font-family: var(--titulos); font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.capa-arriba .canal .numero { color: var(--tenue); font-weight: 700; }
.ahora-siguiente { margin-top: 8px; max-width: 520px; }
.ahora-siguiente .rotulo { color: var(--rojo); font-weight: 700; font-size: 12px; letter-spacing: .03em; }
.ahora-siguiente .programa-actual { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ahora-siguiente .barra { margin: 6px 0; max-width: 320px; }
.ahora-siguiente .despues { color: var(--tenue); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.capa-abajo { bottom: 0; display: flex; align-items: center; gap: 12px; padding: 48px var(--margen) 22px; background: linear-gradient(0deg, rgba(0,0,0,.85), rgba(0,0,0,0)); flex-wrap: wrap; }
.capa-abajo .espacio { flex: 1 1 auto; }
.boton-vivo { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 22px; border: 0; background: var(--rojo); color: #fff; font-weight: 700; cursor: pointer; }
.boton-vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.boton-vivo.atrasado { background: rgba(255,255,255,.22); }
.boton-vivo.atrasado::before { background: rgba(255,255,255,.6); }
.mensaje-reproductor { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(0,0,0,.82); }
.mensaje-reproductor > div { max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mensaje-reproductor h2 { margin: 0; font-family: var(--titulos); }
.mensaje-reproductor p { margin: 0; color: var(--texto-2); }
.cargando { position: absolute; top: 50%; left: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--rojo); animation: girar 0.9s linear infinite; z-index: 2; pointer-events: none; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cargando { animation-duration: 2s; } .destacado { transition: none; } }

/* ---------- Ingreso ---------- */
.ingreso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0%, #16264a 0%, var(--fondo) 60%); }
.ingreso form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.ingreso .placa-logo { align-self: center; width: 172px; height: 172px; border-radius: 28px; background: #fff; padding: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.ingreso .placa-logo img { max-width: 100%; max-height: 100%; }
.ingreso h1 { margin: 0 0 4px; text-align: center; font-family: var(--titulos); font-size: 24px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 14px; font-weight: 600; color: var(--texto-2); }
.campo input { padding: 13px 14px; border-radius: 10px; border: 2px solid transparent; background: var(--tarjeta); color: var(--texto); font: inherit; }
.campo input:focus { outline: none; border-color: var(--celeste); }
.ingreso .boton { justify-content: center; margin-top: 8px; }
.error { color: #ff8a8f; text-align: center; margin: 0; }
.nota { color: var(--tenue); font-size: 13px; text-align: center; margin: 0; }

/* ---------- Pie ---------- */
.pie { padding: 24px var(--margen) 40px; color: var(--tenue); font-size: 13px; border-top: 1px solid var(--tarjeta); }

/* Reproductor: botones sobre el video y aviso para tocar play */
.reproductor.quieto { cursor: none; }
.reproductor .boton-icono { background: rgba(255,255,255,.14); color: #fff; }
.reproductor .boton-icono:hover { background: rgba(255,255,255,.28); }
.reproductor .boton-icono[aria-pressed="true"] { color: #FACC15; }
.capa-arriba .canal img { height: 34px; max-width: 90px; object-fit: contain; }
.capa-abajo .siguiente-canal { color: var(--texto-2); font-size: 13px; }
@media (max-width: 720px) {
  .capa-arriba .canal h1 { font-size: 18px; }
  .capa-abajo { gap: 8px; }
  .capa-abajo .siguiente-canal { display: none; }
}
main#contenido { position: relative; min-height: 60vh; }
main#contenido:focus { outline: none; }
.mensaje-reproductor .botones { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.acciones { margin-left: auto; }
.oculto-hasta-foco { position: absolute; left: 12px; top: -60px; z-index: 30; padding: 10px 16px; border-radius: 8px; background: var(--celeste); color: var(--fondo); font-weight: 700; text-decoration: none; }
.oculto-hasta-foco:focus { top: 12px; }
.capa-arriba .info { text-shadow: 0 1px 3px rgba(0,0,0,.85); }
.ahora-siguiente .rotulo { color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.ahora-siguiente .rotulo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rojo); }
