/**
 * Modilo Web-to-Print storefront styles.
 *
 * Deliberately minimal: the personalizer lives inside an iframe with its own
 * styling, so the theme's product layout stays in charge of everything around it.
 */

.modilo-hidden {
	display: none !important;
	visibility: hidden !important;
}

/*
 * Variable products still need their native attribute selectors. Modilo owns
 * the actual purchase button, so WooCommerce's duplicate price/quantity/cart
 * wrapper stays hidden while color, size and other options remain theme-native.
 */
.modilo-variation-controls .single_variation_wrap {
	display: none !important;
}

.modilo-preview-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	background: #ffffff;
	overflow: hidden;
	float: none;
	clear: both;
	flex: 1 1 100%;
	grid-column: 1 / -1;
}

.modilo-preview-wrap--pending {
	position: absolute;
	inset: 0 0 auto;
	opacity: 0;
	pointer-events: none;
}

/*
 * The original gallery remains the layout anchor. Its classes carry the
 * active theme's column, float, grid and responsive rules, so only its native
 * children are hidden after the Modilo preview has rendered successfully.
 */
.modilo-gallery--personalizer > :not(.modilo-preview-wrap) {
	display: none !important;
}

.modilo-gallery--personalizer > .modilo-preview-wrap {
	display: block;
	margin-inline: auto;
}

.modilo-editor-wrap {
	position: relative;
	width: 100%;
	min-height: 120px;
	background: #ffffff;
	overflow: hidden;
}

.modilo-frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.modilo-editor-wrap .modilo-frame {
	height: 400px;
}

.modilo-frame--visible {
	opacity: 1;
	pointer-events: auto;
}

.modilo-loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	z-index: 2;
	pointer-events: none;
}

.modilo-spinner {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 3px solid rgba(0, 0, 0, 0.08);
	border-top-color: rgba(0, 0, 0, 0.65);
	animation: modilo-spin 0.8s linear infinite;
}

@keyframes modilo-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.modilo-spinner {
		animation-duration: 3s;
	}

	.modilo-frame {
		transition: none;
	}
}

.modilo-cart-preview {
	max-width: 100%;
	height: auto;
	display: block;
}
