/**
 * Elementor Pro popup modal clone (Free mode).
 * Matches live #elementor-popup-modal-9012 / 9020 + z-index above sticky header.
 */

[data-elementor-type="popup"] .elementor-section-wrap:not(:empty) + #elementor-add-new-section,
[data-elementor-type="popup"]:not(.elementor-edit-area) {
	display: none;
}

/* Above sticky header (header uses ~100050) */
.elementor-popup-modal.dialog-type-lightbox,
.dialog-type-lightbox.elementor-popup-modal {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	z-index: 100200 !important;
	background-color: rgba(0, 0, 0, 0.8) !important;
	display: flex !important;
	align-items: center;
	justify-content: center;
	pointer-events: all;
	user-select: auto;
}

.elementor-popup-modal[hidden] {
	display: none !important;
}

.elementor-popup-modal .dialog-buttons-wrapper,
.elementor-popup-modal .dialog-header {
	display: none;
}

.elementor-popup-modal .dialog-widget-content {
	background-color: #fff;
	border-radius: 0;
	box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2);
	max-height: 100%;
	max-width: 100%;
	overflow: visible;
	pointer-events: all;
	width: auto;
	min-width: min(90vw, 960px);
	min-height: min(80vh, 520px);
	position: relative;
	z-index: 1;
}

.elementor-popup-modal .dialog-message {
	display: flex;
	max-height: 100vh;
	max-width: 100vw;
	overflow: auto;
	padding: 0;
	width: 90vw;
	position: relative;
	z-index: 1;
}

.elementor-popup-modal .elementor {
	width: 100%;
}

/* Live close — plain dark X, never theme/button blue fill */
.elementor-popup-modal .dialog-close-button,
.elementor-popup-modal a.dialog-close-button,
.elementor-popup-modal button.dialog-close-button {
	all: unset;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	position: absolute !important;
	top: 16px !important;
	right: 16px !important;
	inset-inline-end: 16px !important;
	width: 40px !important;
	height: 40px !important;
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: none !important;
	opacity: 1 !important;
	pointer-events: all !important;
	z-index: 100210 !important;
	cursor: pointer !important;
	line-height: 1 !important;
	color: #1f2124 !important;
	text-decoration: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.elementor-popup-modal .dialog-close-button:hover,
.elementor-popup-modal .dialog-close-button:focus,
.elementor-popup-modal .dialog-close-button:focus-visible,
.elementor-popup-modal .dialog-close-button:active,
.elementor-popup-modal a.dialog-close-button:hover,
.elementor-popup-modal a.dialog-close-button:focus,
.elementor-popup-modal a.dialog-close-button:active {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	outline: none !important;
	color: #000 !important;
	border: 0 !important;
}

.elementor-popup-modal .dialog-close-button .eicon-close,
.elementor-popup-modal .dialog-close-button i {
	display: block !important;
	font-family: eicons !important;
	font-style: normal !important;
	font-weight: 400 !important;
	font-size: 22px !important;
	line-height: 1 !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	color: #1f2124 !important;
	speak: never;
	-webkit-font-smoothing: antialiased;
}

.elementor-popup-modal .dialog-close-button .eicon-close::before {
	content: "\e87f";
	color: #1f2124 !important;
}

.elementor-popup-modal .dialog-close-button svg {
	display: none !important;
}

#elementor-popup-modal-9012 .dialog-message,
#elementor-popup-modal-9020 .dialog-message {
	width: 90vw;
	height: auto;
}

.elementor-popup-modal iframe.bookframe,
.elementor-popup-modal .bookframe {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	height: min(80vh, 700px) !important;
	min-height: 420px !important;
	border: 0 !important;
	margin: 0 auto;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.elementor-popup-modal iframe.bookframe.sa-popup-iframe-loading {
	opacity: 0;
}

/* Loader while Paperturn / book iframe loads (avoids empty white modal) */
.elementor-popup-modal .sa-popup-loader {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 2;
	align-items: center;
	justify-content: center;
	background: #fff;
	pointer-events: none;
}

.elementor-popup-modal.sa-popup-loading .sa-popup-loader {
	display: flex;
}

.elementor-popup-modal .sa-popup-loader__spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e6e9ef;
	border-top-color: #001c5c;
	border-radius: 50%;
	animation: sa-popup-spin 0.8s linear infinite;
}

@keyframes sa-popup-spin {
	to {
		transform: rotate(360deg);
	}
}

body.sa-el-popup-open,
body.dialog-prevent-scroll {
	overflow: hidden;
}

body.sa-el-popup-open .elementor-1387,
body.sa-el-popup-open .elementor-location-header,
body.sa-el-popup-open .elementor-1387 .elementor-sticky--active {
	z-index: 1 !important;
}

@media (max-width: 767px) {
	.elementor-popup-modal .dialog-widget-content {
		min-width: 100%;
		min-height: min(70vh, 420px);
	}

	.elementor-popup-modal iframe.bookframe,
	.elementor-popup-modal .bookframe {
		height: min(70vh, 480px) !important;
		min-height: 280px !important;
	}
}
