/* ==========================================================================
   Checkout Modal - Full-screen modal for FunnelKit checkout flow
   ========================================================================== */

.sfd-checkout-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.sfd-checkout-modal.is-open {
	display: block;
	opacity: 1;
}

/* Overlay - 50/50 split background (gray left, white right) */
.sfd-checkout-modal__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to right, #F8F8F8 0%, #F8F8F8 50%, #FFFFFF 50%, #FFFFFF 100%);
	pointer-events: none;
}

/* Container */
.sfd-checkout-modal__container {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	overflow: hidden;
}

/* Close button */
.sfd-checkout-modal__close {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 999999;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #262626;
	transition: background 0.2s ease, transform 0.2s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sfd-checkout-modal__close:hover {
	background: #ffffff;
	transform: scale(1.1);
}

.sfd-checkout-modal__close svg {
	width: 20px;
	height: 20px;
}

/* Content area - centered with max-width 1440px */
.sfd-checkout-modal__content {
	width: 100%;
	max-width: 1440px;
	height: 100%;
	background: transparent;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	padding: 0;
}

/* Loader */
.sfd-checkout-modal__loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	padding: 60px 20px;
}

.sfd-checkout-modal__spinner {
	width: 50px;
	height: 50px;
	border: 4px solid #f0f0f0;
	border-top-color: #8CD933;
	border-radius: 50%;
	animation: sfd-checkout-spin 0.8s linear infinite;
	margin-bottom: 20px;
}

@keyframes sfd-checkout-spin {
	to { transform: rotate(360deg); }
}

.sfd-checkout-modal__loader p {
	font-family: 'Nunito', sans-serif;
	font-size: 16px;
	color: #646464;
	margin: 0;
}

/* Error state */
.sfd-checkout-modal__error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 400px;
	padding: 60px 20px;
}

.sfd-checkout-modal__error h3 {
	font-family: 'Nunito', sans-serif;
	font-size: 24px;
	font-weight: 700;
	color: #262626;
	margin: 0 0 12px;
}

.sfd-checkout-modal__error p {
	font-family: 'Nunito', sans-serif;
	font-size: 16px;
	color: #646464;
	margin: 0 0 24px;
	max-width: 500px;
}

.sfd-checkout-modal__error a {
	color: #F34188;
	text-decoration: underline;
}

.sfd-checkout-modal__error button {
	margin-top: 12px;
}

/* Override FunnelKit styles inside modal */
.sfd-checkout-modal__content .wfacp_main_form,
.sfd-checkout-modal__content .woocommerce-checkout {
	max-width: none;
	margin: 0;
	padding: 0;
}

/* Make sure modal header doesn't interfere */
.sfd-checkout-modal__content .site-header,
.sfd-checkout-modal__content .sfd-header,
.sfd-checkout-modal__content header {
	display: none !important;
}

/* Hide footer in modal */
.sfd-checkout-modal__content .site-footer,
.sfd-checkout-modal__content .sfd-footer,
.sfd-checkout-modal__content footer {
	display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
	.sfd-checkout-modal__content {
		max-width: 900px;
		padding: 32px;
	}
}

@media (max-width: 768px) {
	.sfd-checkout-modal__container {
		padding: 10px;
	}

	.sfd-checkout-modal__overlay {
		background: #F8F8F8 !important;
	}

	.sfd-checkout-modal__content {
		max-height: calc(100vh - 20px);
		border-radius: 12px;
		padding: 24px;
	}

	.sfd-checkout-modal__close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
	}
}

@media (max-width: 600px) {
	.sfd-checkout-modal__container {
		padding: 0;
	}

	.sfd-checkout-modal__content {
		max-height: 100vh;
		border-radius: 0;
		padding: 20px;
	}

	.sfd-checkout-modal__close {
		position: fixed;
		top: 10px;
		right: 10px;
	}
}
