/* ------------------------------------------
   BOTÓN QUE ABRE EL MODAL
------------------------------------------- */

p > a.modal-open {
  display: flex;
  justify-content: center;
  border-radius: 5px;
  text-decoration: none;
  background: linear-gradient(120deg, #66E89A, #00ce5f 40%, #008A42);
  background-size: 200% 200%;
  transition: background-position 0.5s ease, transform 0.2s ease;
  animation: gradientMove 5s ease infinite;
}
p > a.modal-open:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow: 0px 10px 10px -5px lightgray;
}
p > a.modal-open:active {
  transform: translateY(0);
  background-position: 50% 50%;
  box-shadow: 0px 10px 10px -5px lightgray;
}
p > a.modal-open > img {
  height: auto;
  border-radius: 5px;
}

/* Animación del degradado */
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ------------------------------------------
   MODAL GENÉRICO PARA IFRAMES
------------------------------------------- */

.modal-container {
  position: fixed;
  z-index: 999999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease-in-out;
}
.modal-container.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-container.open .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-container .modal-content {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #fff;
  overflow: hidden;
  transform: scale(0.94) translateY(20px);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1), opacity 0.35s ease-in-out;
}
.modal-container .modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ------------------------------------------
   BOTÓN DE CIERRE DEL MODAL
------------------------------------------- */

.modal-container .modal-close {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
  transition: background 0.25s ease, transform 0.2s ease;
}
.modal-container .modal-close:hover {
  background: rgba(0, 0, 0, 0.95);
  transform: scale(1.1);
}
.modal-container .modal-close:active {
  transform: scale(0.95);
}
