/*
 * ORDEN 0073 (etapa 3) — estilos de los videos tipo reels (W14).
 * No toca ningún estilo que ya exista: todo va con prefijo hcy-w14 y se usa
 * sólo dentro del bloque. El color de acento sale de la variable de los widgets.
 */

.hcy-w14 {
  --hcy-reels-acento: var(--hcy-widget-acento, #6d4aff);
  margin: 28px 0;
}

.hcy-w14-titulo {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg-primary, #111);
  margin: 0 0 12px;
}

.hcy-w14-caja {
  position: relative;
}

/* La pista: carrusel horizontal con imán (scroll-snap) */
.hcy-w14-pista {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 12%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 4px 12%;
  cursor: grab;
}

.hcy-w14-pista::-webkit-scrollbar { display: none; }
.hcy-w14-pista:active { cursor: grabbing; }
.hcy-w14-pista:focus-visible { outline: 2px solid var(--hcy-reels-acento); outline-offset: 4px; }

/* Tarjeta vertical 9:16, esquinas redondeadas, la del centro completa */
.hcy-w14-tarjeta {
  flex: 0 0 auto;
  width: min(72vw, 240px);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  outline: none;
}

.hcy-w14-marco {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: #0b0b0d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}

.hcy-w14-tarjeta:focus-visible .hcy-w14-marco {
  outline: 2px solid var(--hcy-reels-acento);
  outline-offset: 2px;
}

.hcy-w14-tarjeta:hover .hcy-w14-marco { transform: translateY(-2px); }

.hcy-w14-video,
.hcy-w14-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0b0b0d;
}

/* Cuando el navegador viejo no soporta aspect-ratio, alto mínimo razonable */
@supports not (aspect-ratio: 9 / 16) {
  .hcy-w14-marco { height: 0; padding-bottom: 177.78%; }
  .hcy-w14-video, .hcy-w14-poster { position: absolute; inset: 0; }
}

/* Icono de sonido: en el carrusel siempre está silenciado */
.hcy-w14-sonido {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.hcy-w14-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 34px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hcy-w14-nombre {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 12px 10px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Flechas (escritorio) */
.hcy-w14-flecha {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.hcy-w14-flecha:hover { background: #fff; }
.hcy-w14-izq { left: 2px; }
.hcy-w14-der { right: 2px; }

@media (max-width: 640px) {
  .hcy-w14-flecha { display: none; }
}

/* Puntos de paginación */
.hcy-w14-puntos {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

.hcy-w14-punto {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.22);
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease;
}

.hcy-w14-punto.is-activo {
  width: 20px;
  background: var(--hcy-reels-acento);
}
.hcy-w14-punto:focus-visible { outline: 2px solid var(--hcy-reels-acento); outline-offset: 2px; }

/* ---------------------------------------------------------------- visor reels */

.hcy-w14-sin-scroll { overflow: hidden; }

.hcy-w14-visor {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: #000;
  display: flex;
  flex-direction: column;
}

.hcy-w14-visor-pista {
  flex: 1 1 auto;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hcy-w14-visor-pista::-webkit-scrollbar { display: none; }

.hcy-w14-visor-diapo {
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

.hcy-w14-visor-video,
.hcy-w14-visor-iframe {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  aspect-ratio: 9 / 16;
  border: 0;
  border-radius: 14px;
  background: #000;
  object-fit: contain;
}

.hcy-w14-visor-iframe { width: 100%; height: 100%; }

.hcy-w14-visor-cerrar {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.hcy-w14-visor-sonido {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* Botón fijo de agregar: es el que usa la MISMA función de la ficha */
.hcy-w14-visor-barra {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}

.hcy-w14-visor-comprar {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: var(--hcy-reels-acento);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.hcy-w14-visor-comprar:disabled { opacity: 0.55; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .hcy-w14-pista { scroll-behavior: auto; }
  .hcy-w14-tarjeta:hover .hcy-w14-marco { transform: none; }
}
