/**
 * Checkout guard styles.
 *
 * 1. Dokan Stripe Express's unfillable Express Checkout slot (always applied).
 * 2. The empty Express Checkout chrome on a pack-only checkout (body-class scoped).
 */

/**
 * 1. Hide Dokan Stripe Express's express payment slot.
 *
 * Dokan registers a Blocks express payment method unconditionally — its
 * `ExpressPaymentMethodsOptions` spreads `canMakePayment: () => true` from the
 * regular payment method — so WooCommerce Blocks always allocates it a slot,
 * even on checkouts where Dokan's own gateway is not available and its
 * `dokan_stripe_express_data` settings are never localized. Its
 * `<ExpressCheckout />` component then bails (no publishable key) and renders
 * nothing, leaving an empty bordered box beside Apple Pay / Google Pay.
 *
 * Applied unconditionally because that slot can never contain anything on this
 * site: on a normal product checkout Dokan's settings are absent, and on a pack
 * checkout the Stripe account's Payment Method Configuration is card-only by
 * design, so its Express Checkout Element has no express methods to offer.
 *
 * ⚠️ The `<li>` itself must be hidden, not its child. WooCommerce Blocks styles
 * `.wc-block-components-express-payment__event-buttons > li` with `min-height:
 * 48px; min-width: 150px; width: 100%`, so hiding the inner div leaves the list
 * item holding open a full-size empty box. Stripe also writes
 * `visibility: hidden` and then `visibility: visible` into the same inline
 * style attribute on that child, so the later declaration wins and the box
 * stays visible — another reason not to rely on the child's own visibility.
 *
 * Targeted by ID, which beats Blocks' class-based rules without `!important`,
 * and cannot affect WooPayments' own Apple Pay / Google Pay slots.
 */
#express-payment-method-dokan_stripe_express_checkout {
	display: none;
}

/**
 * 2. Hide the Express Checkout heading and "Or continue below" rule on a
 * pack-only checkout, where the whole row would otherwise frame empty space.
 *
 * Scoped under the body class so it is inert everywhere else, and on real
 * product checkouts where the row has genuine content.
 */
body[class*="esm-pack-checkout"] {

	& .wc-block-components-express-payment,
	& .wc-block-components-express-payment-continue-rule {
		display: none;
	}
}
