/**
 * @file
 * Estilos del popup de lanzamiento (contenedor/modal). El contenido del
 * formulario en sí (dentro del iframe) se estiliza aparte, desde la
 * página/tema del webform.
 */

.lanzamiento-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lanzamiento-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.lanzamiento-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.6);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  cursor: pointer;
}

.lanzamiento-popup-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(720px, 90vh);
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lanzamiento-popup-overlay.is-visible .lanzamiento-popup-modal {
  transform: translateY(0) scale(1);
}

.lanzamiento-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #1a1a1a;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lanzamiento-popup-close:hover {
  background-color: #b33a42;
  color: #fff;
  transform: scale(1.06);
}

.lanzamiento-popup-close:focus-visible {
  outline: 2px solid #b33a42;
  outline-offset: 2px;
}

.lanzamiento-popup-close svg {
  width: 16px;
  height: 16px;
}

/* El iframe se ajusta a la altura de su contenido (ver
   js/lanzamiento-popup.js), así que el scroll vertical, si hace falta en
   pantallas bajas, lo lleva este contenedor y nunca hay scroll horizontal. */
.lanzamiento-popup-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
}

.lanzamiento-popup-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #fff;
  color: #6b6b6b;
  font-size: 14px;
}

.lanzamiento-popup-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(179, 58, 66, 0.15);
  border-top-color: #b33a42;
  border-radius: 50%;
  animation: lanzamiento-popup-spin 0.8s linear infinite;
}

@keyframes lanzamiento-popup-spin {
  to {
    transform: rotate(360deg);
  }
}

.lanzamiento-popup-iframe {
  display: block;
  width: 100%;
  height: 360px;
  border: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lanzamiento-popup-iframe.is-loaded {
  opacity: 1;
}

@media (max-width: 600px) {
  .lanzamiento-popup-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .lanzamiento-popup-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
}

/* Evita que la página de fondo se desplace mientras el popup está abierto. */
body.lanzamiento-popup-open {
  overflow: hidden;
}
