/* Overlay wrapper (recommended for real popup behavior) */
#megaenst-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* Popup box */
.megaenst-popup-content {
  position: relative;
  width: 100%;
  max-width: 900px; /* control popup width */
  max-height: 90vh; /* prevent overflow */
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  overflow: auto;
  display: flex;
  flex-direction: column;
  animation: megaenstFadeIn 0.3s ease;
}

.megaenst-popup-inner {
  padding: 20px;
}

/* Responsive layout */
@media (min-width: 768px) {
  .megaenst-popup-content {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Close button */
.megaenst-popup-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 26px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.megaenst-popup-close:hover {
  transform: rotate(90deg);
  opacity: 0.7;
}

/* Hide class */
.megaenst-popup-hide {
  display: none !important;
}

/* Simple fade animation */
@keyframes megaenstFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
