/**
 * TI Wishlist Variation Popup - front-end styles.
 *
 * Scoped entirely under .tiwvp- prefixed selectors so nothing here can
 * leak into or clash with Woodmart theme styles or other plugin CSS.
 */

.tiwvp-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba( 0, 0, 0, 0.6 );
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tiwvp-popup-overlay.tiwvp-is-open {
	display: flex;
	opacity: 1;
}

.tiwvp-popup {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.3 );
	padding: 32px;
	transform: translateY(16px) scale(0.98);
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.tiwvp-popup-overlay.tiwvp-is-open .tiwvp-popup {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.tiwvp-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border: none;
	background: transparent;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #333;
	z-index: 2;
}

.tiwvp-popup-close:hover {
	color: #000;
}

.tiwvp-popup-loading {
	display: none;
	align-items: center;
	justify-content: center;
	padding: 60px 0;
}

.tiwvp-popup-loading.tiwvp-is-visible {
	display: flex;
}

.tiwvp-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #e2e2e2;
	border-top-color: #333;
	border-radius: 50%;
	animation: tiwvp-spin 0.7s linear infinite;
}

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

.tiwvp-popup-body {
	display: none;
}

.tiwvp-popup-body.tiwvp-is-visible {
	display: block;
}

.tiwvp-popup-header {
	display: flex;
	gap: 20px;
	margin-bottom: 20px;
}

.tiwvp-popup-image {
	flex: 0 0 120px;
	max-width: 120px;
}

.tiwvp-popup-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	display: block;
}

.tiwvp-popup-summary {
	flex: 1 1 auto;
	min-width: 0;
}

.tiwvp-popup-title {
	margin: 0 0 8px;
	font-size: 18px;
	line-height: 1.3;
}

.tiwvp-popup-price {
	margin: 0 0 8px;
	font-size: 16px;
}

.tiwvp-popup-stock {
	margin: 0;
	font-size: 13px;
}

.tiwvp-popup-error {
	display: none;
	background: #fdecea;
	color: #611a15;
	border: 1px solid #f5c2c0;
	border-radius: 4px;
	padding: 10px 14px;
	margin-bottom: 16px;
	font-size: 13px;
}

.tiwvp-popup-error.tiwvp-is-visible {
	display: block;
}

/* Let WooCommerce's own variation form styles/theme overrides (Woodmart
   swatches included) render as-is; we only add light spacing so the form
   sits comfortably inside the modal. */
.tiwvp-popup-body .variations_form {
	margin: 0;
}

.tiwvp-popup-body table.variations {
	width: 100%;
	margin-bottom: 16px;
}

.tiwvp-popup-body .single_variation_wrap {
	margin-top: 16px;
}

@media ( max-width: 480px ) {
	.tiwvp-popup {
		padding: 20px;
	}

	.tiwvp-popup-header {
		flex-direction: column;
	}

	.tiwvp-popup-image {
		max-width: 100%;
		flex: none;
	}
}
