/**
 * WTE Moneris Checkout - Modal styles.
 */
.wte-moneris-modal {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 99999;
}
.wte-moneris-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
}
.wte-moneris-modal__dialog {
	position: relative;
	max-width: 760px;
	width: calc( 100% - 32px );
	max-height: calc( 100vh - 64px );
	margin: 32px auto;
	background: #fff;
	border-radius: 8px;
	overflow: auto;
	box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.25 );
	padding: 16px;
	box-sizing: border-box;
}
.wte-moneris-modal__close {
	position: absolute;
	top: 8px;
	right: 8px;
	background: transparent;
	border: 0;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	color: #555;
	z-index: 2;
}
.wte-moneris-modal__close:hover { color: #000; }

#monerisCheckout {
	min-height: 480px;
	width: 100%;
}

/* Force Moneris's injected iframe to use the full container width and a
   real minimum height. Without these overrides, Moneris's script sizes
   the iframe to ~600x60 initially and the form looks "broken" on mobile
   because only the logo header is visible. */
#monerisCheckout iframe {
	width: 100% !important;
	min-width: 0 !important;
	max-width: 100% !important;
	min-height: 600px !important;
	border: 0;
	display: block;
}

body.wte-moneris-open {
	overflow: hidden;
}

/* Mobile (≤640px): turn the modal into a full-screen sheet. Edge-to-edge,
   no margin, no border-radius. The iframe gets the entire viewport
   minus space for the close button. */
@media ( max-width: 640px ) {
	.wte-moneris-modal__dialog {
		position: absolute;
		inset: 0;
		width: 100%;
		max-width: 100%;
		max-height: 100%;
		margin: 0;
		padding: 12px 6px 6px;
		border-radius: 0;
	}
	.wte-moneris-modal__close {
		top: 4px;
		right: 4px;
		font-size: 28px;
		padding: 8px 12px;
	}
	#monerisCheckout {
		min-height: calc( 100vh - 60px );
	}
	#monerisCheckout iframe {
		min-height: calc( 100vh - 60px ) !important;
	}
}

/* Spinner */
.wte-moneris-spinner {
	display: inline-block;
	width: 36px;
	height: 36px;
	border: 4px solid #eee;
	border-top-color: #c61c26;
	border-radius: 50%;
	animation: wte-moneris-spin 0.9s linear infinite;
}
@keyframes wte-moneris-spin {
	to { transform: rotate( 360deg ); }
}
