/**
 * Elementor Popup Builder Lite — Popup Styles
 *
 * Core CSS for popup rendering, overlay, positioning, and responsive.
 * Uses CSS custom properties for dynamic theming.
 * BEM methodology for class naming.
 *
 * @package EPBL
 * @since   1.0.0
 */

/* ============================================================
   CSS Custom Properties (Defaults)
   ============================================================ */

:root {
	--epbl-popup-width: 600px;
	--epbl-popup-max-width: 90vw;
	--epbl-popup-height: auto;
	--epbl-overlay-color: #000000;
	--epbl-overlay-opacity: 0.5;
	--epbl-popup-border-radius: 8px;
	--epbl-animation-duration: 300ms;
	--epbl-popup-z-index: 999999;
	--epbl-popup-padding: 0;
	--epbl-close-size: 36px;
	--epbl-close-offset: 12px;
	--epbl-focus-color: #2271b1;
}

/* ============================================================
   Scroll Lock
   ============================================================ */

body.epbl-scroll-locked {
	overflow: hidden;
	position: fixed;
	width: 100%;
	left: 0;
	right: 0;
}

/* ============================================================
   Popup Wrapper
   ============================================================ */

.epbl-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: var(--epbl-popup-z-index);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}

.epbl-popup--visible {
	display: flex;
}

/* ============================================================
   Position Variants
   ============================================================ */

.epbl-popup--center {
	align-items: center;
	justify-content: center;
}

.epbl-popup--top {
	align-items: flex-start;
	justify-content: center;
	padding-top: 40px;
}

.epbl-popup--bottom {
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 40px;
}

.epbl-popup--left {
	align-items: center;
	justify-content: flex-start;
	padding-left: 0;
}

.epbl-popup--left .epbl-popup__container {
	border-radius: 0 var(--epbl-popup-border-radius) var(--epbl-popup-border-radius) 0;
	max-height: 100vh;
	height: 100%;
}

.epbl-popup--right {
	align-items: center;
	justify-content: flex-end;
	padding-right: 0;
}

.epbl-popup--right .epbl-popup__container {
	border-radius: var(--epbl-popup-border-radius) 0 0 var(--epbl-popup-border-radius);
	max-height: 100vh;
	height: 100%;
}

.epbl-popup--top-left {
	align-items: flex-start;
	justify-content: flex-start;
}

.epbl-popup--top-right {
	align-items: flex-start;
	justify-content: flex-end;
}

.epbl-popup--bottom-left {
	align-items: flex-end;
	justify-content: flex-start;
}

.epbl-popup--bottom-right {
	align-items: flex-end;
	justify-content: flex-end;
}

/* ============================================================
   Overlay
   ============================================================ */

.epbl-popup__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--epbl-overlay-color);
	opacity: var(--epbl-overlay-opacity);
	cursor: pointer;
}

/* ============================================================
   Container
   ============================================================ */

.epbl-popup__container {
	position: relative;
	width: var(--epbl-popup-width);
	max-width: var(--epbl-popup-max-width);
	height: var(--epbl-popup-height);
	max-height: 90vh;
	background: #ffffff;
	border-radius: var(--epbl-popup-border-radius);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
	            0 4px 16px rgba(0, 0, 0, 0.1);
	overflow-y: auto;
	overflow-x: hidden;
	z-index: 1;
	-webkit-overflow-scrolling: touch;
}

/* ============================================================
   Content
   ============================================================ */

.epbl-popup__content {
	padding: var(--epbl-popup-padding);
}

/* Ensure Elementor content fills properly */
.epbl-popup__content .elementor {
	width: 100%;
}

.epbl-popup__content .elementor-section-wrap {
	width: 100%;
}

/* ============================================================
   Close Button
   ============================================================ */

.epbl-popup__close {
	position: absolute;
	top: var(--epbl-close-offset);
	right: var(--epbl-close-offset);
	z-index: 2;
	width: var(--epbl-close-size);
	height: var(--epbl-close-size);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #333333;
	cursor: pointer;
	transition: background-color 200ms ease, color 200ms ease, transform 200ms ease;
	-webkit-appearance: none;
	appearance: none;
	line-height: 1;
}

.epbl-popup__close:hover {
	background: rgba(0, 0, 0, 0.12);
	color: #111111;
	transform: scale(1.1);
}

.epbl-popup__close:active {
	transform: scale(0.95);
}

.epbl-popup__close:focus-visible {
	outline: 2px solid var(--epbl-focus-color);
	outline-offset: 2px;
}

.epbl-popup__close-icon {
	width: 18px;
	height: 18px;
	pointer-events: none;
}

/* ============================================================
   Title (Screen Reader Only)
   ============================================================ */

.epbl-popup__title.epbl-sr-only,
.epbl-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ============================================================
   Focus Indicators
   ============================================================ */

.epbl-popup a:focus-visible,
.epbl-popup button:focus-visible,
.epbl-popup input:focus-visible,
.epbl-popup select:focus-visible,
.epbl-popup textarea:focus-visible,
.epbl-popup [tabindex]:focus-visible {
	outline: 2px solid var(--epbl-focus-color);
	outline-offset: 2px;
}

/* ============================================================
   Trigger Styles
   ============================================================ */

.epbl-trigger {
	cursor: pointer;
}

/* ============================================================
   Status Badges (Admin List)
   ============================================================ */

.epbl-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.epbl-status--active {
	background: #d4edda;
	color: #155724;
}

.epbl-status--inactive {
	background: #f8d7da;
	color: #721c24;
}

/* ============================================================
   Responsive
   ============================================================ */

@media screen and (max-width: 768px) {
	.epbl-popup {
		padding: 10px;
	}

	.epbl-popup__container {
		max-width: 95vw;
		max-height: 85vh;
	}

	.epbl-popup--left .epbl-popup__container,
	.epbl-popup--right .epbl-popup__container {
		width: 90vw;
	}

	.epbl-popup__close {
		--epbl-close-size: 32px;
		--epbl-close-offset: 8px;
	}
}

@media screen and (max-width: 480px) {
	.epbl-popup__container {
		max-width: 100%;
		border-radius: var(--epbl-popup-border-radius);
	}
}
