/* =========================================================
   VISTA PREVIA
   La ventana a pantalla completa donde se ve la carta con los
   cambios sin publicar. Reutiliza las variables de color del
   editor cuando existen, con un valor de reserva por si acaso.
   ========================================================= */

/* Mientras la vista previa está abierta, el editor de detrás no
   debe poder desplazarse. */
html.vp-abierta, html.vp-abierta body { overflow: hidden; }

.vp {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--fondo, #0b1220);
}
.vp[hidden] { display: none; }

/* ---------- Barra superior de la ventana ---------- */
.vp__barra {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(14px, 4vw, 24px);
  background: var(--grad-barra, #0F2E52);
  color: var(--barra-texto, #fff);
  border-bottom: 1px solid var(--barra-velo-mas, rgba(255, 255, 255, .16));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
  /* Respeta la muesca de los móviles con notch. */
  padding-top: max(12px, env(safe-area-inset-top));
}

.vp__marca { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; }
.vp__punto {
  width: 10px; height: 10px; flex: none; border-radius: 50%;
  background: var(--ambar, #E9B44C);
  box-shadow: 0 0 0 4px rgba(233, 180, 76, .22);
}
.vp__rotulos { display: flex; flex-direction: column; min-width: 0; }
.vp__titulo {
  font-family: var(--display, system-ui, sans-serif);
  font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em;
  line-height: 1.1; white-space: nowrap;
}
.vp__sub {
  font-family: var(--texto, system-ui, sans-serif);
  font-size: .58rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; opacity: .8; margin-top: 2px; white-space: nowrap;
}

.vp__cerrar {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--barra-borde-mas, rgba(255, 255, 255, .28));
  background: var(--barra-velo, rgba(255, 255, 255, .1));
  color: inherit;
  font-family: var(--texto, system-ui, sans-serif);
  font-size: .82rem; font-weight: 700;
  transition: background .18s ease, transform .12s ease;
}
.vp__cerrar:hover { background: var(--barra-velo-mas, rgba(255, 255, 255, .2)); }
.vp__cerrar:active { transform: scale(.97); }
.vp__cerrar svg { width: 16px; height: 16px; }

/* ---------- El marco donde se pinta la carta ---------- */
.vp__lienzo {
  flex: 1;
  min-height: 0;
  background: #fff;
}
.vp__marco {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* En pantallas pequeñas el texto "Cerrar" ocupa de más: dejamos el aspa. */
@media (max-width: 420px) {
  .vp__cerrar span { display: none; }
  .vp__cerrar { padding: 9px; }
}