.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease-in;
  z-index: 1050;
}

.popup-overlay.visible {
  visibility: visible;
  opacity: 1;
}

.popup-content {
  background: #fff;
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  max-width: 800px;
  max-height:800px;
  width: 100%;
  height:auto;
  position: relative;
  transform: translateY(-50px);
  opacity: 0;
  transition: transform 0.4s ease-in, opacity 0.4s ease-in;
}

.popup-overlay.visible .popup-content {
  transform: translateY(0);
  opacity: 1;
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  background: #e10600;
  cursor: pointer;
}

/* Ocultar la imagen por defecto pero sin bloquear la detección del script */
img.img-myt:not(.in-popup) {
  display: none !important;
}

/* Estilo y transición del botón */
#ver-guia-btn.btn-popup-transicion {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  display: inline-block;
  margin-bottom: 0.2rem;
  color: #212529;
  font-size: 1rem;
  outline: none !important;
}

/* Activación inmediata */
#ver-guia-btn.btn-popup-transicion {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .popup-content {
    width: 90vw;
    max-width: none;
    padding: 1.5rem;
  }

  .popup-content img {
    width: 100%;
    height: auto;
  }
}
