.vistapay-wallets {
	margin: 0 0 18px;
	padding: 0;
}

.vistapay-wallets-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	margin: 0 0 4px;
}

/* Fixed columns — prevent Google Pay (or theme) from stretching the flex item */
.vistapay-wallets-row .vistapay-apple-pay-wrap,
.vistapay-wallets-row .vistapay-google-pay-wrap {
	flex: 0 0 180px;
	width: 180px;
	min-width: 180px;
	max-width: 180px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.vistapay-wallets-row .vistapay-google-pay-wrap {
	/* Clip wide Google Pay paint (Chrome) without restyling APM internals via JS */
	overflow: hidden;
}

.vistapay-apple-pay-wrap {
	margin: 0 0 18px;
	padding: 0;
	box-sizing: border-box;
}

.vistapay-apple-pay-wrap.is-unavailable,
.vistapay-apple-pay-wrap[hidden] {
	display: none !important;
}

.vistapay-apple-pay-button {
	width: 180px;
	max-width: 180px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	/* Do not use overflow:hidden / fixed height — clips <apple-pay-button> on iOS Safari */
	overflow: visible;
	box-sizing: border-box;
}

.vistapay-apple-pay-button .vistapay-apay-mount,
.vistapay-apple-pay-button [data-vistapay-wallet-mount] {
	display: block;
	width: 180px;
	max-width: 180px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.vistapay-apple-pay-button apple-pay-button,
.vistapay-apple-pay-button #encoded-apms-applePayButton {
	display: block;
	-webkit-appearance: -apple-pay-button;
	appearance: -apple-pay-button;
	width: 180px;
	max-width: 180px;
	min-height: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	--apple-pay-button-width: 180px;
	--apple-pay-button-height: 36px;
	--apple-pay-button-border-radius: 4px;
}

.vistapay-apple-pay-status {
	display: block;
	width: 100%;
	max-width: 180px;
	margin: 6px 0 0;
	padding: 0;
	font-size: 12px;
	color: #6b7280;
	min-height: 18px;
	line-height: 1.3;
	text-align: left;
	box-sizing: border-box;
}

.vistapay-wallets-or,
.vistapay-apple-pay-or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 10px 0 14px;
	font-size: 12px;
	color: #9ca3af;
	text-align: center;
	line-height: 1.4;
}

.vistapay-wallets-or::before,
.vistapay-wallets-or::after,
.vistapay-apple-pay-or::before,
.vistapay-apple-pay-or::after {
	content: "";
	flex: 1 1 0;
	height: 1px;
	background: #e5e7eb;
}

.payment_method_vistapay .vistapay-wallets + .vistapay-one-time-form,
.payment_method_vistapay .vistapay-wallets + p {
	margin-top: 0;
}

@media (max-width: 768px) {
	.vistapay-wallets-row {
		flex-direction: column;
		align-items: center;
	}

	.vistapay-wallets-row .vistapay-apple-pay-wrap,
	.vistapay-wallets-row .vistapay-google-pay-wrap {
		flex: 0 0 auto;
		width: 100%;
		min-width: 0;
		max-width: 100%;
		overflow: visible;
	}

	/* Mobile (Android/iPhone): center Apple Pay under Google Pay */
	.vistapay-apple-pay-wrap {
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		text-align: center !important;
		box-sizing: border-box !important;
	}

	.vistapay-apple-pay-button,
	.vistapay-apple-pay-button.vistapay-apple-pay-button,
	.vistapay-apple-pay-button .vistapay-apay-mount,
	.vistapay-apple-pay-button [data-vistapay-wallet-mount],
	#vistapay-apple-pay-button {
		display: flex !important;
		justify-content: center !important;
		align-items: center !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
		margin: 0 auto !important;
		padding: 0 !important;
		box-sizing: border-box !important;
		text-align: center !important;
	}

	.vistapay-apple-pay-button > *,
	#vistapay-apple-pay-button > *,
	.vistapay-apple-pay-button apple-pay-button,
	.vistapay-apple-pay-button #encoded-apms-applePayButton,
	.vistapay-apple-pay-button button,
	.vistapay-apple-pay-button iframe,
	.vistapay-apple-pay-button [role="button"],
	.vistapay-apple-pay-button div {
		margin-left: auto !important;
		margin-right: auto !important;
		float: none !important;
		left: auto !important;
		right: auto !important;
		transform: none !important;
		position: relative !important;
	}

	.vistapay-apple-pay-button apple-pay-button,
	.vistapay-apple-pay-button #encoded-apms-applePayButton {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		--apple-pay-button-width: 100%;
	}

	.vistapay-apple-pay-status {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
		text-align: center !important;
	}
}
