/**
 * WooCommerce checkout layout — responsive (classic shortcode checkout).
 * Loaded on checkout when Mallxpay is enabled; helps all merchant themes.
 */

.woocommerce-checkout .mallxpay-checkout-wrap {
	box-sizing: border-box;
}

/* ----- Desktop: billing left, order + payment right ----- */
@media (min-width: 992px) {
	form.checkout.woocommerce-checkout {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		column-gap: 48px;
		row-gap: 16px;
		align-items: start;
		max-width: 1180px;
		margin-left: auto;
		margin-right: auto;
	}

	form.checkout.woocommerce-checkout #customer_details {
		grid-column: 1;
		grid-row: 1 / span 20;
	}

	form.checkout.woocommerce-checkout #order_review_heading {
		grid-column: 2;
		grid-row: 1;
		margin-top: 0;
	}

	form.checkout.woocommerce-checkout #order_review {
		grid-column: 2;
		grid-row: 2;
		position: sticky;
		top: 24px;
	}

	form.checkout.woocommerce-checkout .col2-set {
		display: block;
		width: 100%;
	}

	form.checkout.woocommerce-checkout .col2-set .col-1,
	form.checkout.woocommerce-checkout .col2-set .col-2 {
		width: 100%;
		float: none;
	}
}

/* ----- Tablet & mobile: single column stack ----- */
@media (max-width: 991px) {
	form.checkout.woocommerce-checkout {
		display: flex;
		flex-direction: column;
		gap: 24px;
	}

	form.checkout.woocommerce-checkout #customer_details,
	form.checkout.woocommerce-checkout #order_review_heading,
	form.checkout.woocommerce-checkout #order_review {
		width: 100%;
		float: none;
	}

	form.checkout.woocommerce-checkout .col2-set .col-1,
	form.checkout.woocommerce-checkout .col2-set .col-2 {
		width: 100%;
		float: none;
		margin-bottom: 24px;
	}

	form.checkout.woocommerce-checkout .form-row-first,
	form.checkout.woocommerce-checkout .form-row-last {
		width: 100%;
		float: none;
	}

	form.checkout.woocommerce-checkout #order_review {
		position: static;
	}
}

/* ----- Touch-friendly fields (all breakpoints) ----- */
@media (max-width: 991px) {
	.woocommerce-checkout input.input-text,
	.woocommerce-checkout select,
	.woocommerce-checkout textarea,
	.woocommerce-checkout .select2-container .select2-selection {
		min-height: 44px;
		font-size: 16px;
	}

	.woocommerce-checkout textarea {
		min-height: 100px;
	}

	.woocommerce-checkout #place_order {
		width: 100%;
		min-height: 48px;
		font-size: 1rem;
	}

	.woocommerce-checkout table.shop_table {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.woocommerce-checkout #payment ul.payment_methods li {
		padding: 0.75em 0;
	}

	.woocommerce-checkout #payment div.payment_box {
		font-size: 0.95em;
	}
}

/* ----- Narrow phones ----- */
@media (max-width: 480px) {
	form.checkout.woocommerce-checkout {
		gap: 20px;
	}

	.woocommerce-checkout h3 {
		font-size: 1.15rem;
	}

	.woocommerce-checkout .woocommerce-info,
	.woocommerce-checkout .woocommerce-message {
		font-size: 0.9rem;
	}
}

.mallxpay-pseudo-embedded { margin-top: 12px; }
.mallxpay-pseudo-lead { margin: 0 0 12px; color: #475569; font-size: 0.92rem; line-height: 1.5; }
.mallxpay-antom-card-element {
	min-height: 220px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #fcfcfd;
	padding: 12px;
}
.mallxpay-sdk-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; color: #64748b; gap: 10px; }
.mallxpay-sdk-loading .spinner {
	width: 22px; height: 22px; border: 2px solid #e2e8f0; border-top-color: #059669; border-radius: 50%;
	animation: mallxpay-spin 0.8s linear infinite;
}
.mallxpay-sdk-status { margin-top: 10px; font-size: 0.86rem; line-height: 1.45; }
.mallxpay-sdk-status.pending { color: #64748b; }
.mallxpay-sdk-status.processing { color: #1d4ed8; }
.mallxpay-sdk-status.ready { color: #15803d; }
.mallxpay-sdk-status.failed { color: #b91c1d; }
@keyframes mallxpay-spin { to { transform: rotate(360deg); } }

/* ----- Mallxpay In-Page Embed Box (FlyPay / MoonPay / Antom) ----- */
.mallxpay-inpage-mount {
	width: 100%;
	box-sizing: border-box;
}
.mallxpay-inpage-placeholder {
	width: 100%;
}
.mallxpay-inpage-frame-box {
	position: relative;
	min-height: 320px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #ffffff;
	padding: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	box-sizing: border-box;
	transition: all 0.3s ease;
}
.mallxpay-inpage-mount--eager .mallxpay-inpage-frame-box {
	min-height: 0;
	border: 0;
	box-shadow: none;
	padding: 0;
}
.mallxpay-inpage-mount--eager .mallxpay-inpage-frame-box.mallxpay-inpage-frame-box--ready {
	min-height: 320px;
	border: 1px solid #e2e8f0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	padding: 12px;
}
.mallxpay-inpage-preparing {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 10px 12px;
	margin: 4px 0 8px;
	color: #64748b;
	font-size: 0.9rem;
	line-height: 1.4;
}
.mallxpay-inpage-preparing.is-hidden {
	display: none;
}
.mallxpay-inpage-preparing--failed {
	color: #b91c1c;
}
.mallxpay-inpage-spinner--sm {
	width: 18px;
	height: 18px;
	border-width: 2px;
}
.mallxpay-inpage-frame-box iframe {
	width: 100% !important;
	min-height: 320px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: #ffffff !important;
	display: block !important;
}
.mallxpay-inpage-loading {
	position: absolute;
	inset: 0;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	color: #475569;
	font-size: 0.95rem;
	font-weight: 500;
	z-index: 20;
}
.mallxpay-inpage-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: mallxpay-spin 0.8s linear infinite;
}
.mallxpay-inpage-status {
	margin-top: 12px;
	padding: 10px 16px;
	border-radius: 8px;
	font-size: 0.9rem;
	text-align: center;
	font-weight: 500;
}
.mallxpay-inpage-status.processing { background: #eff6ff; color: #1d4ed8; }
.mallxpay-inpage-status.failed { background: #fef2f2; color: #b91c1c; }
.mallxpay-inpage-status.success { background: #f0fdf4; color: #166534; }

