/* ==========================================================================
   RESET + BASE
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background-color: #ffffff;
  color: #000000;
  display: flex;
  flex-direction: column;
  font-family: 'Arial', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ★ MODAL: visibilidad por aria + bloqueo scroll */
html.modal-open, body.modal-open { 
  overflow: hidden; 
  touch-action: none; 
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL + TÍTULOS
   ========================================================================== */
.container {
  flex: 1;
  margin: auto;
  margin-top: 100px; /* separa del header en páginas que usen .container */
  max-width: 1200px;
  padding: 20px;
}
h1 { color: #000000; font-size: 32px; margin-bottom: 20px; text-align: center; }

/* ==========================================================================
   HEADER + NAVEGACIÓN
   ========================================================================== */
header {
  background-color: #8c52ff;
  left: 0;
  padding: 15px 20px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
nav { align-items: center; display: flex; justify-content: space-between; }
.logo { align-items: center; display: flex; gap: 10px; }
.logo img { height: 60px; transform-style: preserve-3d; transition: transform 0.6s ease; }
.logo img:hover { transform: rotateY(360deg); }

.menu { align-items: center; display: flex; gap: 30px; }
.nav-links { display: flex; gap: 20px; list-style: none; position: relative; }
.nav-links li { position: relative; list-style: none; }
.nav-links li a {
  border-radius: 5px; color: #fff; display: block; font-weight: bold;
  padding: 8px 15px; text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.nav-links li a:hover { background-color: #fff; color: #8c52ff; }

.menu-logo, .submenu-logo {
  border-radius: 5px; height: 40px; margin: 5px;
  transition: transform 0.3s ease, box-shadow 0.3s ease; width: auto;
}
.submenu-logo { height: 30px; }
.menu-logo:hover, .submenu-logo:hover { box-shadow: 0 0 8px #8c52ff; transform: scale(1.05); }
.nav-links li a.logo-item:hover { background-color: transparent; }
.dropdown-menu img, .dropdown-submenu img { display: block; margin: 5px auto; }

/* Dropdowns */
.dropdown-menu, .dropdown-submenu {
  background-color: #ffffff; border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1); display: none;
  left: 0; list-style: none; padding: 5px 0; position: absolute; top: 100%; z-index: 10;
}
.dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu li:hover > .dropdown-submenu { display: block; left: 100%; top: 0; }
.dropdown-menu li, .dropdown-submenu li { padding: 5px 20px; }
.dropdown-menu li a { color: #333; display: block; padding: 8px; text-decoration: none; }
.dropdown-menu li a:hover { background-color: #8c52ff; color: #ffffff; }

/* ==========================================================================
   BUSCADOR
   ========================================================================== */
.search-bar { align-items: center; display: flex; justify-content: flex-start; position: relative; width: 200px; }
.search-bar input {
  border: 2px solid #ccc; border-radius: 5px; height: 40px;
  outline: none; padding: 8px; text-align: left; width: 100%;
}
.search-bar input:focus { border-color: #8c52ff; }
.suggestions {
  background-color: #ffffff; border: 1px solid #ccc; border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2); display: none; left: 0; max-height: 120px;
  overflow-y: auto; position: absolute; top: 100%; width: 100%; z-index: 1000;
}
.suggestion-item { color: #333; cursor: pointer; padding: 4px 8px; transition: background-color 0.2s ease; }
.suggestion-item:hover { background-color: #8c52ff; color: #fff; }

/* ==========================================================================
   SELECTOR DE IDIOMA
   ========================================================================== */
.language-selector { display: inline-block; position: relative; }
#lang-btn {
  background: none; border: none; color: #fff; cursor: pointer; font-size: 14px; font-weight: bold;
  padding: 5px; transition: color 0.2s ease;
}
#lang-btn:hover { color: #8c52ff; }
.lang-menu {
  background: #ffffff; border-radius: 5px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: none; padding: 5px; position: absolute; right: 50%; transform: translateX(50%);
}
.lang-menu li { list-style: none; padding: 5px; }
.lang-menu li a {
  color: #333; display: block; font-size: 14px; font-weight: bold; padding: 5px;
  text-decoration: none; transition: color 0.2s ease;
}
.lang-menu li a:hover { color: #8c52ff; }
.language-selector:hover .lang-menu { display: block; }

/* ==========================================================================
   CARDS / RANKING (no usadas aquí, pero mantenidas)
   ========================================================================== */
.ranking-list { align-items: center; display: none; flex-direction: column; gap: 20px; width: 100%; }
.ranking-list.active { display: flex; }
.card {
  cursor: pointer; opacity: 0; position: relative; transform: translateX(0);
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}
.card::before {
  background-color: #8c52ff; border-radius: 50%; color: #ffffff; content: attr(data-rank);
  font-size: 20px; font-weight: bold; left: -10px; padding: 5px 10px; position: absolute; top: -10px; z-index: 2;
}
.card[data-rank="1º"]::before { background-color: gold; color: #000000; }
.card[data-rank="2º"]::before { background-color: silver; color: #000000; }
.card[data-rank="3º"]::before { background-color: #cd7f32; color: #ffffff; }
.card-front {
  background-color: #ffffff; border: 2px solid #8c52ff; border-radius: 19px;
  box-shadow: 0 0 15px 5px rgba(140,82,255,0.7); overflow: hidden; position: relative; transition: transform 0.5s ease;
}
.card-front img { border-top-left-radius: 15px; border-top-right-radius: 15px; display: block; height: auto; object-fit: cover; width: 100%; }
.card-content { background-color: #ffffff; padding: 15px; text-align: center; }
.card-content h2 { color: #333; font-size: 20px; margin: 0; }

/* ==========================================================================
   BOTONES (Review + Tráiler)
   ========================================================================== */
.cta-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; align-items: center; }
.btn {
  --btn-bgc: #8c52ff; --btn-bgc-hover: #6f34ff; --btn-text: #ffffff; --btn-border: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; border: 1px solid var(--btn-border);
  background: var(--btn-bgc); color: var(--btn-text); font-weight: 700; letter-spacing: .3px; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  box-shadow: 0 6px 16px rgba(140,82,255,.25);
}
.btn:hover { background: var(--btn-bgc-hover); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(140,82,255,.35); }
.btn:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(140,82,255,.25); }

/* Ver Reseña */
.btn-review {
  --btn-bgc: #ffffff; --btn-bgc-hover: #f5f2ff; --btn-text: #8c52ff; --btn-border: #8c52ff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.btn-review.disabled, .btn[aria-disabled='true'] {
  cursor: not-allowed; pointer-events: none; --btn-bgc: #f0eef9; --btn-text: #9e8be6; --btn-border: #d8d2f6; opacity: .8; filter: grayscale(.2);
}

/* Ver Tráiler (desktop) */
.btn-trailer { --btn-bgc: #8c52ff; --btn-bgc-hover: #6f34ff; --btn-text: #ffffff; }

/* Ver Tráiler (mobile: se muestra solo en móvil; abre modal) */
.btn-trailer-mobile {
  --btn-bgc: #8c52ff; --btn-bgc-hover: #6f34ff; --btn-text: #ffffff;
  display: none; /* por defecto oculto, se muestra en mobile */
}

/* ==========================================================================
   MODAL DE VÍDEO (para móvil, via :target)
   ========================================================================== */
.video-modal {
  align-items: center; background: rgba(0,0,0,0.8); bottom: 0; display: none !important; justify-content: center;
  left: 0; position: fixed; right: 0; top: 0; z-index: 9999; /* ↑ z-index alto por encima de todo */
}
.video-modal:target { display: flex !important; }

/* ★ MODAL: visibilidad por aria además de :target */
.video-modal[aria-hidden="false"] { 
  display: flex !important; 
}

.video-modal-content {
  background: #000; border-radius: 12px; max-width: 860px; width: 92%;
  padding: 12px 12px 16px; position: relative;
}
.video-modal-close {
  color: #ffffff; cursor: pointer; font-size: 30px; position: absolute; right: 12px; top: 4px; text-decoration: none;
}
.video-modal-embed {
  width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.video-modal-embed iframe {
  width: 100%; height: 100%; display: block; border: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  background-color: #8c52ff;
  box-shadow: 0 -5px 10px rgba(0,0,0,0.2);
  color: #ffffff;
  font-family: 'Arial', sans-serif;
  padding: 40px 20px;
  text-align: center;
}
footer a { color: #f4f4f9; text-decoration: dotted; }
.footer-content { align-items: center; display: flex; flex-direction: column; }
.footer-logo img { height: 60px; margin-bottom: 15px; opacity: .9; }
.footer-socials { display: flex; gap: 15px; justify-content: center; margin-bottom: 25px; }
.footer-socials img { transition: transform .1s ease, opacity .3s ease; width: 30px; }
.footer-socials a:hover img { opacity: .7; transform: scale(1.2); }
.footer-bottom { font-size: 14px; opacity: .8; }

/* ==========================================================================
   UTILIDADES
   ========================================================================== */
.oculto { height: 1px; left: -9999px; overflow: hidden; position: absolute; width: 1px; }

/* ==========================================================================
   CAROUSEL / SLIDER (DESKTOP: se mantiene el efecto)
   ========================================================================== */
.carousel {
  margin-top: 0; height: 800px; overflow: hidden; position: relative;

  /* Ítem 1: activo/centrado */
  --item1-transform: translateX(0) scale(1);
  --item1-filter: blur(0);
  --item1-opacity: 1;
  --item1-zIndex: 10;

  /* Ítem 2: un poco más desenfocado y apagado */
  --item2-transform: translateX(35%) scale(.92);
  --item2-filter: blur(18px) brightness(0.55) saturate(0.3) contrast(0.6);
  --item2-opacity: 0.75;
  --item2-zIndex: 7;

  /* Ítem 3: más lejos, más difuso */
  --item3-transform: translateX(70%) scale(.86);
  --item3-filter: blur(28px) brightness(0.45) saturate(0.25) contrast(0.55);
  --item3-opacity: 0.55;
  --item3-zIndex: 5;

  /* Los demás (casi invisibles) */
  --item4-transform: translateX(105%) scale(.8);
  --item4-filter: blur(45px) brightness(0.35) saturate(0.15) contrast(0.45);
  --item4-opacity: 0.25;
  --item4-zIndex: 4;

  --item5-transform: translateX(140%) scale(.76);
  --item5-filter: blur(60px) brightness(0.25) saturate(0.1) contrast(0.35);
  --item5-opacity: 0.15;
  --item5-zIndex: 3;
}


/* Botón volver (desktop: abajo centrado en showDetail) */
#back {
  position: absolute; z-index: 100; left: 50%; transform: translateX(-50%);
  bottom: 0; background: transparent; border: none; border-bottom: 1px solid #555;
  font-family: Poppins, Arial, sans-serif; font-weight: bold; letter-spacing: 3px;
  padding: 10px; transition: opacity .5s, filter .2s, background .2s, color .2s;
  cursor: pointer; opacity: 0; color: #111;
}
.carousel.showDetail #back { opacity: 1; }
#back:hover { filter: brightness(1.2); }

.carousel .list {
  height: 80%; left: 50%; max-width: 90%; position: absolute; transform: translateX(-50%); width: 1140px;
}
.carousel .list .item {
  font-size: 15px; height: 100%; left: 0%; position: absolute; transition: left .5s, opacity .5s, width .5s;
  width: 70%; will-change: transform, filter, opacity;
}
.carousel .list .item:nth-child(n + 6) { opacity: 0; }

/* Ahora el activo es el :nth-child(1) */
.carousel .list .item:nth-child(1) {
  transform: var(--item1-transform); filter: var(--item1-filter); z-index: var(--item1-zIndex); opacity: var(--item1-opacity);
}
.carousel .list .item img {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  transition: right 1.5s; width: 50%; border-radius: 12px;
}

/* Intro + animaciones rápidas */
.carousel .list .item .introduce { opacity: 0; pointer-events: none; }
.carousel .list .item:nth-child(1) .introduce {
  opacity: 1; pointer-events: auto; position: absolute; top: 50%;
  transform: translateY(-50%); transition: opacity .2s; width: 400px;
}
.carousel .list .item .introduce .title { font-size: 2em; font-weight: 500; line-height: 1em; }
.carousel .list .item .introduce .des { color: #5559; font-size: small; }
.carousel .list .item:nth-child(1) .introduce .title,
.carousel .list .item:nth-child(1) .introduce .des,
.carousel .list .item:nth-child(1) .introduce .cta-group {
  opacity: 0; animation: showContent .35s .18s ease-out 1 forwards;
}
.carousel .list .item:nth-child(1) .introduce .des { animation-delay: .26s; }
.carousel .list .item:nth-child(1) .introduce .cta-group { animation-delay: .34s; }
@keyframes showContent { from { transform: translateY(-14px); filter: blur(6px); } to { transform: translateY(0); filter: blur(0); opacity: 1; } }

/* estados por posición (el resto a la derecha) */
.carousel .list .item:nth-child(2) { filter: var(--item2-filter); transform: var(--item2-transform); z-index: var(--item2-zIndex); opacity: var(--item2-opacity); }
.carousel .list .item:nth-child(3) { filter: var(--item3-filter); transform: var(--item3-transform); z-index: var(--item3-zIndex); }
.carousel .list .item:nth-child(4) { filter: var(--item4-filter); transform: var(--item4-transform); z-index: var(--item4-zIndex); }
.carousel .list .item:nth-child(5) { filter: var(--item5-filter); opacity: var(--item5-opacity); pointer-events: none; transform: var(--item5-transform); }

/* transiciones next/prev (se mantienen los índices porque el JS rota el DOM) */
.carousel.next .item:nth-child(1) { animation: transformFromPosition2 .5s ease-in-out 1 forwards; }
.carousel.next .item:nth-child(2) { animation: transformFromPosition3 .7s ease-in-out 1 forwards; }
.carousel.next .item:nth-child(3) { animation: transformFromPosition4 .9s ease-in-out 1 forwards; }
.carousel.next .item:nth-child(4) { animation: transformFromPosition5 1.1s ease-in-out 1 forwards; }
@keyframes transformFromPosition2 { from { transform: var(--item2-transform); filter: var(--item2-filter); opacity: var(--item2-opacity); } }
@keyframes transformFromPosition3 { from { transform: var(--item3-transform); filter: var(--item3-filter); opacity: var(--item3-opacity); } }
@keyframes transformFromPosition4 { from { transform: var(--item4-transform); filter: var(--item4-filter); opacity: var(--item4-opacity); } }
@keyframes transformFromPosition5 { from { transform: var(--item5-transform); filter: var(--item5-filter); opacity: var(--item5-opacity); } }
.carousel.prev .list .item:nth-child(5) { animation: transformFromPosition4 .5s ease-in-out 1 forwards; }
.carousel.prev .list .item:nth-child(4) { animation: transformFromPosition3 .7s ease-in-out 1 forwards; }
.carousel.prev .list .item:nth-child(3) { animation: transformFromPosition2 .9s ease-in-out 1 forwards; }
.carousel.prev .list .item:nth-child(2) { animation: transformFromPosition1 1.1s ease-in-out 1 forwards; }
@keyframes transformFromPosition1 { from { transform: var(--item1-transform); filter: var(--item1-filter); opacity: var(--item1-opacity); } }

/* ======= DETALLE (desktop) — ahora aplicado al :nth-child(1) ======= */
.carousel .list .item .detail { opacity: 0; pointer-events: none; }
.carousel.showDetail .list .item:nth-child(3),
.carousel.showDetail .list .item:nth-child(4) { left: 100%; opacity: 0; pointer-events: none; }
.carousel.showDetail .list .item:nth-child(1) { width: 100%; }
.carousel.showDetail .list .item:nth-child(1) .introduce { opacity: 0; pointer-events: none; }
.carousel.showDetail .list .item:nth-child(1) img { right: 50%; }

.carousel.showDetail .list .item:nth-child(1) .detail {
  opacity: 1; pointer-events: auto; position: absolute; right: 0; text-align: right;
  top: 50%; transform: translateY(-50%); width: 50%; padding-left: 32px;
}

/* Vídeo en detalle desktop */
.trailer-embed .video-wrap {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.trailer-embed .video-wrap iframe { width: 100%; height: 100%; display: block; border: 0; border-radius: 12px; }
.carousel.showDetail .list .item:nth-child(1) .detail .video-wrap { animation: showContent .35s .18s ease-out 1 forwards; opacity: 0; }

/* Flechas (desktop) */
.arrows {
  display: flex; justify-content: space-between; left: 50%; max-width: 90%;
  position: absolute; transform: translateX(-50%); width: 1140px; bottom: 10px;
}
#prev, #next {
  border: 1px solid #5555; border-radius: 50%; bottom: 20%;
  font-family: monospace; font-size: large; height: 40px; left: 10%; width: 40px;
}
#next { left: unset; right: 10%; }

#prev, #next { background: #fff; }

/* Glow de fondo */
.carousel::before {
  background-image: linear-gradient(70deg, #8c52ff, #6f34ff);

  content: ''; filter: blur(150px); height: 300px; left: 50%; position: absolute; top: 50%;
  transform: translate(-10%, -50%); transition: 1s; width: 500px; z-index: -1;
}
.carousel.showDetail::before { filter: blur(130px); transform: translate(-100%, -50%) rotate(90deg); }

/* ==========================================================================
   MEDIA QUERIES - Desktop aire extra
   ========================================================================== */
@media (min-width: 1200px) { main { padding-top: 80px; } .carousel { margin-top: 40px; } }
@media (min-width: 1024px) and (max-width: 1199.98px) { main { padding-top: 26px; } .carousel { margin-top: 30px; } }

/* ==========================================================================
   MEDIA QUERIES - Tablet
   ========================================================================== */
@media (max-width: 1023px) {
  .card { margin: 20px auto; position: relative; transform: none !important; width: 90%; }
  .card-details { left: 0; margin-top: 10px; max-height: none; opacity: 1; overflow: visible; position: relative; transition: none; width: 100%; }
  .card.show { opacity: 1; transform: none; }
  .cta-group .btn { padding: 10px 16px; }
}
@media (max-width: 991px) {
  .carousel .list .item { width: 90%; }
  .carousel.showDetail .list .item:nth-child(1) .detail { width: 55%; }
}

/* ==========================================================================
   MEDIA QUERIES - Mobile
   ========================================================================== */
@media (max-width: 767.98px) {

  /* Menú */
  .menu {
    align-items: flex-start; background-color: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none; flex-direction: column; left: 0; padding: 20px; position: absolute; top: 70px; width: 100%;
  }
  .menu.active { display: flex; }
  .hamburger { cursor: pointer; display: flex; flex-direction: column; gap: 5px; }
  .hamburger .bar { background-color: #fff; height: 4px; width: 25px; }
  .nav-links { flex-direction: column; gap: 10px; width: 100%; }
  .nav-links li a {
    align-items: center; background-color: #ffffff; border-radius: 5px; color: #000000; display: flex;
    gap: 10px; padding: 10px; text-align: left; width: 100%;
  }
  .dropdown-menu, .dropdown-submenu { background-color: #f9f9f9; margin-left: 20px; padding: 0; position: static; }
  .dropdown-submenu { background-color: #d0d0d0; margin-left: 30px; }
  #lang-btn { color: #000; }

  /* CTAs: esconder botón desktop (.seeMore) y mostrar el móvil (modal) */
  .btn-trailer { display: none; }               /* oculta el botón que dispara el efecto */
  .btn-trailer-mobile { display: inline-flex; } /* muestra el botón que abre el modal */

  /* Vista normal del carrusel en mobile (sin cambios de concepto) */
  .carousel { height: 600px; }
  .carousel .list { height: 100%; }
  .carousel .list .item { font-size: 10px; width: 100%; }
  .carousel .list .item:nth-child(1) .introduce { width: 60%; top: 50%; transform: translateY(-50%); max-height: 80%; padding-right: 8px; }
  .carousel .list .item img { width: 40%; }

  /* En mobile no queremos “showDetail” (pero si se activase, que no rompa) */
  .carousel.showDetail {
    height: auto; padding: 0; margin: 0;
  }
  .carousel.showDetail .list {
    position: static; left: auto; transform: none; width: 100%; max-width: 100%; height: auto; padding: 0; margin: 0;
  }
  .carousel.showDetail .list .item { position: relative; width: 100%; height: auto; left: auto; }
  .carousel.showDetail .list .item:nth-child(1) img {
    position: relative; right: auto; top: auto; transform: none; width: 100%;
    margin: 0; border-radius: 12px; display: block;
  }
  .carousel.showDetail .list .item:nth-child(1) .introduce .cta-group { display: none; }
  .carousel.showDetail .list .item:nth-child(1) .detail {
    width: 100%; position: relative; right: auto; top: auto; transform: none; text-align: left; margin: 0; padding: 0;
  }

  /* Ocultar flechas en “detalle” por si acaso */
  .carousel.showDetail #prev, .carousel.showDetail #next { display: none !important; }

  /* Modal: pequeños ajustes de padding en mobile */
  .video-modal-content { width: 96%; padding: 10px 10px 14px; border-radius: 10px; }
  .video-modal-close { right: 8px; top: 2px; }
}


/* ===========================
   TITULAR + DESCRIPCIÓN (todas las vistas)
   =========================== */

/* Estructura en columna: Título fijo > Des (crece/scroll si hace falta) > CTAs */
.carousel .list .item .introduce {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Evitar superposiciones por títulos largos */
.carousel .list .item .introduce .title {
  overflow-wrap: anywhere;      /* permite romper palabras muy largas */
  word-break: break-word;       /* fallback */
  line-height: 1.15;
}

/* La descripción ocupa el espacio disponible; si falta, hace scroll vertical */
.carousel .list .item .introduce .des {
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  /* crecer primero; si no hay más alto, hace scroll */
  flex: 1 1 auto;
  overflow-y: auto;             /* solo aparece cuando realmente hace falta */
  max-height: none;
}

/* Los botones no se pisan: quedan debajo de la descripción */
.carousel .list .item .introduce .cta-group {
  flex: 0 0 auto;
  margin-top: 8px;
}

/* ===========================
   Desktop: introduce a la izquierda, sin centrado vertical
   (evita que se monte con la imagen y permite crecer hacia abajo)
   =========================== */
@media (min-width: 1024px) {
  .carousel .list .item:nth-child(1) .introduce {
    position: absolute;
    left: 0;
    top: 8%;                     /* en vez de centrar vertical, anclamos arriba */
    transform: none;
    width: min(48%, 520px);      /* nunca invade el 50% de la imagen */
    max-height: 84%;             /* deja aire abajo para flechas/back */
    padding-right: 16px;         /* respiro con la imagen */
  }
}

/* ===========================
   Tablet: mismas reglas con un poco más de ancho
   =========================== */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .carousel .list .item:nth-child(1) .introduce {
    position: absolute;
    left: 0;
    top: 6%;
    transform: none;
    width: min(58%, 560px);
    max-height: 88%;
    padding-right: 14px;
  }
}

/* ===========================
   Mobile (vista normal, NO detalle)
   - Se mantiene el layout actual, pero con el flujo correcto
   =========================== */
@media (max-width: 767.98px) {
  .carousel .list .item .introduce .des { overflow-y: auto; }
}

/* ===========================
   Extras de cortesía (opcional)
   - Transiciones suaves y accesibilidad del scroll
   =========================== */
.carousel .list .item .introduce .des {
  scrollbar-gutter: stable;        /* evita jump cuando aparece la barra (navegadores compatibles) */
}


/* BLUR + FADE ULTRA AGRESIVO PARA ÍTEMS NO ACTIVOS */
.carousel {
  /* Mantener un poco de escala reducida para que no interfieran */
  --item3-transform: translateX(35%) scale(.88);
  --item4-transform: translateX(70%) scale(.82);
  --item5-transform: translateX(105%) scale(.76);

  /* Blur extremo + casi sin brillo ni color */
  --item3-filter: blur(55px) brightness(.5) saturate(.3) contrast(.6);
  --item4-filter: blur(65px) brightness(.4) saturate(.2) contrast(.5);
  --item5-filter: blur(80px) brightness(.3) saturate(.1) contrast(.4);

  /* Opacidad mínima */
  --item3-opacity: .08;
  --item4-opacity: .04;
  --item5-opacity: .02;
}

@media (max-width: 767.98px) {
  .carousel {
    --item3-filter: blur(60px) brightness(.45) saturate(.25) contrast(.5);
    --item4-filter: blur(75px) brightness(.35) saturate(.15) contrast(.45);
    --item5-filter: blur(90px) brightness(.25) saturate(.05) contrast(.4);

    --item3-opacity: .06;
    --item4-opacity: .03;
    --item5-opacity: .015;
  }
}


/* ==========================================================================
   FIN
   ========================================================================== */

/* ===== MOBILE FINAL TWEAK: descripción delimitada y CTAs sin solaparse ===== */
@media (max-width: 767.98px) {

  .carousel { 
    height: 640px !important; 
  }

  .carousel .list .item img {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40% !important;
    height: auto !important;
    border-radius: 12px;
  }

  /* APLICA A TODOS LOS ITEMS, no solo al nth-child(1) */
  .carousel .list .item .introduce {
    --titleH: 40px;   /* altura aproximada del título + margen */
    --ctaH:   72px;   /* altura reservada para botones */

    position: absolute !important;
    left: 0 !important;
    right: 40% !important;                            /* 60% texto */
    top: clamp(88px, 13.5vh, 112px) !important;       /* despega del header fijo */
    bottom: 96px !important;                          /* aire inferior general */
    transform: none !important;
    padding: 0 10px var(--ctaH, 72px) !important;     /* reserva hueco para CTAs */
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Título sticky en todos */
  .carousel .list .item .introduce .title {
    position: sticky !important;
    top: 15px !important;
    z-index: 1 !important;
    background: transparent !important;
    margin-bottom: 8px !important;
  }

  /* Descripción con scroll y delimitada */
  .carousel .list .item .introduce .des {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-right: 4px !important;

    max-height: calc(100% - var(--titleH, 40px) - var(--ctaH, 72px)) !important;
    box-sizing: border-box !important;
  }

  /* CTAs fijos abajo en todos */
  .carousel .list .item .introduce .cta-group {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    padding: 8px 0 !important;
    background: transparent !important;
    text-align: left !important;
    min-height: var(--ctaH, 72px) !important;
    display: flex !important;
    gap: 12px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
  }
}



/* =======================
   PARCHE iOS — rendimiento
   Solo se aplica si <html> tiene .is-ios (iPhone/iPad)
   ======================= */

html.is-ios .carousel::before {
  /* el glow con blur gigante gasta mucha GPU en iOS */
  display: none !important;
}

@media (max-width: 1023.98px) {
  /* en iOS móvil/tablet: mostrar menos ítems simultáneos */
  html.is-ios .carousel .list .item:nth-child(n+4) {
    display: none !important;
  }

  /* desactiva filtros pesados y usa opacidades/escala suaves */
  html.is-ios .carousel {
    --item1-filter: none;
    --item2-filter: none;
    --item3-filter: none;
    --item4-filter: none;
    --item5-filter: none;

    --item2-transform: translateX(12%) scale(.96);
    --item3-transform: translateX(24%) scale(.92);

    --item2-opacity: .7;
    --item3-opacity: .45;
    --item4-opacity: 0;
    --item5-opacity: 0;
  }

  /* sombras costosas fuera en iOS */
  html.is-ios .trailer-embed .video-wrap,
  html.is-ios .video-modal-embed {
    box-shadow: none !important;
  }
}

/* Evitar composiciones caras: no forzar will-change en filtros en iOS */
html.is-ios .carousel .list .item img {
  will-change: transform; /* ok */
}


/* ===========================================================
   SCROLL SHADOWS (CSS-only, sin JS)
   - Sugerencia de scroll que aparece SOLO cuando hay overflow
   - Desaparece automáticamente al llegar arriba/abajo
   - No tapa ni difumina las últimas líneas mientras lees
   =========================================================== */

@media (max-width: 1023.98px) {
  :root {
    --scroll-bg: #ffffff;          /* color de fondo del bloque de texto */
    --shadow-size: 44px;           /* altura del fade superior/inferior */
    --shadow-strength: .16;        /* intensidad (0.10–0.22 recomendable) */
  }

  .carousel .list .item .introduce .des {
    /* Aseguramos el contenedor desplazable */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    background-color: var(--scroll-bg);
    position: relative;
    padding-bottom: 10px;          /* respiro visual */
    scrollbar-gutter: stable;

    /* —— Scroll Shadows puros CSS —— 
       Dos gradientes pegados al contenido (attachment: local) 
       que simulan sombra/fade y se "retiran" al alcanzar el borde.
    */
    background:
      /* color de fondo real del contenido */
      linear-gradient(var(--scroll-bg), var(--scroll-bg)) padding-box,
      /* sombra/fade superior */
      linear-gradient(to bottom,
        rgba(0,0,0,var(--shadow-strength)),
        rgba(0,0,0,0)) top / 100% var(--shadow-size) no-repeat,
      /* sombra/fade inferior */
      linear-gradient(to top,
        rgba(0,0,0,var(--shadow-strength)),
        rgba(0,0,0,0)) bottom / 100% var(--shadow-size) no-repeat;
    /* El truco: que los fades sigan al contenido */
    background-attachment: local, local, local;
  }

  /* Scrollbar fina y discreta (solo pista visual) */
  .carousel .list .item .introduce .des {
    scrollbar-width: thin;                            /* Firefox */
    scrollbar-color: rgba(0,0,0,.30) transparent;
  }
  .carousel .list .item .introduce .des::-webkit-scrollbar { width: 6px; }
  .carousel .list .item .introduce .des::-webkit-scrollbar-track { background: transparent; }
  .carousel .list .item .introduce .des::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.30);
    border-radius: 4px;
  }
}

/* Afinado en móvil estrecho */
@media (max-width: 767.98px) {
  :root {
    --shadow-size: 52px;           /* un pelín más grande para iPhone pequeño */
    --shadow-strength: .18;
  }
}
