/* =====================================================
   POPUP OVERLAY - Modal backdrop
   ===================================================== */
.epm-popup-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.7) !important;
  z-index: 99999 !important;
  display: none; /* JS will change to flex */
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* =====================================================
   POPUP CONTAINER - White content box
   ===================================================== */
.epm-popup-container {
  background: transparent;
  border-radius: 30px !important;
  max-width: 824px !important;
  width: 90% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  position: relative !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  box-sizing: border-box !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  pointer-events: auto !important;
  transform: none !important;
  margin: auto !important;
}

/* =====================================================
   CLOSE BUTTON
   ===================================================== */

.epm-popup-close {
  position: absolute !important;
  top: 10px !important;
  right: 15px !important;
  background: none !important;
  border: none !important;
  font-size: 40px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  color: white !important;
  z-index: 100000 !important;
  padding: 4px 10px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* =====================================================
   CONTENT AREA - FORCE ALL ELEMENTOR CONTENT VISIBLE
   ===================================================== */
.epm-popup-content {
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  position: relative !important;
  min-height: 50px !important;
}

/* Force all children visible */
.epm-popup-content * {
  opacity: 1 !important;
  visibility: visible !important;
}

/* =====================================================
   CRITICAL: Override Elementor popup/document hiding
   ===================================================== */
/* Elementor Pro popup documents hide content by default */
.epm-popup-content .elementor-location-popup,
.epm-popup-content .elementor-popup-modal,
.epm-popup-content dialog,
.epm-popup-content .dialog-type-lightbox {
  display: block !important;
  position: static !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  animation: none !important;
  pointer-events: auto !important;
  inset: auto !important;
  width: auto !important;
  height: auto !important;
  z-index: auto !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Override any display:none from Elementor entrance animations */
.epm-popup-content .elementor-invisible,
.epm-popup-content .elementor-hidden,
.epm-popup-content .elementor-item:not(.elementor-active),
.epm-popup-content [class*="elementor-entrance"],
.epm-popup-content .elementor-animated {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  transform: none !important;
  animation: none !important;
}

/* =====================================================
   Elementor sections inside popup
   ===================================================== */
.epm-popup-content .elementor-section,
.epm-popup-content .elementor-section-boxed,
.epm-popup-content .elementor-section-full_width,
.epm-popup-content .elementor-section-stretched,
.epm-popup-content .elementor-container,
.epm-popup-content .elementor-row,
.epm-popup-content .elementor-column,
.epm-popup-content .elementor-column-wrap,
.epm-popup-content .elementor-widget-wrap,
.epm-popup-content .elementor-widget,
.epm-popup-content .elementor-widget-container {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  max-width: 100% !important;
  transform: none !important;
  animation: none !important;
}

/* =====================================================
   Images and media
   ===================================================== */
.epm-popup-content img,
.epm-popup-content video,
.epm-popup-content iframe,
.epm-popup-content picture,
.epm-popup-content figure,
.epm-popup-content .elementor-widget-image img,
.epm-popup-content .elementor-widget-video iframe {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  max-width: 100% !important;
  height: auto !important;
}

/* =====================================================
   ANIMATION for popup appearance
   ===================================================== */
.epm-popup-overlay[style*="display: flex"] .epm-popup-container {
  animation: epmFadeIn 0.3s ease-out;
}

@keyframes epmFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.epm-popup-container .cn-title-lh h2.ekit-heading--title {
  line-height: 0.6 !important;
}

/* =====================================================
   MOBILE RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .epm-popup-overlay {
    padding: 10px !important;
    align-items: flex-start !important;
    padding-top: 20px !important;
  }

  .epm-popup-container {
    max-width: 100% !important;
    max-height: 85vh !important;
  }

  .epm-popup-close {
    top: 5px !important;
    right: 10px !important;
  }
  .epm-popup-container .cn-title-lh h2.ekit-heading--title {
    line-height: inherit !important;
  }
  .elementor-element-cd4f907 a {
    width: 100%;
    text-align: center;
  }
}
