/**
 * Pro Popup Builder frontend styles.
 *
 * @package Pro_Popup_Builder
 */

.pro-popup {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 16px;
}

.pro-popup.is-open {
	display: flex;
}

.pro-popup--h-left {
	justify-content: flex-start;
}

.pro-popup--h-center {
	justify-content: center;
}

.pro-popup--h-right {
	justify-content: flex-end;
}

.pro-popup--v-top {
	align-items: flex-start;
}

.pro-popup--v-center {
	align-items: center;
}

.pro-popup--v-bottom {
	align-items: flex-end;
}

.pro-popup__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.5);
}

.pro-popup__dialog {
	position: relative;
	box-sizing: border-box;
	max-height: 90vh;
	overflow: auto;
	background-color: #fff;
	transform-origin: center center;
}

.pro-popup__content {
	position: relative;
	z-index: 1;
}

.pro-popup__close {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.pro-popup__close:hover,
.pro-popup__close:focus {
	background: rgba(0, 0, 0, 0.75);
	transform: scale(1.06);
}

.pro-popup__close--top-right {
	top: 12px;
	right: 12px;
}

.pro-popup__close--top-left {
	top: 12px;
	left: 12px;
}

.pro-popup__close--bottom-right {
	bottom: 12px;
	right: 12px;
}

.pro-popup__close--bottom-left {
	bottom: 12px;
	left: 12px;
}

.pro-popup__close--icon-round {
	border-radius: 50%;
}

.pro-popup__close--icon-x {
	border-radius: 4px;
}

.pro-popup__close--text {
	width: auto;
	height: auto;
	padding: 6px 10px;
	border-radius: 0;
	background: transparent;
	color: #333;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.pro-popup-trigger,
.open-pro-popup {
	display: inline-block;
	cursor: pointer;
}

/* Entrance animations */
.pro-popup--enter-fade.is-open .pro-popup__dialog {
	animation: ppb-fade-in var(--ppb-duration, 300ms) ease both;
}

.pro-popup--enter-slide-up.is-open .pro-popup__dialog {
	animation: ppb-slide-up-in var(--ppb-duration, 300ms) ease both;
}

.pro-popup--enter-slide-down.is-open .pro-popup__dialog {
	animation: ppb-slide-down-in var(--ppb-duration, 300ms) ease both;
}

.pro-popup--enter-zoom.is-open .pro-popup__dialog {
	animation: ppb-zoom-in var(--ppb-duration, 300ms) ease both;
}

.pro-popup--enter-flip.is-open .pro-popup__dialog {
	animation: ppb-flip-in var(--ppb-duration, 300ms) ease both;
}

/* Exit animations */
.pro-popup--exit-fade.is-closing .pro-popup__dialog {
	animation: ppb-fade-out var(--ppb-duration, 300ms) ease both;
}

.pro-popup--exit-slide-up.is-closing .pro-popup__dialog {
	animation: ppb-slide-up-out var(--ppb-duration, 300ms) ease both;
}

.pro-popup--exit-zoom.is-closing .pro-popup__dialog {
	animation: ppb-zoom-out var(--ppb-duration, 300ms) ease both;
}

.pro-popup.is-closing .pro-popup__overlay {
	opacity: 0;
	transition: opacity var(--ppb-duration, 300ms) ease;
}

body.ppb-popup-open {
	overflow: hidden !important;
}

.ppb-preview-body {
	margin: 0;
}

@keyframes ppb-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ppb-fade-out {
	from { opacity: 1; }
	to { opacity: 0; }
}

@keyframes ppb-slide-up-in {
	from { opacity: 0; transform: translateY(40px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes ppb-slide-up-out {
	from { opacity: 1; transform: translateY(0); }
	to { opacity: 0; transform: translateY(40px); }
}

@keyframes ppb-slide-down-in {
	from { opacity: 0; transform: translateY(-40px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes ppb-zoom-in {
	from { opacity: 0; transform: scale(0.85); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes ppb-zoom-out {
	from { opacity: 1; transform: scale(1); }
	to { opacity: 0; transform: scale(0.85); }
}

@keyframes ppb-flip-in {
	from { opacity: 0; transform: perspective(600px) rotateY(-25deg); }
	to { opacity: 1; transform: perspective(600px) rotateY(0); }
}

@media (max-width: 600px) {
	.pro-popup {
		padding: 8px;
	}

	.pro-popup__dialog {
		width: 100% !important;
		max-height: 94vh;
	}
}
