/* Página del vídeo explicativo (video.html). Usa el esqueleto y los estilos de toda la web (navbar, hero de
   subpágina como ejemplos.html, .btn, .section-tag, .gradient-text); aquí solo lo propio: reproductor y opciones. */

.video-seccion { padding: 3rem 0 4.5rem; }

/* Reproductor */
.v-reproductor { max-width: 980px; margin: 0 auto; }
.v-marco {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #0b1020;
  aspect-ratio: 16 / 9;
  box-shadow: 0 24px 60px rgba(30, 58, 138, 0.18), 0 0 0 1px var(--cyan-border);
}
.v-marco video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0b1020;
}
.v-play {
  position: absolute;
  /* Solo el icono, redondo y en el centro (como YouTube). La miniatura deja ese centro libre a propósito
     (si cambia la miniatura, comprobar que no tapa nada). Centrado con inset + margin auto: sin transform,
     que lo usa el hover. */
  inset: 0;
  margin: auto;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0 0 0 6px; /* el triángulo pesa a la izquierda: se compensa para que parezca centrado */
  border: 0;
  border-radius: 50%;
  background: var(--gradient-cyan);
  color: #fff;
  font-family: var(--font);
  font-size: var(--text-lg);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.5);
  transition: transform var(--transition), box-shadow var(--transition);
  animation: v-latido 2.4s ease-in-out infinite;
}
.v-play svg { width: 40px; height: 40px; fill: #fff; }
.v-play span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* texto solo para lectores de pantalla */
.v-play:hover { transform: scale(1.05); }
.v-play:focus-visible { outline: 3px solid #93c5fd; outline-offset: 4px; }
.v-reproductor.reproduciendo .v-play { display: none; }

/* ---------- Reproductor propio (tipo YouTube) ---------- */
.v-marco:focus { outline: none; }
.v-marco video { cursor: pointer; }
.v-marco.iniciado:not(.controles-visibles) video { cursor: none; }
.v-controles {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 14px 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 55%, transparent 100%);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.v-marco.iniciado.controles-visibles .v-controles,
.v-marco.iniciado.pausado .v-controles,
.v-marco.iniciado.terminado .v-controles,
.v-marco.iniciado:focus-within .v-controles { opacity: 1; visibility: visible; }

/* Barra de progreso: azul de marca */
.v-barra {
  position: relative;
  height: 18px;
  margin: 0 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.v-barra:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; border-radius: 4px; }
.v-barra-pista {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  transition: height 0.12s ease;
}
.v-barra:hover .v-barra-pista, .v-marco.arrastrando .v-barra-pista { height: 6px; }
.v-barra-carga, .v-barra-progreso { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.v-barra-carga { background: rgba(255, 255, 255, 0.35); }
.v-barra-progreso { background: linear-gradient(90deg, #1d4ed8, #3b82f6); }
.v-barra-bola {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
  transform: scale(0);
  transition: transform 0.12s ease;
  pointer-events: none;
}
.v-barra:hover .v-barra-bola, .v-barra:focus-visible .v-barra-bola, .v-marco.arrastrando .v-barra-bola { transform: scale(1); }
.v-barra-globo {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.v-barra:hover .v-barra-globo, .v-marco.arrastrando .v-barra-globo { opacity: 1; }

/* Fila de botones */
.v-fila { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.v-hueco { flex: 1; }
.v-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}
.v-btn:hover { background: rgba(255, 255, 255, 0.14); }
.v-btn:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.v-btn svg { width: 24px; height: 24px; fill: currentColor; }
.v-btn svg text { fill: currentColor; }
.v-btn-texto { width: auto; min-width: 46px; padding: 0 8px; font-family: var(--font); font-size: 0.9rem; font-weight: 700; }
.v-tiempo { margin-left: 8px; font-size: 0.88rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0.95; }

/* Iconos según estado */
.v-btn .i-pausa, .v-btn .i-repetir, .v-btn .i-mudo, .v-btn .i-cerrar { display: none; }
.v-marco:not(.pausado):not(.terminado) .v-btn .i-play { display: none; }
.v-marco:not(.pausado):not(.terminado) .v-btn .i-pausa { display: block; }
.v-marco.terminado .v-btn .i-play { display: none; }
.v-marco.terminado .v-btn .i-repetir { display: block; }
.v-marco.mudo .v-btn .i-sonido { display: none; }
.v-marco.mudo .v-btn .i-mudo { display: block; }
.v-marco.pantalla .v-btn .i-abrir { display: none; }
.v-marco.pantalla .v-btn .i-cerrar { display: block; }

/* Volumen: el deslizador se despliega al pasar el ratón, como en YouTube */
.v-volumen { display: flex; align-items: center; }
.v-volumen-rango {
  --nivel: 100%;
  width: 0;
  opacity: 0;
  height: 4px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
  background: linear-gradient(90deg, #fff var(--nivel), rgba(255, 255, 255, 0.3) var(--nivel));
  cursor: pointer;
  transition: width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}
.v-volumen:hover .v-volumen-rango, .v-volumen-rango:focus-visible { width: 76px; opacity: 1; margin: 0 6px 0 2px; }
.v-volumen-rango::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }
.v-volumen-rango::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 0; }

/* Calidad (rueda + menú hacia arriba, como en YouTube) */
.v-calidad { position: relative; }
.v-calidad[hidden] { display: none; }
#v-btn-calidad { display: inline-flex; gap: 4px; padding: 0 8px; }
#v-btn-calidad svg { width: 21px; height: 21px; }
.v-calidad-etiqueta {
  font-size: 0.66rem; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 4px;
  background: #2563eb; color: #fff; letter-spacing: 0.02em;
}
.v-menu {
  position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 170px;
  margin: 0; padding: 6px; list-style: none; border-radius: 12px;
  background: rgba(15, 23, 42, 0.94); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 0.88rem; font-weight: 600;
}
.v-menu[hidden] { display: none; }
.v-menu li { position: relative; padding: 9px 12px 9px 30px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.v-menu li:hover, .v-menu li:focus-visible { background: rgba(255, 255, 255, 0.12); outline: none; }
.v-menu li[aria-checked="true"]::before {
  content: ''; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: #3b82f6;
}

/* Pantalla completa */
.v-marco.pantalla { border-radius: 0; box-shadow: none; background: #000; }
.v-marco.pantalla video { background: #000; }
.v-marco.pantalla .v-controles { padding: 60px 28px 18px; }

@keyframes v-latido {
  0%, 100% { box-shadow: 0 14px 40px rgba(37, 99, 235, 0.5), 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 14px 40px rgba(37, 99, 235, 0.5), 0 0 0 14px rgba(37, 99, 235, 0); }
}

/* Las dos opciones (mismo texto y orden que al final del vídeo).
   La 1 (llamada) es la protagonista; la 2 (probar) es secundaria y visual. Las dos tarjetas comparten
   las 7 filas con subgrid: etiqueta, título, intro, contenido, insignias, botón y nota quedan alineados. */
.v-opciones { margin-top: 4rem; text-align: center; scroll-margin-top: 90px; }
.v-opciones-cab h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin: 0.75rem 0 2rem; }
.v-botones {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: repeat(7, auto);
  column-gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
  align-items: center;
}
.v-opcion {
  display: grid;
  grid-row: span 7;
  grid-template-rows: subgrid;
  row-gap: 0;
  padding: 2rem;
  border-radius: var(--radius-xl, 20px);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.v-opcion--mapa {
  border: 2px solid var(--blue, #2563eb);
  box-shadow: 0 22px 56px rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg-card) 45%);
}
.v-opcion--probar {
  background: #fbfcfe;
  box-shadow: none;
}
.v-opcion-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  align-self: start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.v-opcion--mapa .v-opcion-num {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--blue, #2563eb);
  color: #fff;
}
.v-opcion-num svg { width: 13px; height: 13px; fill: currentColor; }
.v-opcion h3 { align-self: start; font-size: var(--text-xl); font-weight: 800; color: var(--text-main); margin: 0.75rem 0 0.4rem; }
.v-opcion--mapa h3 { font-size: 1.6rem; }
.v-opcion--probar h3 { color: var(--text-muted); }
.v-opcion-intro { align-self: start; margin: 0; font-size: var(--text-sm); line-height: 1.6; color: var(--text-muted); }

/* Contenido: pasos de la llamada */
.v-pasos { align-self: start; list-style: none; margin: 1.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.v-pasos li { display: flex; gap: 0.75rem; align-items: flex-start; font-size: var(--text-sm); line-height: 1.55; color: var(--text-muted); }
.v-pasos li strong { color: var(--text-main); font-weight: 700; }
.v-pasos svg {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 8px;
  border-radius: 10px;
  background: #e3edff;
  color: var(--blue, #2563eb);
}

/* Contenido: adelanto de la página de Ejemplos (mini ventana con un chat y las demos) */
.v-adelanto {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  margin-top: 1.25rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #efeae2; /* fondo de chat de WhatsApp, como en el vídeo */
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition);
}
.v-adelanto:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(17, 24, 39, 0.1); }
.v-adelanto-barra {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 10px; background: #fff; border-bottom: 1px solid var(--border);
  font-size: 0.68rem; color: var(--text-subtle);
}
.v-adelanto-barra i { width: 7px; height: 7px; border-radius: 50%; background: #d8dde6; }
.v-adelanto-barra span { margin-left: 6px; }
.v-adelanto-chat { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px; }
.v-burbuja {
  max-width: 82%;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #111b21;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
.v-burbuja--suya { align-self: flex-start; background: #fff; }
.v-burbuja--mia { align-self: flex-end; background: #d9fdd3; }
.v-adelanto-fichas { display: flex; gap: 6px; padding: 9px 10px; background: #fff; border-top: 1px solid var(--border); }
.v-adelanto-fichas span {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 4px; border-radius: 8px;
  background: #eff6ff; color: var(--blue, #2563eb);
  font-size: 0.72rem; font-weight: 700;
}
.v-adelanto-fichas svg { width: 13px; height: 13px; }

.v-insignias { align-self: end; justify-content: flex-start; margin: 1.25rem 0 0; }
.v-opcion--probar .v-insignias span { background: #f1f3f7; color: var(--text-muted); }
.v-opcion-btn { margin-top: 1.25rem; justify-content: center; width: 100%; }
.v-opcion-nota { margin: 0.7rem 0 0; font-size: 0.78rem; color: var(--text-subtle); text-align: center; }

/* Al terminar el vídeo, la opción principal late para llevar la vista */
.v-opciones.destacar .v-opcion--mapa .btn-primary { animation: v-latido 1.6s ease-in-out 3; }

.v-plazas {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 1.75rem 0 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}
.v-plazas svg { width: 16px; height: 16px; color: var(--cyan); }

@media (max-width: 860px) {
  .v-botones { grid-template-columns: 1fr; grid-template-rows: none; max-width: 560px; row-gap: 1.25rem; }
  .v-opcion { display: flex; flex-direction: column; grid-row: auto; }
  .v-adelanto { min-height: 190px; }
  .v-insignias { align-self: flex-start; }
}
@media (max-width: 420px) {
  .v-adelanto-fichas svg { display: none; }
}

@media (max-width: 768px) {
  .video-seccion { padding: 1.25rem 0 3rem; }
  /* el vídeo ocupa todo el ancho en móvil: con la imagen más grande se lee lo que pasa en pantalla */
  .v-reproductor { margin: 0 -8px; }
  .v-marco { border-radius: 12px; }
  /* abajo y centrado: en pantalla pequeña en medio tapaba la cara y el "8 horas" de la portada */
  .v-play { width: 42px; height: 42px; padding-left: 3px; }
  .v-play svg { width: 20px; height: 20px; }
  /* Móvil: controles algo más compactos; el volumen lo llevan los botones del teléfono */
  .v-controles { padding: 28px 6px 2px; }
  .v-btn { width: 38px; height: 38px; }
  .v-btn svg { width: 22px; height: 22px; }
  .v-volumen-rango { display: none; }
  .v-tiempo { margin-left: 4px; font-size: 0.78rem; }
  .v-btn-texto { min-width: 40px; font-size: 0.8rem; }
  .v-barra-bola { transform: scale(1); width: 12px; height: 12px; margin: -6px 0 0 -6px; }
  .v-opciones { margin-top: 2.75rem; }
  .v-opcion { padding: 1.5rem 1.25rem; }
  .v-pasos svg { width: 30px; height: 30px; padding: 7px; }
  .v-plazas { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .v-play, .v-opciones.destacar .btn-primary { animation: none; }
}
