/**
 * Purchase Iframe Widget Styles.
 *
 * @package MEM
 */

/* Container. */
.mem-purchase-iframe {
	position: relative;
	width: 100%;
}

/* Iframe. */
.mem-purchase-iframe__frame {
	display: block;
	width: 100%;
	min-height: 400px;
	border: 0;
	transition: opacity 0.3s ease;
}

/* Loading state. */
.mem-purchase-iframe.is-loading .mem-purchase-iframe__frame {
	opacity: 0;
}

.mem-purchase-iframe.is-loading .mem-purchase-iframe__loader {
	display: flex;
}

/* Loader. */
.mem-purchase-iframe__loader {
	display: none;
	position: absolute;
	inset: 0;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	background: inherit;
	z-index: 1;
}

.mem-purchase-iframe__loader-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	animation: mem-iframe-spin 0.8s linear infinite;
}

.mem-purchase-iframe__loader-text {
	font-size: 0.875rem;
	opacity: 0.7;
}

@keyframes mem-iframe-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Editor Placeholder. */
.mem-purchase-iframe--placeholder {
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f0;
	border: 2px dashed #ccc;
	border-radius: 4px;
}

.mem-purchase-iframe__placeholder {
	text-align: center;
	padding: 2rem;
	color: #666;
}

.mem-purchase-iframe__placeholder .eicon-frame-expand {
	font-size: 48px;
	display: block;
	margin-bottom: 1rem;
	opacity: 0.5;
}

.mem-purchase-iframe__placeholder p {
	margin: 0;
	max-width: 400px;
	line-height: 1.5;
}
