/* SFS Wallet Payments: Apple Pay / Google Pay and PayPal buttons on checkout and pay pages. */

.sfs-wallet {
	margin: 0 0 20px;
}

.sfs-wallet[hidden],
.sfs-wallet__stripe[hidden],
.sfs-wallet__paypal[hidden],
.sfs-wallet__hint[hidden],
.sfs-wallet__or[hidden],
.sfs-wallet__admin[hidden],
.sfs-wallet__message[hidden] {
	display: none;
}

/* Administrators only: why a button is missing. */
.sfs-wallet__admin {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px dashed #c9a43a;
	border-radius: 8px;
	background: #fffaf0;
	color: #5a4300;
	font-size: 13px;
	line-height: 1.5;
}

.sfs-wallet__admin ul {
	margin: 6px 0 0;
	padding-left: 18px;
}

.sfs-wallet__admin li + li {
	margin-top: 4px;
}

.sfs-wallet__title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #5b6b7b;
}

.sfs-wallet__badge {
	padding: 2px 7px;
	border-radius: 4px;
	background: #fff4d6;
	color: #7a5200;
	font-size: 11px;
	letter-spacing: 0;
	text-transform: none;
}

.sfs-wallet__buttons {
	display: grid;
	gap: 10px;
	transition: opacity 0.2s ease;
}

/* PayPal's iframes stack above sticky headers unless contained. */
.sfs-wallet__paypal {
	position: relative;
	z-index: 0;
	min-height: 48px;
}

.sfs-wallet.is-busy .sfs-wallet__buttons {
	opacity: 0.55;
	pointer-events: none;
}

.sfs-wallet__hint {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: #5b6b7b;
}

.sfs-wallet__message {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #fdecec;
	color: #8a1c1c;
	font-size: 14px;
	line-height: 1.45;
}

.sfs-wallet__message[data-type="info"] {
	background: #eef7fc;
	color: #0d2e4d;
}

.sfs-wallet__or {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 0;
	color: #5b6b7b;
	font-size: 13px;
}

.sfs-wallet__or::before,
.sfs-wallet__or::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #dfe5ea;
}

/* Cart page: under "Proceed to Checkout" in the order summary. */
.sfs-wallet--cart {
	margin: 14px 0 4px;
}

.sfs-wallet--cart .sfs-wallet__or {
	margin: 0 0 12px;
}

.sfs-wallet--cart .sfs-wallet__title {
	margin-bottom: 8px;
}

.checkout-summary-card.sfs-wallet-paying .checkout-pay {
	opacity: 0.55;
	pointer-events: none;
}

/*
 * Product page: an "Express checkout" panel under Add To Cart / Buy Now in the buy box.
 * wallet.js shows only the buttons this device and price can use; they share rows
 * (Apple Pay / Google Pay on its own row, then PayPal, Venmo and Pay Later side by side).
 */
.sfs-wallet--product {
	margin: 16px 0 4px;
	padding: 14px 14px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #f8fafc;
}

.sfs-wallet__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 10px;
	margin: 0 0 10px;
}

.sfs-wallet__heading {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: #1e293b;
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
}

.sfs-wallet__heading svg {
	flex: 0 0 auto;
	color: #f59e0b;
}

.sfs-wallet--product .sfs-wallet__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sfs-wallet--product .sfs-wallet__stripe {
	flex: 1 1 100%;
	min-width: 0;
}

/* One PayPal button each (PayPal, Venmo, Pay Later): two or three to a row, the last one
   fills its row. PayPal's iframes stack above sticky headers unless contained. */
.sfs-wallet__pp {
	position: relative;
	z-index: 0;
	flex: 1 1 150px; /* PayPal never draws a button narrower than 150px. */
	min-width: 0;
	min-height: 44px;
	line-height: 0; /* PayPal's wrapper is inline-block: no gap under the button. */
}

.sfs-wallet__pp[hidden],
.sfs-wallet__skeleton[hidden],
.sfs-wallet__hint--wait[hidden] {
	display: none;
}

/* Placeholder bars while Stripe and PayPal load. */
.sfs-wallet__skeleton {
	display: flex;
	flex: 1 1 100%;
	gap: 8px;
}

.sfs-wallet__skeleton span {
	flex: 1 1 0;
	height: 44px;
	border-radius: 6px;
	background: linear-gradient(90deg, #e8edf2 25%, #f3f6f9 50%, #e8edf2 75%);
	background-size: 300% 100%;
	animation: sfs-wallet-shimmer 1.3s ease-in-out infinite;
}

@keyframes sfs-wallet-shimmer {
	from {
		background-position: 100% 0;
	}

	to {
		background-position: 0 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sfs-wallet__skeleton span {
		animation: none;
	}
}

/* No price yet: buttons look paused but still answer a tap with what to fill in. */
.sfs-wallet--product.is-waiting .sfs-wallet__buttons {
	opacity: 0.5;
	filter: saturate(0.5);
}

.sfs-wallet--product .sfs-wallet__hint {
	margin-top: 10px;
	color: #475569;
	font-size: 12.5px;
}

.sfs-wallet--product .sfs-wallet__message {
	margin: 10px 0 0;
}

.sfs-wallet--product .sfs-wallet__admin {
	margin-top: 10px;
}

form.sfs-wallet-paying .add-to-cart-btn {
	opacity: 0.55;
	pointer-events: none;
}

/* "Your address and shipping speed come from your wallet." with a padlock. */
.sfs-wallet__hint--lock {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	margin-top: 10px;
	font-size: 12.5px;
}

.sfs-wallet__hint--lock svg {
	flex: 0 0 auto;
	margin-top: 2px;
	color: #1e7d32;
}

@media (max-width: 575px) {
	/* Slim sides so two 150px PayPal buttons still share a row on a 375px phone. */
	.sfs-wallet--product {
		margin-top: 14px;
		padding: 12px 10px 10px;
	}

	.sfs-wallet--product .sfs-wallet__buttons {
		gap: 6px;
	}

	.sfs-wallet--product .sfs-wallet__head,
	.sfs-wallet--product .sfs-wallet__hint {
		padding: 0 2px;
	}

	.sfs-wallet__hint--lock {
		font-size: 12px;
	}
}

/* Pay pages: the fieldset legend sits right above the buttons. */
.wpt-payform .sfs-wallet {
	margin-top: 4px;
}
