/**
 * Xyod Popups — centered modal overlay.
 */

.xyod-popup {
	position: fixed;
	inset: 0;
	z-index: 10080;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.xyod-popup[hidden] {
	display: none !important;
}

.xyod-popup.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.xyod-popup.is-open[hidden] {
	display: flex !important;
}

.xyod-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	cursor: pointer;
}

.xyod-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(var(--xyod-popup-width, 560px), 100%);
	max-height: min(90vh, 900px);
	overflow: auto;
	background: #fff;
	color: inherit;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
	box-sizing: border-box;
	transform: translateY(12px) scale(0.98);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.xyod-popup.is-open .xyod-popup__dialog {
	transform: translateY(0) scale(1);
}

.xyod-popup__close {
	position: absolute;
	top: var(--xyod-popup-close-top, 10px);
	right: var(--xyod-popup-close-right, 10px);
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: var(--xyod-popup-close-size, 40px) !important;
	height: var(--xyod-popup-close-size, 40px) !important;
	min-width: var(--xyod-popup-close-size, 40px) !important;
	min-height: var(--xyod-popup-close-size, 40px) !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	/* Beat Elementor kit `button { background / color / font-size }`. */
	background: var(--xyod-popup-close-bg, #ffffff) !important;
	background-color: var(--xyod-popup-close-bg, #ffffff) !important;
	box-shadow: none !important;
	color: var(--xyod-popup-close-color, #111111) !important;
	font-size: var(--xyod-popup-close-font, 22px) !important;
	font-weight: 300 !important;
	line-height: 1 !important;
	cursor: pointer;
	opacity: 1 !important;
	transition: color 0.2s ease, background-color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.xyod-popup__close-icon,
.xyod-popup__close svg {
	display: block !important;
	width: 1em !important;
	height: 1em !important;
	flex: 0 0 auto;
	pointer-events: none;
	fill: none !important;
	stroke: currentColor !important;
	color: inherit !important;
}

.xyod-popup__close:hover,
.xyod-popup__close:focus,
.xyod-popup__close:focus-visible,
.xyod-popup__close.is-hover {
	background: var(--xyod-popup-close-bg-hover, var(--xyod-popup-close-bg, #ffffff)) !important;
	background-color: var(--xyod-popup-close-bg-hover, var(--xyod-popup-close-bg, #ffffff)) !important;
	box-shadow: none !important;
	color: var(--xyod-popup-close-color-hover, var(--xyod-popup-close-color, #111111)) !important;
	opacity: 1 !important;
	outline: none;
}

.xyod-popup__close:hover .xyod-popup__close-icon,
.xyod-popup__close:hover svg,
.xyod-popup__close:focus .xyod-popup__close-icon,
.xyod-popup__close:focus svg,
.xyod-popup__close:focus-visible .xyod-popup__close-icon,
.xyod-popup__close:focus-visible svg,
.xyod-popup__close.is-hover .xyod-popup__close-icon,
.xyod-popup__close.is-hover svg {
	color: var(--xyod-popup-close-color-hover, var(--xyod-popup-close-color, #111111)) !important;
	stroke: currentColor !important;
}

.xyod-popup__content {
	padding: 0;
	box-sizing: border-box;
}

/* Editor / preview: dim canvas; white frame only on popup content. */
body.elementor-editor-active.xyod-editing-popup,
body.elementor-editor-preview.xyod-editing-popup {
	background: rgba(17, 17, 17, 0.35);
}

/* Site chrome stays full width — no popup white behind header/menu. */
body.elementor-editor-active.xyod-editing-popup .entry-header,
body.elementor-editor-active.xyod-editing-popup .page-header,
body.elementor-editor-active.xyod-editing-popup .entry-title,
body.elementor-editor-preview.xyod-editing-popup .entry-header,
body.elementor-editor-preview.xyod-editing-popup .page-header,
body.elementor-editor-preview.xyod-editing-popup .entry-title {
	display: none !important;
}

body.elementor-editor-active.xyod-editing-popup #site-header,
body.elementor-editor-active.xyod-editing-popup .site-header,
body.elementor-editor-active.xyod-editing-popup .site-footer,
body.elementor-editor-active.xyod-editing-popup #content,
body.elementor-editor-active.xyod-editing-popup .site-main,
body.elementor-editor-preview.xyod-editing-popup #site-header,
body.elementor-editor-preview.xyod-editing-popup .site-header,
body.elementor-editor-preview.xyod-editing-popup .site-footer,
body.elementor-editor-preview.xyod-editing-popup #content,
body.elementor-editor-preview.xyod-editing-popup .site-main {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
}

body.elementor-editor-active.xyod-editing-popup #elementor,
body.elementor-editor-preview.xyod-editing-popup #elementor {
	max-width: none !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* Popup dialog frame: Elementor document root in the preview iframe. */
body.elementor-editor-active.xyod-editing-popup .elementor[data-elementor-id],
body.elementor-editor-preview.xyod-editing-popup .elementor[data-elementor-id] {
	width: min(var(--xyod-popup-width, 560px), 100%) !important;
	max-width: min(var(--xyod-popup-width, 560px), 100%) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box;
	background: #fff;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

body.elementor-editor-active.xyod-editing-popup .elementor[data-elementor-id] > .e-con,
body.elementor-editor-preview.xyod-editing-popup .elementor[data-elementor-id] > .e-con {
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-shadow: none !important;
}

body.elementor-editor-active .xyod-popup,
body.elementor-editor-preview.elementor-editor-active .xyod-popup {
	position: relative;
	inset: auto;
	z-index: 1;
	display: block;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	padding: 0;
}

body.elementor-editor-active .xyod-popup__overlay,
body.elementor-editor-active .xyod-popup__close {
	display: none;
}

body.elementor-editor-active .xyod-popup__dialog {
	width: min(var(--xyod-popup-width, 560px), 100%);
	max-height: none;
	transform: none;
	box-shadow: none;
}

body.admin-bar .xyod-popup {
	/* Keep under WP admin bar; dialog still centered in viewport */
}

body.xyod-popup-open {
	overflow: hidden !important;
	/* Keep layout from jumping when the scrollbar disappears. */
	padding-right: var(--xyod-popup-scrollbar-gap, 0px) !important;
}
