/**
 * Popup Builder Frontend Styles
 *
 * @package Starter_Flavor
 * @since 1.0.0
 */

/* ===============================================
   OVERLAY STYLES
   =============================================== */

.sf-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	animation: sf-popup-fade-in 0.3s ease-in-out;
}

.sf-popup-overlay[style*="backdrop-filter"] {
	backdrop-filter: blur(5px);
}

/* ===============================================
   POPUP WRAPPER & CONTAINER
   =============================================== */

.sf-popup-wrapper {
	position: fixed;
	z-index: 9999;
	background: white;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	max-width: 100%;
	display: flex;
	flex-direction: column;
}

.sf-popup-wrapper.sf-popup-modal {
	max-height: 90vh;
	overflow-y: auto;
}

/* ===============================================
   SIZE VARIANTS
   =============================================== */

.sf-popup-wrapper.sf-popup-small {
	width: 400px;
	max-width: 100%;
}

.sf-popup-wrapper.sf-popup-medium {
	width: 600px;
	max-width: 100%;
}

.sf-popup-wrapper.sf-popup-large {
	width: 800px;
	max-width: 100%;
}

.sf-popup-wrapper.sf-popup-fullscreen {
	width: 100%;
	height: 100%;
	border-radius: 0;
	max-height: 100vh;
}

/* ===============================================
   POSITION VARIANTS
   =============================================== */

.sf-popup-wrapper.sf-popup-position-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.sf-popup-wrapper.sf-popup-position-top {
	top: 20px;
	left: 50%;
	transform: translateX(-50%);
}

.sf-popup-wrapper.sf-popup-position-bottom {
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
}

.sf-popup-wrapper.sf-popup-position-left {
	top: 50%;
	left: 20px;
	transform: translateY(-50%);
}

.sf-popup-wrapper.sf-popup-position-right {
	top: 50%;
	right: 20px;
	transform: translateY(-50%);
}

.sf-popup-wrapper.sf-popup-position-top_left {
	top: 20px;
	left: 20px;
}

.sf-popup-wrapper.sf-popup-position-top_right {
	top: 20px;
	right: 20px;
}

.sf-popup-wrapper.sf-popup-position-bottom_left {
	bottom: 20px;
	left: 20px;
}

.sf-popup-wrapper.sf-popup-position-bottom_right {
	bottom: 20px;
	right: 20px;
}

.sf-popup-wrapper.sf-popup-position-fullscreen {
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	transform: none;
	width: 100%;
	height: 100%;
}

/* ===============================================
   LAYOUT VARIANTS
   =============================================== */

.sf-popup-wrapper.sf-popup-layout-modal {
	position: fixed;
}

.sf-popup-wrapper.sf-popup-layout-slide_panel {
	position: fixed;
	width: 400px;
	height: 100vh;
	border-radius: 0;
	top: 0;
	bottom: 0;
	left: -100%;
}

.sf-popup-wrapper.sf-popup-layout-slide_panel.sf-popup-position-left {
	left: 0;
}

.sf-popup-wrapper.sf-popup-layout-slide_panel.sf-popup-position-right {
	right: 0;
	left: auto;
}

.sf-popup-wrapper.sf-popup-layout-notification {
	width: 100%;
	max-width: 100%;
	border-radius: 0;
	left: 0;
	right: 0;
}

.sf-popup-wrapper.sf-popup-layout-notification.sf-popup-position-top {
	top: 0;
}

.sf-popup-wrapper.sf-popup-layout-notification.sf-popup-position-bottom {
	top: auto;
	bottom: 0;
}

.sf-popup-wrapper.sf-popup-layout-floating_box {
	width: auto;
	padding: 20px;
}

/* ===============================================
   ANIMATION KEYFRAMES
   =============================================== */

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

@keyframes sf-popup-slide-up {
	from {
		transform: translate(-50%, 100%);
		opacity: 0;
	}
	to {
		transform: translate(-50%, 0);
		opacity: 1;
	}
}

@keyframes sf-popup-slide-down {
	from {
		transform: translate(-50%, -100%);
		opacity: 0;
	}
	to {
		transform: translate(-50%, 0);
		opacity: 1;
	}
}

@keyframes sf-popup-slide-left {
	from {
		transform: translate(-100%, -50%);
		opacity: 0;
	}
	to {
		transform: translate(0, -50%);
		opacity: 1;
	}
}

@keyframes sf-popup-slide-right {
	from {
		transform: translate(100%, -50%);
		opacity: 0;
	}
	to {
		transform: translate(0, -50%);
		opacity: 1;
	}
}

@keyframes sf-popup-zoom {
	from {
		transform: translate(-50%, -50%) scale(0.8);
		opacity: 0;
	}
	to {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

@keyframes sf-popup-flip {
	from {
		transform: translate(-50%, -50%) rotateY(90deg);
		opacity: 0;
	}
	to {
		transform: translate(-50%, -50%) rotateY(0);
		opacity: 1;
	}
}

/* ===============================================
   ANIMATION CLASSES
   =============================================== */

.sf-popup-wrapper.sf-popup-animation-fade {
	animation: sf-popup-fade-in 0.4s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-slide_up {
	animation: sf-popup-slide-up 0.5s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-slide_down {
	animation: sf-popup-slide-down 0.5s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-slide_left {
	animation: sf-popup-slide-left 0.5s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-slide_right {
	animation: sf-popup-slide-right 0.5s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-zoom {
	animation: sf-popup-zoom 0.5s ease-in-out;
}

.sf-popup-wrapper.sf-popup-animation-flip {
	animation: sf-popup-flip 0.6s ease-in-out;
	transform-style: preserve-3d;
}

/* ===============================================
   CONTENT AREA
   =============================================== */

.sf-popup-content {
	padding: 30px;
	overflow-y: auto;
	flex: 1;
	position: relative;
}

.sf-popup-content > :first-child {
	margin-top: 0;
}

.sf-popup-content > :last-child {
	margin-bottom: 0;
}

/* ===============================================
   CLOSE BUTTON
   =============================================== */

.sf-popup-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: transparent;
	border: none;
	width: 32px;
	height: 32px;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.sf-popup-close:hover,
.sf-popup-close:focus {
	opacity: 1;
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.sf-popup-close span {
	position: absolute;
	width: 24px;
	height: 2px;
	background: #333;
	border-radius: 2px;
	transition: all 0.3s ease;
}

.sf-popup-close span:first-child {
	transform: rotate(45deg);
}

.sf-popup-close span:last-child {
	transform: rotate(-45deg);
}

.sf-popup-close:hover span {
	background: #2563eb;
}

/* Close button outside popup */
.sf-popup-wrapper.sf-popup-position-center ~ .sf-popup-close {
	top: 50%;
	left: 50%;
	margin-top: -50px;
	margin-left: 300px;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 768px) {
	.sf-popup-wrapper.sf-popup-small,
	.sf-popup-wrapper.sf-popup-medium,
	.sf-popup-wrapper.sf-popup-large {
		width: 90vw;
		max-width: 90vw;
	}

	.sf-popup-wrapper.sf-popup-layout-slide_panel {
		width: 100%;
	}

	.sf-popup-content {
		padding: 20px;
	}

	.sf-popup-close {
		width: 28px;
		height: 28px;
		top: 12px;
		right: 12px;
	}

	.sf-popup-close span {
		width: 20px;
	}
}

@media (max-width: 480px) {
	.sf-popup-wrapper {
		border-radius: 8px 8px 0 0;
	}

	.sf-popup-wrapper.sf-popup-position-center {
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		transform: none;
		width: 100%;
		border-radius: 8px 8px 0 0;
	}

	.sf-popup-content {
		padding: 20px 15px;
	}
}

/* ===============================================
   ACCESSIBILITY
   =============================================== */

.sf-popup-wrapper:focus-within {
	outline: 2px solid #2563eb;
	outline-offset: 0;
}

.sf-popup-close:focus {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* ===============================================
   UTILITIES
   =============================================== */

.sf-popup-hidden {
	display: none !important;
}

.sf-popup-no-scroll {
	overflow: hidden;
}
