/**
 * AAE Theme Builder popup hosting the Artravel Newsletter form.
 * Fixes: overlay visible but box behind header / dark 400px frame / off-screen.
 * Live front-end only (skip Elementor editor classes).
 */

body:not(.elementor-editor-active):not(.elementor-editor-preview) .popup-overlay.anl-popup-overlay,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder:has([data-anl-form]) ~ .popup-overlay,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .popup-overlay {
  z-index: 100000 !important;
}

body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder.aae-gsap-popup-builder:has([data-anl-form]) {
  z-index: 100001 !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  max-height: 90vh;
  max-width: min(560px, 92vw);
}

body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder:has([data-anl-form]) .popup-content {
  width: min(560px, 92vw) !important;
  height: auto !important;
  max-height: 90vh !important;
  overflow: auto !important;
  background: #ffffff !important;
  color: #2e3753;
  padding: 52px 24px 28px !important;
  box-sizing: border-box;
}

body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder:has([data-anl-form]) .popup-content > .elementor {
  position: relative;
  z-index: 1;
}

body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder:has([data-anl-form]) > .close-button,
body:not(.elementor-editor-active):not(.elementor-editor-preview) .aae-popup-builder:has([data-anl-form]) .close-button {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 44px !important;
  height: 44px !important;
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  background: #2e3753 !important;
  color: #ffffff !important;
  font-size: 28px !important;
  line-height: 44px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  cursor: pointer !important;
}
