/* Reproductor del video de la landing (marca de Mafe: fucsia #E82A9F, rosa #F7B7DE, ciruela #2A0A1C).
   La barra de controles va DEBAJO del video, dentro del mismo marco, porque el video trae los subtítulos
   quemados abajo del cuadro y una barra encima los taparía. */
.vsl {
  --vsl-accent: #E82A9F;
  --vsl-accent-soft: #F7B7DE;
  --vsl-plum: #2A0A1C;
  --vsl-plum-2: #3A0E27;
  --vsl-text: #FCEFF6;
  position: relative;
  width: 100%;
  margin: 28px auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: var(--vsl-plum);
  border: 2px solid rgba(232, 42, 159, 0.85);
  box-shadow: 0 0 26px rgba(232, 42, 159, 0.38), 0 14px 44px rgba(0, 0, 0, 0.55);
  color: var(--vsl-text);
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.vsl:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 26px rgba(232, 42, 159, 0.55); }

.vsl-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
@supports not (aspect-ratio: 16 / 9) {
  .vsl-stage { height: 0; padding-bottom: 56.25%; }
}
.vsl-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Portada con el botón de play */
.vsl-cover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000;
  border: 0; padding: 0; margin: 0;
  cursor: pointer;
  z-index: 3;
  transition: opacity 0.35s ease, visibility 0.35s;
}
.vsl.is-started .vsl-cover { opacity: 0; visibility: hidden; pointer-events: none; }
.vsl-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}
.vsl-cover::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(42, 10, 28, 0) 35%, rgba(42, 10, 28, 0.55) 100%);
  pointer-events: none;
}
.vsl-cover:hover img { transform: scale(1.03); filter: brightness(0.85); }
.vsl-bigplay {
  position: relative; z-index: 2;
  width: 84px; height: 60px;
  border-radius: 14px;
  background: var(--vsl-accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 30px rgba(232, 42, 159, 0.55), 0 0 0 0 rgba(232, 42, 159, 0.5);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s;
  animation: vslPulse 2.6s ease-out infinite;
}
.vsl-bigplay svg { width: 30px; height: 30px; fill: #fff; margin-left: 3px; }
.vsl-cover:hover .vsl-bigplay, .vsl-cover:focus-visible .vsl-bigplay { transform: scale(1.1); background: #F13DAB; }
@keyframes vslPulse {
  0% { box-shadow: 0 8px 30px rgba(232, 42, 159, 0.55), 0 0 0 0 rgba(232, 42, 159, 0.5); }
  70% { box-shadow: 0 8px 30px rgba(232, 42, 159, 0.55), 0 0 0 18px rgba(232, 42, 159, 0); }
  100% { box-shadow: 0 8px 30px rgba(232, 42, 159, 0.55), 0 0 0 0 rgba(232, 42, 159, 0); }
}

/* Cargando */
.vsl-spinner {
  position: absolute; left: 50%; top: 50%;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--vsl-accent);
  animation: vslSpin 0.8s linear infinite;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2;
}
.vsl.is-loading.is-started .vsl-spinner { opacity: 1; visibility: visible; }
@keyframes vslSpin { to { transform: rotate(360deg); } }

/* Pausa / fin: botón grande sobre el video */
.vsl-state {
  position: absolute; left: 50%; top: 50%;
  width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(42, 10, 28, 0.72);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: scale(0.85);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 2;
}
.vsl-state svg { width: 30px; height: 30px; fill: #fff; }
.vsl.is-started.is-paused:not(.is-ended):not(.is-loading) .vsl-state { opacity: 1; visibility: visible; transform: scale(1); }
/* al terminar no se pone nada encima: el último cuadro del video trae el llamado a agendar. Repetir = ícono de la barra */

.vsl-error {
  position: absolute; inset: 0; z-index: 4;
  display: none; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; text-align: center;
  background: rgba(20, 5, 14, 0.92); padding: 20px;
  font-size: 15px; line-height: 1.4;
}
.vsl.has-error .vsl-error { display: flex; }
.vsl-error button {
  background: var(--vsl-accent); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 20px; font: inherit; font-weight: 600; cursor: pointer;
}

/* Barra de controles (debajo del video) */
.vsl-controls {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  height: 46px; padding: 0 8px 0 6px;
  background: linear-gradient(180deg, var(--vsl-plum-2), var(--vsl-plum));
  border-top: 1px solid rgba(232, 42, 159, 0.45);
  z-index: 5;
}
.vsl-btn {
  flex: none;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--vsl-text); cursor: pointer; padding: 0;
  transition: background 0.15s, color 0.15s;
}
.vsl-btn:hover { background: rgba(247, 183, 222, 0.16); }
.vsl-btn:focus-visible { outline: 2px solid var(--vsl-accent-soft); outline-offset: -2px; }
.vsl-btn svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.vsl-btn[hidden] { display: none; }

.vsl-time {
  flex: none;
  min-width: 38px;
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--vsl-text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.vsl-time .vsl-total { opacity: 0.6; font-weight: 500; }

/* Línea de tiempo con los capítulos como puntos */
.vsl-bar {
  position: relative; flex: 1 1 auto; min-width: 60px;
  height: 38px; display: flex; align-items: center;
  cursor: pointer; touch-action: none; outline: none;
}
.vsl-track {
  position: relative; width: 100%; height: 4px; border-radius: 3px;
  background: rgba(252, 239, 246, 0.22);
  transition: height 0.15s;
}
.vsl-bar:hover .vsl-track, .vsl-bar.is-drag .vsl-track, .vsl-bar:focus-visible .vsl-track { height: 6px; }
.vsl-buf, .vsl-played {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; width: 0;
}
.vsl-buf { background: rgba(252, 239, 246, 0.28); }
.vsl-played { background: linear-gradient(90deg, var(--vsl-accent), #FF6CC4); }
.vsl-dot {
  position: absolute; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--vsl-plum);
  border: 2px solid var(--vsl-accent-soft);
  box-sizing: border-box;
  pointer-events: none;
  transition: background 0.15s, transform 0.15s;
}
.vsl-dot.is-done { background: var(--vsl-accent); border-color: #fff; }
.vsl-bar:hover .vsl-dot { transform: scale(1.2); }
.vsl-thumb {
  position: absolute; top: 50%; left: 0;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 3px rgba(232, 42, 159, 0.55);
  transform: scale(0);
  transition: transform 0.15s;
  pointer-events: none;
}
.vsl-bar:hover .vsl-thumb, .vsl-bar.is-drag .vsl-thumb, .vsl-bar:focus-visible .vsl-thumb { transform: scale(1); }
.vsl-tip {
  position: absolute; bottom: 38px; left: 0;
  transform: translateX(-50%);
  max-width: 240px;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(20, 5, 14, 0.96);
  border: 1px solid rgba(232, 42, 159, 0.5);
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s;
}
.vsl-tip b { color: var(--vsl-accent-soft); font-weight: 700; margin-right: 6px; font-variant-numeric: tabular-nums; }
.vsl-bar.show-tip .vsl-tip { opacity: 1; visibility: visible; }

/* Volumen */
.vsl-vol { display: flex; align-items: center; flex: none; }
.vsl-vol input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 0; opacity: 0; height: 4px; margin: 0;
  border-radius: 3px; background: rgba(252, 239, 246, 0.3); cursor: pointer;
  transition: width 0.2s, opacity 0.2s, margin 0.2s;
}
.vsl-vol:hover input[type=range], .vsl-vol:focus-within input[type=range] { width: 64px; opacity: 1; margin: 0 8px 0 2px; }
.vsl-vol input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0;
}
.vsl-vol input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 0; }
@media (pointer: coarse) { .vsl-vol { display: none; } }

/* Menú (calidad y velocidad) */
.vsl-menu {
  position: absolute; right: 8px; bottom: 54px;
  min-width: 220px; max-width: calc(100% - 16px);
  max-height: calc(100% - 64px); overflow-y: auto;
  background: rgba(32, 8, 21, 0.97);
  border: 1px solid rgba(232, 42, 159, 0.55);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 8;
}
.vsl-menu[hidden] { display: none; }
.vsl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--vsl-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.vsl-item:hover, .vsl-item:focus-visible { background: rgba(247, 183, 222, 0.16); outline: none; }
.vsl-item small { color: var(--vsl-accent-soft); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.vsl-item .vsl-chev { opacity: 0.7; }
.vsl-item.is-on { color: #fff; font-weight: 700; }
.vsl-item .vsl-check { width: 18px; height: 18px; fill: var(--vsl-accent); flex: none; visibility: hidden; }
.vsl-item.is-on .vsl-check { visibility: visible; }
.vsl-menu-head {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px 8px; margin-bottom: 4px;
  border-bottom: 1px solid rgba(247, 183, 222, 0.2);
  font-size: 13px; font-weight: 700; color: var(--vsl-accent-soft);
}
.vsl-menu-head button {
  width: 30px; height: 30px; background: transparent; border: 0; border-radius: 8px;
  color: var(--vsl-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.vsl-menu-head button:hover { background: rgba(247, 183, 222, 0.16); }
.vsl-menu-head svg { width: 18px; height: 18px; fill: currentColor; }

/* Pantalla completa: la barra flota sobre el video y se esconde sola */
.vsl:fullscreen, .vsl:-webkit-full-screen {
  width: 100%; height: 100%; margin: 0; border-radius: 0; border: 0; box-shadow: none; background: #000;
}
.vsl.is-pseudo-fs {
  position: fixed; inset: 0; z-index: 2147483000; width: 100vw; height: 100vh; height: 100dvh; margin: 0;
  border-radius: 0; border: 0; box-shadow: none; background: #000;
}
.vsl:fullscreen .vsl-stage, .vsl:-webkit-full-screen .vsl-stage, .vsl.is-pseudo-fs .vsl-stage { flex: 1 1 auto; aspect-ratio: auto; height: auto; padding: 0; }
.vsl:fullscreen .vsl-controls, .vsl:-webkit-full-screen .vsl-controls, .vsl.is-pseudo-fs .vsl-controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(42, 10, 28, 0), rgba(20, 5, 14, 0.92));
  border-top: 0; height: 64px; padding-top: 14px;
  transition: opacity 0.25s;
}
.vsl.is-idle.is-playing:fullscreen, .vsl.is-idle.is-playing.is-pseudo-fs { cursor: none; }
.vsl.is-idle.is-playing:fullscreen .vsl-controls, .vsl.is-idle.is-playing.is-pseudo-fs .vsl-controls { opacity: 0; pointer-events: none; }
.vsl.is-idle.is-playing:-webkit-full-screen .vsl-controls { opacity: 0; pointer-events: none; }
.vsl:fullscreen .vsl-menu, .vsl:-webkit-full-screen .vsl-menu, .vsl.is-pseudo-fs .vsl-menu { bottom: 70px; }

@media (max-width: 520px) {
  .vsl { border-radius: 14px; }
  .vsl-controls { gap: 2px; padding: 0 4px 0 2px; height: 44px; }
  .vsl-btn { width: 36px; height: 36px; }
  .vsl-time .vsl-total { display: none; }
  .vsl-dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; border-width: 1.5px; }
  .vsl-bigplay { width: 70px; height: 50px; border-radius: 12px; }
  .vsl-bigplay svg { width: 26px; height: 26px; }
  .vsl-menu { min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .vsl *, .vsl *::before, .vsl *::after { animation: none !important; transition-duration: 0.001ms !important; }
}

/* antes de que cargue el JS: reserva el espacio para que la página no salte */
.vsl:empty { aspect-ratio: 16 / 9; }
