/* =========================================================================
   Mahjong Minted - cart page
   -------------------------------------------------------------------------
   Two things are fixed here, both inside .wc-proceed-to-checkout:

   1. The checkout call to action is moved to the top of the block and given
      the same full-width pink pill as Add to Cart, so it reads as the primary
      action rather than as one option among five.
   2. GoDaddy Payments' wallet buttons are suppressed. The store runs two
      independent express checkout systems (see README), so Apple Pay and
      Google Pay were each rendering twice.

   Enfold ships its shop CSS with high specificity and a #top prefix, so the
   overrides here match that convention rather than reaching for !important.
   Colour tokens come from style.css.
   ========================================================================= */


/* -------------------------------------------------------------------------
   1. Order of the block
   -------------------------------------------------------------------------
   WooCommerce, WooPayments and GoDaddy Payments each hook their own markup
   onto woocommerce_proceed_to_checkout, and the priorities they chose put the
   actual "Proceed to checkout" link third - under the BNPL message and under
   a wallet button. Reordering in PHP would mean re-hooking three plugins'
   callbacks and re-doing it whenever one of them changes priority; a flex
   container reorders them without touching any of them.

   Flex also drops the float Enfold puts on .checkout-button, which is what
   pulled the button to the left of the column.
   ---------------------------------------------------------------------- */

#top .cart_totals .wc-proceed-to-checkout {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 14px;
	text-align: center;
}

#top .cart_totals .wc-proceed-to-checkout > .checkout-button {
	order: 1;
}

/* Klarna / Affirm / Afterpay messaging. */
#top .cart_totals .wc-proceed-to-checkout > #payment-method-message {
	order: 2;
}

/* WooPay / Google Pay / Apple Pay / Amazon Pay. */
#top .cart_totals .wc-proceed-to-checkout > .wcpay-express-checkout-wrapper {
	order: 3;
}


/* -------------------------------------------------------------------------
   2. The call to action
   -------------------------------------------------------------------------
   Matches the Add to Cart pill on the product page, so the two primary
   actions in the purchase flow look like the same button.
   ---------------------------------------------------------------------- */

#top .cart_totals .wc-proceed-to-checkout > .checkout-button {
	display: block;
	float: none;
	width: 100%;
	margin: 0;
	padding: 17px 24px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .04em;
	text-align: center;
	border: 1px solid var(--mm-pink);
	border-radius: 40px;
	background: var(--mm-pink);
	color: #fff;
	transition: background-color .18s ease, border-color .18s ease;
}

#top .cart_totals .wc-proceed-to-checkout > .checkout-button:hover,
#top .cart_totals .wc-proceed-to-checkout > .checkout-button:focus {
	background: var(--mm-pink-dark);
	border-color: var(--mm-pink-dark);
	color: #fff;
}


/* -------------------------------------------------------------------------
   3. Suppress the duplicate wallet buttons
   -------------------------------------------------------------------------
   GoDaddy's mu-plugin (mu-plugins/vendor/godaddy/mwc-core) renders its own
   Apple Pay / Google Pay row plus an "- or -" divider. WooPayments' express
   checkout element already offers both of those wallets, so whichever one the
   browser supports was drawn twice: Google Pay in Chrome, Apple Pay in Safari.

   The elements carry an inline style="display: block" written by
   wallets-frontend.js, so !important is unavoidable here.

   Hidden rather than unhooked on purpose: the buttons are printed by a
   must-use plugin that is only present on production, and its inline
   initialiser (window.mwc_payments_wallets_handler = new
   MWCPaymentsWalletsHandler(...)) is emitted separately from the script
   handle. Dequeuing the script would leave that initialiser calling a
   constructor that no longer exists. The supported fix is to turn the wallets
   off under WooCommerce -> Settings -> Payments -> GoDaddy Payments; this rule
   is the theme-side guarantee, and is harmless once that is done.
   ---------------------------------------------------------------------- */

#top .cart_totals .mwc-external-checkout-buttons,
#top .cart_totals .mwc-external-checkout-buttons-divider {
	display: none !important;
}


/* -------------------------------------------------------------------------
   4. BNPL message height
   -------------------------------------------------------------------------
   WooPayments sizes this element with height: var(--wc-bnpl-height), but only
   ever sets that custom property on the block cart. On the classic cart the
   variable is never defined, the declaration is invalid at computed-value
   time, and the element inherits a height of roughly 17px while the Stripe
   iframe inside it is 46px - so the message overflowed onto whatever followed
   it. It overlapped the checkout button before the reorder above, and would
   overlap the wallet buttons after it.
   ---------------------------------------------------------------------- */

#top .cart_totals .wc-proceed-to-checkout > #payment-method-message {
	height: auto;
	margin: 0;
	padding: 0;
}
