/* Express payment buttons on the product page: one group under "Aggiungi al carrello".
   Only the frame is ours (spacing, equal height, radius); the artwork inside PayPal, Google Pay
   and Apple Pay buttons comes from their SDKs and is not touched. */

.dsf-express {
	--dsf-x-h: 48px;
	display: grid;
	gap: 10px;
	margin: 4px 0 0;
	min-width: 0;
	font-family: var(--dsf-f-body);
}
.dsf-express *,
.dsf-express *::before,
.dsf-express *::after { box-sizing: border-box; }

body .dsf-express .dsf-express__l {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 2px 0 0;
	padding: 0;
	color: var(--dsf-muted);
	font-family: var(--dsf-f-mono);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: .12em;
	line-height: 1.4;
	text-transform: uppercase;
}
.dsf-express__l::before,
.dsf-express__l::after { content: ""; flex: 1; height: 1px; background: var(--dsf-border); }

.dsf-express__list { display: grid; gap: 8px; min-width: 0; }

/* PayPal / Google Pay / Apple Pay rows printed by the PayPal plugin.
   One flat list: the plugin's wrappers are dissolved so every button, Satispay included, is a direct
   grid item of .dsf-express__list and the gap between any two visible buttons is the same. */
.dsf-express .wc-ppcp-product-payments__container,
.dsf-express ul.wc-ppcp-product-payment__methods { display: contents; }
.dsf-express ul.wc-ppcp-product-payment__methods > li {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	border: 0;
	list-style: none;
	min-width: 0;
}
.dsf-express ul.wc-ppcp-product-payment__methods > li::before,
.dsf-express ul.wc-ppcp-product-payment__methods > li::after { content: none; }
.dsf-express ul.wc-ppcp-product-payment__methods > li[hidden],
.dsf-express ul.wc-ppcp-product-payment__methods > li[style*="display: none"] { display: none; }
.dsf-express .wc-ppcp-product-button-container,
.dsf-express .wc-ppcp_googlepay-product-button-container,
.dsf-express .wc-ppcp_applepay-product-button-container { display: grid; gap: 8px; margin: 0; min-width: 0; }
.dsf-express .wc-ppcp-product-button-container > *,
.dsf-express .wc-ppcp_googlepay-product-button-container > *,
.dsf-express .wc-ppcp_applepay-product-button-container > * { margin-top: 0 !important; margin-bottom: 0 !important; }
/* once the wallets have loaded, a row whose wallet did not draw a button (not available on this
   device) takes no room, so the remaining buttons keep the same gap */
.dsf-express[data-dsf-express-state="ready"] ul.wc-ppcp-product-payment__methods > li:not(:has(iframe, button, a, canvas, apple-pay-button, .dsf-demo)) { display: none; }
/* without JavaScript nothing can load: no empty rows */
.dsf-express:not([data-dsf-express-state]) ul.wc-ppcp-product-payment__methods > li:not(:has(iframe, button, a, canvas, apple-pay-button, .dsf-demo)) { display: none; }

/* neutral placeholders until the visitor shows intent to buy (same size as the real buttons) */
body .dsf-express button.dsf-express__ph {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: var(--dsf-x-h);
	min-height: var(--dsf-x-h);
	margin: 0;
	padding: 0 18px;
	border: 1.5px solid var(--dsf-border);
	border-radius: var(--dsf-pill);
	background: var(--dsf-surface);
	box-shadow: none;
	color: var(--dsf-ink);
	font-family: var(--dsf-f-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: border-color .2s, background-color .2s;
}
body .dsf-express button.dsf-express__ph:hover { border-color: var(--dsf-mint-dark); background: var(--dsf-mint-soft); color: var(--dsf-ink); }
body .dsf-express button.dsf-express__ph:focus-visible { outline: 3px solid var(--dsf-ink); outline-offset: 2px; }
body .dsf-express button.dsf-express__ph.is-loading { color: var(--dsf-muted); cursor: progress; }
body .dsf-express button.dsf-express__ph.is-loading::before {
	content: "";
	width: 16px;
	height: 16px;
	border: 2px solid var(--dsf-border);
	border-top-color: var(--dsf-mint-ink);
	border-radius: 50%;
	animation: dsf-x-spin .7s linear infinite;
}
@keyframes dsf-x-spin { to { transform: rotate(360deg); } }
/* while a placeholder is there, the (still empty) SDK container under it takes no room */
.dsf-express li:has(> .dsf-express__ph) > div:empty { display: none; }
/* status ("Caricamento di PayPal…", "Pronto: premi di nuovo PayPal per pagare.") takes the place of the
   "alla cassa" line while it has something to say: same size, so the box does not move */
body .dsf-express .dsf-express__status { margin: 0; padding: 0; color: var(--dsf-mint-ink); font-size: 13.5px; font-weight: 600; line-height: 1.45; text-align: center; }
/* kept in the page (a live region must exist before it speaks), out of the layout while silent */
body .dsf-express:not([data-dsf-express-said]) .dsf-express__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dsf-express { position: relative; }
body .dsf-express[data-dsf-express-said] .dsf-express__more { display: none; }

/* Satispay link (mu-plugin): same height and pill radius as the wallets; brand colour and logo untouched */
body .dsf-express a.dbo-satispay-express {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: var(--dsf-x-h);
	margin: 0;
	padding: 0 18px;
	border-radius: var(--dsf-pill);
	font-family: var(--dsf-f-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	transition: transform .15s;
}
body .dsf-express a.dbo-satispay-express:active { transform: scale(.99); }
body .dsf-express a.dbo-satispay-express:focus-visible { outline: 3px solid var(--dsf-ink); outline-offset: 2px; }

body .dsf-express .dsf-express__more {
	margin: 0;
	padding: 0;
	color: var(--dsf-muted);
	font-size: 13.5px;
	line-height: 1.45;
	text-align: center;
}

/* staging preview stand-ins (?dsf_express_demo=1) */
.dsf-demo {
	display: grid;
	place-items: center;
	min-height: var(--dsf-x-h);
	border-radius: var(--dsf-pill);
	font-size: 14px;
	font-weight: 600;
}
.dsf-demo--paypal { background: #FFC439; color: #111; }
.dsf-demo--dark { background: #000; color: #fff; }

@media (prefers-reduced-motion: reduce) {
	body .dsf-express a.dbo-satispay-express { transition: none; }
}

body .dsf-express .dsf-express__legal { margin: -4px 0 0; padding: 0; color: var(--dsf-muted); font-size: 12.5px; line-height: 1.45; text-align: center; }
body .dsf-express .dsf-express__legal a { color: var(--dsf-mint-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
body .dsf-express .dsf-express__legal a:focus-visible { outline: 3px solid var(--dsf-ink); outline-offset: 2px; }

/* ---------- notes: closure, pre-order, items already in the cart ---------- */
.dsf-express__closure > p { margin: 0; }
body .dsf-express .dsf-express__note {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid var(--dsf-warn-line);
	border-radius: 10px;
	background: var(--dsf-warn-bg);
	color: var(--dsf-warn);
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
}
body .dsf-express .dsf-express__note[hidden] { display: none; }
body .dsf-express .dsf-express__note .dsf-ic { width: 18px; height: 18px; margin-top: 1px; }
body .dsf-express .dsf-express__note strong { font-weight: 600; }
body .dsf-express .dsf-express__note--cart { border-color: var(--dsf-border); background: var(--dsf-mint-soft); color: var(--dsf-ink); }
body .dsf-express .dsf-express__note--cart .dsf-ic { color: var(--dsf-mint-ink); }

/* Satispay link: text in the off-white of Satispay's own button artwork (#FFFBEF on #FF3D00) */
body .dsf-express a.dbo-satispay-express,
body .dsf-express a.dbo-satispay-express:hover,
body .dsf-express a.dbo-satispay-express span { color: #FFFBEF !important; }

@media (prefers-reduced-motion: reduce) {
	body .dsf-express button.dsf-express__ph.is-loading::before { animation-duration: 2s; }
}

/* PayPal "Paga in 3 rate" under the price (filled by express.js with Marketing consent) */
.dsf-paylater { margin: 6px 0 0; min-height: 0; }
.dsf-paylater:empty { display: none; }
