/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a24;
  --text: #f0f0f5;
  --text-muted: #a0a0b0;
  --accent: #e50914;
  --accent-hover: #f40612;
  --gold: #f5c518;
  --border: rgba(255,255,255,0.08);
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
  --transition: 0.25s ease;
  --header-h: 70px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

.no-results {
  color: var(--text-muted);
  grid-column: 1 / -1;
  padding: 24px 0;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(10,10,15,0.95), rgba(10,10,15,0.7));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.logo-img {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}
.logo-img-footer {
  height: 28px;
  max-width: 120px;
}
@media (max-width: 768px) {
  .logo-img {
    height: 32px;
    max-width: 120px;
  }
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  color: white;
}

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

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-link:hover,
.nav-link:focus { color: var(--text); }

.search-box {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  width: 280px;
  transition: border-color var(--transition), width var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  width: 320px;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-box button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.search-box button:hover { opacity: 1; }

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  padding: 8px;
}

/* Botón de lupa premium para móvil (oculto en PC) */
.search-toggle-mobile {
  display: none;
  font-size: 1.15rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}

.search-toggle-mobile:hover,
.search-toggle-mobile:active {
  border-color: var(--accent);
}

/* Buscador a pantalla completa estilo Netflix (solo móvil).
   Es un overlay totalmente independiente del modal de detalle (#modal):
   no comparte clases, estado ni z-index con él. Usa una capa propia,
   más alta que cualquier otro overlay del sitio, para que si alguna vez
   llegan a coexistir en pantalla, el buscador siempre quede encima y
   nunca se confunda visualmente con el modal de detalle. */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  background: #0a0a0f;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-overlay.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.search-overlay-results {
  padding: 12px 16px 100px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 10px;
}
.search-overlay-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255,255,255,0.5);
  padding: 40px 16px;
  font-size: 0.95rem;
}

.search-overlay-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  width: 100%;
}

.search-overlay-close {
  font-size: 1.4rem;
  color: var(--text);
  padding: 6px;
  flex-shrink: 0;
}

.search-overlay-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1.5px solid #3b82f6;
  border-radius: 999px;
  padding: 12px 16px;
  box-sizing: border-box;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-overlay-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.search-overlay-icon {
  display: flex;
  align-items: center;
  opacity: 0.7;
  flex-shrink: 0;
}

.search-overlay-clear {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  color: var(--text);
  font-size: 0.75rem;
}

.search-overlay-clear.visible {
  display: flex;
}

.search-overlay-box input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.05rem;
  -webkit-appearance: none;
  appearance: none;
}

.search-overlay-box input::placeholder {
  color: var(--text-muted);
}

/* Ocultar el botón "X" nativo de type=search (Chrome/Safari/Edge):
   ya tenemos nuestra propia "X" (.search-overlay-clear) con el estilo
   del diseño, y mostrar las dos duplicaría el control. */
.search-overlay-box input[type="search"]::-webkit-search-cancel-button,
.search-overlay-box input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* ===== Hero Cinematográfico estilo Netflix/Disney+ ===== */
.hero-cinematic {
  position: relative;
  height: 82vh;
  min-height: 440px;
  max-height: 780px;
  margin-top: 0;
  overflow: hidden;
  background: #000;
  color: #fff;
}

.hero-video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #000;
}

.hero-video-wrap iframe,
.hero-video-wrap video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
  object-fit: cover;
  /* Evita suavizado excesivo al escalar */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: auto;
}

.hero-video-wrap video {
  /* Reproduce a resolución nativa del archivo */
  max-width: none;
  max-height: none;
}

.hero-video-wrap .hero-poster-fallback {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* Overlay suave: el trailer se ve claro en el centro */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.28) 28%,
    rgba(0,0,0,0.08) 50%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(10,10,18,0.75) 35%, rgba(10,10,18,0.25) 70%, transparent 100%);
  pointer-events: none;
}

/* Título y texto abajo-izquierda, sin tapar el centro del trailer */
.hero-content {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: min(420px, 70%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 36px 4%;
  box-sizing: border-box;
  pointer-events: none;
}
.hero-content .hero-btn-more,
.hero-content button {
  pointer-events: auto;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  margin: 0 0 10px;
}

.hero-meta .rating {
  color: #f5c518;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-meta .dot-sep {
  opacity: 0.5;
}

.hero-meta .genre {
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

.hero-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0,0,0,0.7);
}

.hero-text {
  color: rgba(255,255,255,0.88);
  font-size: clamp(0.82rem, 1.2vw, 0.95rem);
  line-height: 1.45;
  margin: 0 0 14px;
  max-width: 380px;
  overflow: hidden;
  text-shadow: 0 1px 10px rgba(0,0,0,0.55);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Botón "Ver más" estilo Netflix (como la captura) */
.hero-btn-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.14);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.hero-btn-more:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.85);
  transform: translateY(-1px);
}

.hero-btn-more .hero-btn-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #111;
  font-size: 0.7rem;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Controles de navegación (abajo derecha, como la foto) */
.hero-nav {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.hero-nav-btn:hover {
  background: rgba(255,255,255,0.28);
  transform: scale(1.06);
}

.hero-nav-btn.hero-nav-play {
  background: #2b6cf6;
  box-shadow: 0 2px 12px rgba(43,108,246,0.45);
}

.hero-nav-btn.hero-nav-play:hover {
  background: #3b7cf8;
  box-shadow: 0 4px 16px rgba(43,108,246,0.55);
}

.hero-nav-btn svg {
  display: block;
  pointer-events: none;
}

.hero-nav-btn.is-muted .icon-unmuted { display: none !important; }
.hero-nav-btn.is-muted .icon-muted { display: block !important; }
.hero-nav-btn:not(.is-muted) .icon-unmuted { display: block; }
.hero-nav-btn:not(.is-muted) .icon-muted { display: none; }

.hero-nav-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.35);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Dots del hero (abajo centro) — estilo original PC */
.hero-dots {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  align-items: center;
  pointer-events: auto;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.25s ease;
}

.hero-dot:hover {
  background: rgba(255,255,255,0.6);
}

.hero-dot.active {
  background: #e50914;
  width: 18px;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-cinematic {
    height: 56vh;
    min-height: 280px;
    max-height: 480px;
  }
  .hero-content {
    width: min(100%, 92%);
    padding-left: 5%;
    padding-bottom: 78px;
    align-items: center;
    text-align: center;
  }
  .hero-title {
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    text-align: center;
  }
  .hero-text {
    display: none;
  }
  .hero-nav {
    right: 14px;
    bottom: 16px;
    gap: 6px;
  }
  .hero-nav-btn {
    width: 38px;
    height: 38px;
  }
  .hero-nav-btn svg {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 520px) {
  .hero-cinematic {
    height: 48vh;
    min-height: 240px;
    max-height: 360px;
  }
  .hero-content {
    padding-bottom: 70px;
  }
  .hero-title {
    font-size: 0.9rem;
  }
  .hero-text {
    display: none;
  }
  .hero-btn-more {
    padding: 9px 16px;
    font-size: 0.88rem;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: white;
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.22);
}

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.btn-load-more {
  min-width: 180px;
  padding: 14px 32px;
  font-size: 1rem;
}

/* ===== Sections ===== */
.section {
  padding: 28px 0;
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-elevated);
  padding: 4px;
  border-radius: 8px;
}

.tab {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}

.tab.active, .tab:hover {
  background: var(--bg-card);
  color: var(--text);
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-see-all {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  white-space: nowrap;
  transition: filter var(--transition);
}

.btn-see-all:hover {
  filter: brightness(1.1);
}

/* ===== Carousel ===== */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}

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

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  color: white;
  font-size: 1.6rem;
  display: grid;
  place-items: center;
  z-index: 5;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
}

.carousel:hover .carousel-btn { opacity: 1; }

.carousel-btn.prev { left: -8px; }
.carousel-btn.next { right: -8px; }

.carousel-btn:hover { background: var(--accent); }

/* ===== Cards ===== */
.card {
  flex: 0 0 150px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: transparent;
  border: none;
  contain: content;
}

.card:hover,
.card:focus {
  outline: none;
}

.card-poster {
  aspect-ratio: 2/3;
  background: #1a1a24;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

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

/* Botón play centrado: solo visible al pasar el mouse */
.card-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e50914;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.card-play-btn svg {
  margin-left: 2px;
}

.card:hover .card-play-btn,
.card:focus .card-play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Franja inferior: rating, año, género */
.card-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
  pointer-events: none;
}

.card-rating {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
}

.card-year {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.9);
  font-weight: 500;
}

.card-genre {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.75);
  width: 100%;
  margin-top: -2px;
}

/* Título debajo del póster */
.card-caption {
  padding: 8px 2px 0;
}

.card-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Legacy hooks (por si quedan referencias) */
.card-overlay,
.card-top,
.card-bottom,
.card-tags,
.card-actions,
.card-type,
.card-meta,
.card-tag,
.card-btn-play {
  display: none !important;
}

/* ===== Grid ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px;
}

.grid .card {
  flex: none;
  width: 100%;
}

.load-more-wrap {
  text-align: center;
  margin-top: 20px;
}

.back-to-top-wrap {
  text-align: center;
  margin-top: 32px;
}

.btn-back-to-top {
  min-width: 220px;
  padding: 14px 32px;
  font-size: 1rem;
}

/* ===== Detail View (full page, no floating modal) ===== */
.detail-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  background: var(--bg);
}

.detail-view.open {
  opacity: 1;
  visibility: visible;
}

.detail-content {
  position: relative;
  background: var(--bg);
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.detail-close {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  font-size: 1.3rem;
  z-index: 30;
  display: grid;
  place-items: center;
  transition: background var(--transition);
  border: 1px solid rgba(255,255,255,0.15);
}

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

.detail-body {
  display: block;
  min-height: 100%;
}

.detail-hero {
  position: relative;
  padding-bottom: 24px;
  min-height: 82vh;
  width: 100%;
  overflow: hidden;
  background: #050507;
}

/* Capa de fondo: imagen real a pantalla completa del hero */
.detail-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #050507;
  pointer-events: none;
}

.detail-backdrop-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  /* Grade de color: más contraste y saturación, como un fotograma de cine */
  filter: contrast(1.12) saturate(1.15) brightness(0.94);
  transform: scale(1.04);
}

/* Si solo hay póster (vertical), se difumina y amplía de fondo */
.detail-backdrop-img.detail-backdrop-poster {
  object-fit: cover;
  object-position: center top;
  filter: blur(28px) brightness(0.5) saturate(1.15) contrast(1.1);
  transform: scale(1.3);
}

/* Efecto cinematográfico: viñeta profunda + degradado para leer el texto */
.detail-backdrop-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      ellipse 140% 100% at 15% 30%,
      rgba(5, 5, 7, 0) 0%,
      rgba(5, 5, 7, 0.25) 55%,
      rgba(5, 5, 7, 0.55) 100%
    ),
    linear-gradient(
      90deg,
      rgba(5, 5, 7, 0.88) 0%,
      rgba(5, 5, 7, 0.55) 26%,
      rgba(5, 5, 7, 0.18) 50%,
      rgba(5, 5, 7, 0.06) 72%,
      rgba(5, 5, 7, 0.22) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(5, 5, 7, 0.35) 0%,
      rgba(5, 5, 7, 0.05) 22%,
      rgba(5, 5, 7, 0.1) 55%,
      rgba(5, 5, 7, 0.94) 93%,
      var(--bg) 100%
    );
}

.detail-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 84px 48px 32px;
  max-width: 620px;
  margin: 0;
  z-index: 2;
}

/* Texto legible sin tapar el fondo a pantalla completa */
.detail-header-info {
  text-shadow: 0 2px 18px rgba(0,0,0,0.85);
}

.detail-poster-img {
  width: 100%;
  max-width: 180px;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  display: block;
}

.detail-eyebrow {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f5730c;
  margin-bottom: 10px;
}

.detail-overview-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-overview.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.ver-mas-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: 20px;
  background: none;
  border: none;
  padding: 0;
  color: rgba(240,240,245,0.5);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.ver-mas-btn:hover {
  color: #f5730c;
}

/* Logo oficial del título (TMDB) — como el "PRIMATE" de la foto */
.detail-title-logo {
  display: block;
  max-width: min(440px, 100%);
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 16px;
  filter: drop-shadow(0 4px 22px rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.25s ease;
}
.detail-title-logo.is-ready,
.detail-title-logo[src] {
  opacity: 1;
}

.detail-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(2.4rem, 4.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 14px;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,0.9);
}

.detail-title.detail-title-text {
  color: #fff;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: rgba(240,240,245,0.6);
}

.detail-meta .rating {
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
}

.detail-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 12px;
  color: rgba(240,240,245,0.3);
}

.type-badge {
  background: var(--accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 4px;
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.genre-tag {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.16);
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(240,240,245,0.75);
}

/* Sinopsis + Ver más */
.detail-overview {
  max-width: 540px;
  color: rgba(240,240,245,0.85);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 0 6px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  background: #e50914;
  color: white;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 0 26px;
  border-radius: 8px;
  width: fit-content;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 4px 18px rgba(229,9,20,0.4);
}

.btn-play:hover {
  background: #f40612;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(229,9,20,0.5);
}

.detail-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px 40px;
}

.detail-section {
  margin-bottom: 22px;
}

.detail-section h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.detail-overview {
  color: rgba(255,255,255,0.9);
  line-height: 1.7;
  font-size: 1.05rem;
  max-width: 720px;
}


.detail-section-inline {
  margin-top: 4px;
  margin-bottom: 18px;
}
.detail-section-inline h3 {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: rgba(240,240,245,0.5);
  margin-bottom: 6px;
}
.detail-header-info .detail-overview {
  max-width: 100%;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.88);
}

.detail-director {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}

/* ===== Cast Grid (carrusel con flechas en PC) ===== */
.cast-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.cast-section-header h3 {
  margin-bottom: 0;
}

.cast-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cast-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cast-scroll-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 6px;
  scrollbar-width: none; /* ocultar barra en PC; se usan flechas */
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.cast-scroll-wrap::-webkit-scrollbar {
  display: none;
  height: 0;
}

.cast-nav-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s, opacity 0.2s, border-color 0.2s;
  cursor: pointer;
  z-index: 2;
}

.cast-nav-btn:hover:not(.disabled):not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cast-nav-btn.disabled,
.cast-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.cast-grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  padding: 4px 0 10px;
}

.cast-card {
  flex: 0 0 100px;
  width: 100px;
  max-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0;
  margin: 0;
  height: auto;
  transition: transform 0.2s;
  box-sizing: border-box;
}

.cast-card:hover {
  transform: translateY(-3px);
}

.cast-card.cast-hidden {
  display: none;
}

.cast-photo {
  width: 100px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
  margin: 0 0 8px 0;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  aspect-ratio: 5 / 6;
  box-sizing: border-box;
}

.cast-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.cast-photo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-elevated);
}

.cast-info {
  width: 100px;
  max-width: 100px;
  min-width: 100px;
  padding: 0;
  margin: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  box-sizing: border-box;
}

.cast-name {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  min-height: 2.6em;   /* siempre reserva 2 líneas */
  max-height: 2.6em;
  text-align: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.cast-character {
  font-family: 'Work Sans', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  min-height: 2.5em;   /* siempre reserva 2 líneas */
  max-height: 2.5em;
  text-align: center;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.cast-more-wrap {
  margin-top: 18px;
  text-align: center;
}

.btn-show-more {
  min-width: 160px;
}

.no-cast {
  color: var(--text-muted);
  font-size: 0.95rem;
}


/* Móvil: sin flechas, scroll táctil con barra sutil */
@media (max-width: 700px) {
  .cast-nav-btn { display: none; }
  .cast-header-nav { display: none; }
  .cast-scroll-wrap {
    scrollbar-width: thin;
    padding-left: 0;
    padding-right: 0;
  }
  .cast-scroll-wrap::-webkit-scrollbar {
    display: block;
    height: 4px;
  }
  .cast-scroll-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
  }
  .cast-grid {
    align-items: flex-start;
  }
  .cast-card {
    align-items: center;
  }
}

/* ===== Seasons & Episodes ===== */
.seasons-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.season-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.season-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.season-select {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  min-width: 220px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.season-select:focus {
  border-color: var(--accent);
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

.episodes-loading {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

.episode-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.episode-item:hover {
  border-color: rgba(229,9,20,0.4);
  background: #16161f;
}

.episode-still {
  position: relative;
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #0d0d12;
  flex-shrink: 0;
}

.episode-still-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 1.1rem;
}

.episode-num {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.75);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.episode-info {
  min-width: 0;
}

.episode-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-episode-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}

.btn-episode-play:hover {
  transform: scale(1.1);
  background: var(--accent-hover);
}

/* ===== Player ===== */
.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.player-overlay.open {
  opacity: 1;
  visibility: visible;
}

.player-overlay.no-transition {
  transition: none;
}

.player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(0,0,0,0.85), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}
.player-top .player-close,
.player-top .player-top-actions {
  pointer-events: auto;
}

.player-title {
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.player-open-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.player-open-tab:hover {
  background: var(--accent);
  color: #fff;
}

.player-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  font-size: 1.25rem;
  display: grid;
  place-items: center;
  transition: background 0.2s;
  border: none;
  color: #fff;
  cursor: pointer;
}

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

.player-frame {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  width: 100%;
  height: 100%;
}

.player-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-touch-callout: default;
}
.player-overlay {
  z-index: 2000;
}
.player-overlay.open {
  z-index: 2000;
}
@media (max-width: 768px) {
  .player-frame {
    /* Área completa táctil para el iframe */
    position: absolute;
    inset: 0;
    z-index: 1;
  }
  .player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

.player-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: #000;
  color: var(--text);
  pointer-events: none;
}

.player-status p {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.player-status-hint {
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  color: var(--text-muted);
  max-width: 420px;
}

.player-status-error p:first-child {
  color: var(--accent);
}

/* Solo el alto del header fijo + un poco de aire (sin hueco enorme) */
#searchResults,
#seeAllResults {
  padding-top: calc(var(--header-h) + 12px);
}

.footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 14px 0 10px;
  margin-top: 20px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.footer-brand .logo-text {
  font-size: 0.95rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2px;
  max-width: 320px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ===== Config banner ===== */
.config-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a00;
  border-top: 1px solid #f5c518;
  padding: 12px 0;
  z-index: 150;
  font-size: 0.9rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .menu-toggle { display: none; }

  .section-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .tabs {
    justify-content: flex-end;
  }
  #trendingSeeAll {
    display: none;
  }
  .search-box { display: none; }
  .search-toggle-mobile {
    display: flex;
    margin-left: auto;
  }

  .detail-hero {
    min-height: 70vh;
  }
  .detail-backdrop-img {
    object-position: center center;
  }
  .detail-hero-inner {
    grid-template-columns: 1fr;
    padding: 80px 24px 20px;
    gap: 24px;
    text-align: left;
  }
  .detail-title { font-size: 1.7rem; }
  .detail-title-logo {
    margin-left: 0;
    margin-right: auto;
    max-height: 90px;
  }
  .detail-meta, .detail-genres { justify-content: flex-start; }
  .detail-actions { justify-content: center; }
  .btn-play { margin: 0 auto; }
  .detail-main { padding: 0 24px 48px; }

  .cast-card {
    flex: 0 0 84px;
    width: 84px;
    max-width: 84px;
    align-items: center;
  }
  .cast-photo {
    width: 84px;
    height: 101px;
    border-radius: 10px;
    margin: 0 0 6px 0;
  }
  .cast-info {
    width: 84px;
    min-width: 84px;
    max-width: 84px;
    align-items: center;
  }
  .cast-name {
    font-size: 11px;
    min-height: 2.6em;
    max-height: 2.6em;
    text-align: center;
  }
  .cast-character {
    font-size: 9px;
    min-height: 2.4em;
    max-height: 2.4em;
    text-align: center;
  }
  .cast-grid {
    gap: 12px;
    align-items: flex-start;
  }
}


@media (max-width: 600px) {
  .card { flex: 0 0 120px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .section { padding: 20px 0; }
  .header-inner { gap: 12px; }
  .card-title { font-size: 0.85rem; }

  .episode-item {
    grid-template-columns: 100px 1fr auto;
    gap: 10px;
  }
  .episode-still { width: 100px; }

  .cast-card {
    flex: 0 0 80px;
    width: 80px;
    max-width: 80px;
    align-items: center;
  }
  .cast-photo {
    width: 80px;
    height: 96px;
    border-radius: 10px;
    margin: 0 0 6px 0;
  }
  .cast-info {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    align-items: center;
  }
  .cast-name {
    font-size: 11px;
    min-height: 2.6em;
    max-height: 2.6em;
    text-align: center;
  }
  .cast-character {
    font-size: 9px;
    min-height: 2.4em;
    max-height: 2.4em;
    text-align: center;
  }
  .cast-grid {
    gap: 10px;
    align-items: flex-start;
  }
}


/* Larger screens / TV */
@media (min-width: 1400px) {
  .container { max-width: 1600px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px; }
  .card { flex: 0 0 155px; }
  .cast-card { flex: 0 0 110px; width: 110px; max-width: 110px; }
  .cast-photo { width: 110px; height: 132px; margin: 0 0 8px 0; }
  .cast-info { width: 110px; min-width: 110px; max-width: 110px; }
}

/* TV / Android TV friendly (larger targets) */
@media (min-width: 1920px) {
  .btn, .tab, .carousel-btn, .btn-episode-play, .detail-close, .player-close {
    min-height: 52px;
  }
  .card:focus {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
  }
  .cast-card { flex: 0 0 120px; width: 120px; max-width: 120px; }
  .cast-photo { width: 120px; height: 144px; margin: 0 0 8px 0; }
  .cast-info { width: 120px; min-width: 120px; max-width: 120px; }
  .section-title { font-size: 1.7rem; }
}

/* Focus visible for remote navigation */
.card:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ===== Móvil: quitar toques azules / highlight al tocar ===== */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

a, button, input, select, textarea,
.card, .nav-link, .tab, .btn, .hero-nav-btn,
.carousel-btn, .menu-toggle, .detail-close,
.player-close, .hero-dot, .cast-nav-btn,
.btn-episode-play, .hero-btn-more {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  outline: none;
}

/* En móvil no mostrar outline azul al tocar; el focus por teclado se mantiene con :focus-visible */
@media (hover: none) and (pointer: coarse) {
  a:focus,
  button:focus,
  .card:focus,
  .nav-link:focus,
  .tab:focus,
  .btn:focus,
  .hero-nav-btn:focus,
  .carousel-btn:focus,
  .menu-toggle:focus,
  .detail-close:focus,
  .player-close:focus,
  .hero-dot:focus,
  .cast-nav-btn:focus,
  .btn-episode-play:focus,
  .hero-btn-more:focus {
    outline: none;
    box-shadow: none;
  }

  /* Sin flechas de carrusel en táctil: se navega con swipe/scroll */
  .carousel-btn {
    display: none !important;
  }
}

/* ===== Móvil: Hero cinematográfico (estilo captura) ===== */
@media (max-width: 768px) {
  .hero-cinematic {
    height: 78vh;
    min-height: 480px;
    max-height: 720px;
    margin-top: 0;
  }

  .hero-video-wrap {
    inset: 0;
  }

  .hero-video-wrap video,
  .hero-video-wrap iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    object-position: center 30%;
  }

  .hero-video-wrap .hero-poster-fallback {
    background-size: cover;
    background-position: center 30%;
  }

  /* Gradiente abajo para leer el texto, imagen limpia arriba */
  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.95) 0%,
      rgba(0,0,0,0.55) 28%,
      rgba(0,0,0,0.12) 55%,
      transparent 78%
    ) !important;
  }
  .hero-gradient {
    height: 58%;
    background: linear-gradient(
      to top,
      #0a0a0f 0%,
      rgba(10,10,15,0.88) 28%,
      rgba(10,10,15,0.25) 60%,
      transparent 100%
    ) !important;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 20px 36px 20px;
    pointer-events: none;
    align-items: flex-start;
    text-align: left;
  }
  .hero-content .hero-btn-more,
  .hero-content button {
    pointer-events: auto;
  }

  /* Badge tipo "EN CINES" si existe en meta */
  .hero-meta {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
    margin: 0 0 10px;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .hero-meta .rating { color: #f5c518; }

  .hero-title {
    font-size: clamp(1.85rem, 7.5vw, 2.6rem) !important;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-transform: none;
    margin: 0 0 12px;
    max-width: 95%;
    text-shadow: 0 2px 24px rgba(0,0,0,0.9);
    text-align: left;
  }

  /* Sinopsis visible, 2–3 líneas */
  .hero-text {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255,255,255,0.88);
    max-width: 100%;
    margin: 0 0 14px;
    text-align: left;
    text-shadow: 0 1px 12px rgba(0,0,0,0.85);
  }

  .hero-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .hero-btn-more {
    padding: 10px 18px;
    font-size: 0.88rem;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .hero-nav {
    display: none !important;
  }

  /* Dots visibles y rojos solo en móvil (sin cambiar tamaños del hero) */
  .hero-dots {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 20;
  }
  .hero-dot {
    background: rgba(229, 9, 20, 0.45) !important;
  }
  .hero-dot.active {
    background: #e50914 !important;
    width: 18px;
    border-radius: 4px;
    transform: none;
  }
}

/* Header transparente sobre el hero en móvil */
@media (max-width: 768px) {
  .header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent) !important;
    border-bottom: none !important;
  }
  body:not(.scrolled) .header {
    background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent) !important;
  }
}

@media (max-width: 400px) {
  .hero-cinematic {
    height: 72vh;
    min-height: 420px;
    max-height: 600px;
  }
  .hero-title {
    font-size: clamp(1.6rem, 7vw, 2.1rem) !important;
  }
  .hero-content {
    padding: 0 16px 32px 16px;
  }
}

/* sin flechas de navegacion en el hero (todas las pantallas) */
.hero-nav {
  display: none !important;
}

/* ===== Mobile performance ===== */
@media (max-width: 768px) {
  /* blur del header es caro en GPU móvil */
  .header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(10, 10, 15, 0.96);
  }

  /* Secciones fuera de pantalla: menos trabajo de layout/pintado */
  #movies,
  #terror,
  #series {
    content-visibility: auto;
    contain-intrinsic-size: 280px;
  }

  /* Carruseles: contener el repaint */
  .carousel-track {
    will-change: scroll-position;
  }

  .card img {
    content-visibility: auto;
  }
}


/* ===== Móvil: tarjetas, detalle y layout ===== */
@media (max-width: 768px) {
  :root {
    --header-h: 58px;
  }

  .container {
    padding: 0 14px;
  }

  .section {
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 20px;
  }

  #searchResults,
  #seeAllResults {
    padding-top: calc(var(--header-h) + 8px);
  }

  .section-title {
    font-size: 1.15rem;
  }

  /* Tarjetas más compactas en carrusel */
  .card {
    flex: 0 0 118px;
  }

  .card-poster {
    border-radius: 10px;
  }

  .card-play-btn {
    width: 40px;
    height: 40px;
  }

  .card-play-btn svg {
    width: 18px;
    height: 18px;
  }

  .card-footer {
    padding: 20px 8px 8px;
    gap: 4px 6px;
  }

  .card-rating,
  .card-year {
    font-size: 0.65rem;
  }

  .card-genre {
    font-size: 0.62rem;
  }

  .card-caption {
    padding: 6px 1px 0;
  }

  .card-title {
    font-size: 0.78rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  /* Grid de catálogo */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px 10px;
  }

  .grid .card {
    width: 100%;
  }

  /* En táctil el play se ve al tocar (active) o con opacity baja siempre opcional */
  .card:active .card-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  /* Detalle: foto de fondo completa en móvil */
  .detail-hero {
    min-height: 100svh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .detail-backdrop-img {
    object-fit: cover;
    object-position: center center;
    filter: contrast(1.08) saturate(1.1) brightness(0.88);
    transform: none;
    width: 100%;
    height: 100%;
  }
  /* Póster vertical: se ve completo (contain) centrado */
  .detail-backdrop-img.detail-backdrop-poster {
    object-fit: contain;
    object-position: center center;
    filter: none;
    transform: none;
    background: #050507;
  }
  .detail-backdrop {
    background: #050507;
  }
  /* Sombra más suave para no tapar la foto */
  .detail-backdrop-shade {
    background:
      linear-gradient(
        to bottom,
        rgba(5, 5, 7, 0.15) 0%,
        rgba(5, 5, 7, 0.05) 35%,
        rgba(5, 5, 7, 0.45) 70%,
        rgba(5, 5, 7, 0.92) 92%,
        var(--bg) 100%
      );
  }
  .detail-hero-inner {
    padding: 48px 16px 28px;
    gap: 14px;
    max-width: 100%;
  }

  .detail-eyebrow {
    font-size: 0.7rem;
  }

  .detail-title {
    font-size: 1.45rem;
  }

  .detail-title-logo {
    max-height: 72px;
    max-width: min(280px, 90%);
  }

  .detail-meta {
    font-size: 0.85rem;
    gap: 8px;
    justify-content: flex-start;
  }

  .detail-genres {
    justify-content: flex-start;
  }

  .genre-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
  }

  .detail-overview-clamp {
    font-size: 0.9rem;
    text-align: left;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .detail-actions {
    justify-content: center;
    width: 100%;
  }

  .btn-play {
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 20px;
    font-size: 0.95rem;
  }

  .detail-main {
    padding: 0 16px 40px;
  }

  .detail-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  /* Carrusel: más padding y sin flechas (ya ocultas en táctil) */
  .carousel-track {
    gap: 10px;
    padding-bottom: 4px;
  }

  .carousel-btn {
    display: none !important;
  }

  /* Episodios: siguen mostrando foto del capítulo */
  .episode-item {
    grid-template-columns: 100px 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .episode-still {
    display: block;
    width: 100px;
  }
}

@media (max-width: 400px) {
  .card {
    flex: 0 0 104px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px 8px;
  }

  .card-title {
    font-size: 0.72rem;
  }

  .card-play-btn {
    width: 36px;
    height: 36px;
  }
}

/* Táctil: mostrar play un poco al mantener/tocar, no solo hover de mouse */
@media (hover: none) and (pointer: coarse) {
  .card-play-btn {
    opacity: 0;
  }
  .card:active .card-play-btn,
  .card:focus .card-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    background: #e50914;
  }
}



.episode-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}


/* ========== CineFlix — móvil / PWA (PC sin cambios de layout) ========== */

/* Por defecto en PC: ocultar solo-móvil */
.logo-sub,
.btn-login-telegram,
.section-platforms,
.section-banner-telegram,
.bottom-nav {
  display: none !important;
}

.detodo-logo {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  line-height: 1;
}
.detodo-de { color: #e50914; }
.detodo-todo { color: #fff; }

/* Barra roja en títulos: solo en móvil */
.section-title-bar::before { display: none; }

/* ===== Solo móvil (≤768px): interfaz tipo captura ===== */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  /* Mostrar elementos de la captura */
  .logo-sub {
    display: block !important;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
    text-transform: uppercase;
  }
  .btn-login-telegram {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    background: #e50914;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
  }
  .btn-login-telegram:hover,
  .btn-login-telegram:active {
    background: #f40612;
    transform: scale(0.98);
  }
  .btn-login-telegram svg { flex-shrink: 0; }

  .section-platforms,
  .section-banner-telegram {
    display: block !important;
  }
  .bottom-nav {
    display: flex !important;
  }

  /* Header tipo app */
  .header {
    background: rgba(10,10,15,0.92);
    border-bottom: none;
  }
  .header-inner {
    gap: 10px;
    padding: 0 14px;
  }
  .logo {
    /* logo CineFlix normal también en móvil */
  }
  .nav { display: none !important; }
  .search-box { display: none !important; }
  .menu-toggle { display: none !important; }
  .search-toggle-mobile { display: flex !important; margin-left: auto; }

  /* Plataformas */
  .section-platforms { padding-top: 8px; padding-bottom: 4px; }
  .platforms-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 0 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .platforms-row::-webkit-scrollbar { display: none; }
  .platform-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
  }
  .platform-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.7rem;
    line-height: 1.1;
    text-align: center;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  }
  .platform-netflix { background: #000; color: #e50914; font-size: 1.6rem; font-weight: 900; }
  .platform-prime { background: #00a8e1; font-size: 0.55rem; }
  .platform-disney { background: linear-gradient(135deg, #0a1e5a, #1a3a8a); font-size: 0.65rem; }
  .platform-max { background: #000; font-size: 0.6rem; }
  .platform-paramount { background: #0064ff; font-size: 0.55rem; }
  .platform-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
  }

  /* Banner Telegram */
  .section-banner-telegram { padding-top: 4px; padding-bottom: 8px; }
  .banner-telegram {
    background: linear-gradient(135deg, #c41e1e, #e50914 60%, #b01010);
    border-radius: 14px;
    padding: 16px 18px;
    color: #fff;
    font-size: 0.88rem;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(229,9,20,0.25);
  }
  .banner-telegram strong { font-weight: 700; }

  /* Barra inferior */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10,10,15,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.08);
    justify-content: space-around;
    align-items: stretch;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,0.45);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .bottom-nav-item svg { opacity: 0.85; }
  .bottom-nav-item.active,
  .bottom-nav-item:active { color: #fff; }
  .bottom-nav-item.active svg { stroke: #e50914; color: #e50914; }
  .bottom-nav-item.active span { color: #e50914; font-weight: 600; }

  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .footer { display: none; }

  .section .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .section-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
  }
  .section-title-bar::before {
    display: block;
    content: '';
    width: 4px;
    height: 1.1em;
    background: #e50914;
    border-radius: 2px;
    flex-shrink: 0;
  }
}

@media (max-width: 520px) {
  .hero-content { padding: 0 16px 28px; }
  .hero-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .hero-text { font-size: 0.88rem; -webkit-line-clamp: 3; }
  .banner-telegram { font-size: 0.82rem; padding: 14px 16px; }
}

/* PWA instalada (standalone) — safe areas */
@media (display-mode: standalone) {
  .header {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  }
}

/* ===== Biblioteca tabs + búsqueda móvil ===== */

.library-tabs {
  display: none;
}
.mobile-search-bar {
  display: none;
}
.section-header-desktop-only { }
.search-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 12px 0 8px;
}

@media (max-width: 768px) {
  /* Tabs Biblioteca (como captura) */
  .library-tabs {
    display: flex;
    justify-content: center;
    gap: 28px;
    padding: 8px 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,10,15,0.96);
  }
  .library-tab {
    background: none;
    border: none;
    color: rgba(255,255,255,0.45);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 4px 12px;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .library-tab.active {
    color: #fff;
  }
  .library-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #e50914;
    border-radius: 3px 3px 0 0;
  }
  .header-library {
    height: auto;
    padding-bottom: 0;
  }
  .header-library .header-inner {
    height: var(--header-h);
  }
  /* En biblioteca móvil ocultamos logo/nav del header: solo tabs */
  .header-library .logo,
  .header-library .nav,
  .header-library .search-box,
  .header-library .search-toggle-mobile,
  .header-library .menu-toggle,
  .header-library .btn-login-telegram {
    display: none !important;
  }
  .header-library .header-inner {
    display: none;
  }
  .main-library {
    padding-top: 8px;
  }
  .section-header-desktop-only {
    display: none !important;
  }

  /* Barra de búsqueda en search.html */
  .mobile-search-bar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 80;
    padding: 10px 16px 12px;
    background: rgba(10,10,15,0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  body[data-page="search"] .header {
    display: none;
  }
  .mobile-search-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 10px 14px;
  }
  .mobile-search-icon {
    color: rgba(255,255,255,0.45);
    display: flex;
    flex-shrink: 0;
  }
  .mobile-search-inner input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    min-width: 0;
  }
  .mobile-search-inner input::placeholder {
    color: rgba(255,255,255,0.4);
  }
  .mobile-search-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1rem;
    padding: 0 4px;
    cursor: pointer;
  }
  .main-search {
    padding-top: 4px;
  }

  /* Grid tipo captura: 3 columnas */
  body[data-page="biblioteca"] .grid,
  body[data-page="search"] .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px;
  }
  body[data-page="biblioteca"] .card,
  body[data-page="search"] .card {
    flex: none;
    width: 100%;
  }
}

/* PC: ocultar tabs y barra móvil */
@media (min-width: 769px) {
  .library-tabs,
  .mobile-search-bar {
    display: none !important;
  }
  .header-library .header-inner {
    display: flex !important;
  }
}


/* ===== Detalle móvil estilo ficha (poster + Reproducir) — solo ≤768px ===== */
@media (max-width: 768px) {
  .detail-view.open,
  .detail-view {
    background: #0a0a0f;
  }
  .detail-content {
    background: #0a0a0f;
  }
  .detail-close {
    top: 14px;
    left: 14px;
    right: auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1.4rem;
    z-index: 30;
    display: grid;
    place-items: center;
    border: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .detail-close:hover { background: rgba(0,0,0,0.7); }

  .detail-hero {
    min-height: 72vh;
    min-height: 72dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 0;
  }
  .detail-backdrop-img {
    object-fit: cover !important;
    object-position: center top !important;
    filter: none !important;
    transform: none !important;
  }
  .detail-backdrop-img.detail-backdrop-poster {
    object-fit: cover !important;
    object-position: center top !important;
    filter: none !important;
    transform: none !important;
  }
  .detail-backdrop-shade {
    background: linear-gradient(
      to bottom,
      rgba(0,0,0,0.15) 0%,
      rgba(0,0,0,0) 35%,
      rgba(0,0,0,0.35) 60%,
      rgba(10,10,15,0.92) 88%,
      #0a0a0f 100%
    ) !important;
  }

  /* Ocultar póster duplicado y elementos de PC en el hero móvil */
  .detail-poster-wrap,
  .detail-poster-img {
    display: none !important;
  }
  .detail-eyebrow,
  .detail-type-line {
    display: none !important;
  }
  .detail-title-logo {
    max-height: 64px;
    max-width: min(260px, 85%);
    margin: 0 auto 10px;
    display: block;
  }
  .detail-title.detail-title-text {
    font-size: 1.6rem;
    text-align: center;
    margin: 0 0 10px;
  }

  .detail-hero-inner {
    padding: 24px 20px 20px !important;
    max-width: 100%;
    width: 100%;
    gap: 10px;
    text-align: center;
  }
  .detail-header-info {
    text-align: center;
    text-shadow: 0 2px 16px rgba(0,0,0,0.8);
  }
  .detail-meta {
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 14px;
  }
  .detail-genres {
    justify-content: center !important;
    margin-bottom: 12px;
  }
  .detail-genres .genre-tag {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
  }
  /* Sinopsis: máximo 2 líneas + Ver más */
  .detail-hero .detail-overview-wrap {
    display: block !important;
    text-align: center;
    max-width: 100%;
    margin: 0 auto 4px;
  }
  .detail-hero .detail-overview.detail-overview-clamp,
  .detail-hero .detail-overview-clamp {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.88);
    max-width: 100%;
    margin: 0 auto 6px;
    max-height: calc(1.45em * 2);
  }
  .detail-hero .detail-overview.is-expanded,
  .detail-hero .detail-overview-clamp.is-expanded {
    display: block !important;
    -webkit-line-clamp: unset !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .ver-mas-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0 auto 12px;
    padding: 4px 8px;
    cursor: pointer;
  }
  .detail-section-inline {
    display: none !important;
  }

  .detail-actions {
    justify-content: center !important;
    width: 100%;
    margin: 0;
  }
  .btn-play {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    height: 52px;
    border-radius: 999px !important;
    background: #fff !important;
    color: #111 !important;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    border: none;
  }
  .btn-play:hover,
  .btn-play:active {
    background: #f0f0f0 !important;
    color: #111 !important;
    transform: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  }

  .detail-main {
    padding: 8px 16px 48px !important;
  }
}


/* ===== Biblioteca por género ===== */
.library-by-genre {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 24px;
}
.library-genre-block {
  width: 100%;
}
.library-genre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 2px;
}
.library-genre-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.library-genre-title::before {
  content: '';
  width: 3px;
  height: 1em;
  background: #e50914;
  border-radius: 2px;
  flex-shrink: 0;
}
.library-genre-count {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}
.library-genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px 10px;
}
@media (max-width: 768px) {
  body[data-page="biblioteca"] .library-genre-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 10px;
  }
  .library-genre-title {
    font-size: 0.98rem;
  }
  .library-by-genre {
    gap: 26px;
  }
}

/* section header mobile align */
@media (max-width: 768px) {
  .section-header {
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
  }
  .section-title,
  .section-title-bar {
    font-size: 1.05rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .section-header .btn-see-all {
    flex-shrink: 0;
    padding: 7px 14px;
    font-size: 0.8rem;
  }
}
