/* =====================================================================
   Enviro Blocks — Cart page layout fixes
   1. The totals card was floated right inside a full-width wrapper,
      leaving a large empty area to its left. Centred instead, at a
      sensible width, under the full-width items table.
   2. The Afterpay instalment message was colliding with the Proceed
      button — stacked flow with proper spacing instead.
   ===================================================================== */

body.woocommerce-cart .cart-collaterals {
  float: none !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
}
body.woocommerce-cart .cart-collaterals .cart_totals {
  float: none !important;
  width: 100% !important;
  max-width: 640px !important;
}

/* Everything inside the totals card flows in order with breathing room */
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 8px 0 0 !important;
  float: none !important;
  clear: both !important;
}
body.woocommerce-cart .cart_totals .wc-proceed-to-checkout > * {
  position: static !important;
  float: none !important;
  margin: 0 !important;
  max-width: 100% !important;
}

/* Afterpay / instalment messaging: its own line, never behind a button */
body.woocommerce-cart .cart_totals afterpay-placement,
body.woocommerce-cart .cart_totals .afterpay-placement,
body.woocommerce-cart .cart_totals [class*="afterpay"],
body.woocommerce-cart .cart_totals [id*="afterpay"] {
  display: block !important;
  position: static !important;
  margin: 0 0 4px !important;
  clear: both !important;
  overflow: visible !important;
}

/* Checkout button spans the card */
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  width: 100% !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

@media (max-width: 700px) {
  body.woocommerce-cart .cart-collaterals .cart_totals { max-width: 100% !important; }
}

/* =====================================================================
   CART CLS — reserve space so auto-update doesn't shift the layout
   The totals refresh via AJAX fragments; giving the totals card and the
   proceed area a min-height stops the 0.16 shift when they re-render.
   ===================================================================== */
body.woocommerce-cart .cart_totals { min-height: 360px; }
body.woocommerce-cart .wc-proceed-to-checkout { min-height: 140px; }
body.woocommerce-cart .ebpp-metres-row th,
body.woocommerce-cart .ebpp-metres-row td { min-height: 24px; }
