/* =====================================================================
   MPW Cart page — fix + redesign (2026-09-24)
   Loaded only on the Cart page (see functions.php).
   Complements the server "mpw-cw" cart wrapper CSS.

   FIX A (2026-09-24): Kadence's float CSS at >=1025px sets
       form{width:70%} and .cart-collaterals{width:30%},
   which crushes the 2-col grid items (form ~494px instead of
   ~706px, and the totals card down to ~102px — its inner table
   then spills out of the rounded card). These rules neutralise
   those float widths so the items fill their grid tracks.

   FIX B (2026-09-24): Kadence's clearfix on the same wrapper
   (`.kadence-woo-cart-form-wrap::before/::after{content:" ";display:table}`)
   generates phantom BOXES which become grid items once the wrapper is
   `display:grid` ("mpw-cw"). The `::before` box occupies row-1/col-1
   and pushes the products form down into row 2 — so the totals sit on
   top-right while the items list drops below-left (left/right sections
   are no longer inline/level on desktop). Neutralised with content:none.
   ===================================================================== */

/* ---------- FIX: desktop grid items fill their tracks + stay level ---------- */
/* FIX B: kill the clearfix pseudo-elements so they stop being grid items. */
body.woocommerce-cart .kadence-woo-cart-form-wrap::before,
body.woocommerce-cart .kadence-woo-cart-form-wrap::after {
  content: none !important;
}
@media screen and (min-width: 1025px) {
  body.woocommerce-cart .kadence-woo-cart-form-wrap > form.woocommerce-cart-form,
  body.woocommerce-cart .kadence-woo-cart-form-wrap .cart-collaterals {
    width: 100% !important;
    float: none !important;
    padding-right: 0;
    margin-right: 0;
  }
}

/* ---------- tablet: single column until there is room for 340px sidebar ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
  body.woocommerce-cart .kadence-woo-cart-form-wrap { display: block !important; }
  body.woocommerce-cart .woocommerce-cart-form { margin-bottom: 26px; }
  body.woocommerce-cart .cart-collaterals .cart_totals { max-width: 560px; }

  body.woocommerce-cart .kadence-woo-cart-form-wrap > form.woocommerce-cart-form,
  body.woocommerce-cart .kadence-woo-cart-form-wrap .cart-collaterals {
    width: 100% !important;
    float: none !important;
    padding-right: 0;
  }
}

/* ---------- cart page frame ---------- */
body.woocommerce-cart.mpw-cw .content-container { max-width: 1180px; }
body.woocommerce-cart .cart-summary { margin: 6px 0 14px; }
body.woocommerce-cart .cart-summary h2 { padding-bottom: 8px; border-bottom: 1px solid #f0e7c9; }

/* ---------- FREE shipping progress banner (top of totals card) ---------- */
body.woocommerce-cart .mpw-fs-progress {
  margin: 0;
  padding: 14px 18px 16px;
  background: linear-gradient(135deg, #fff8e3, #fff);
  border-bottom: 1px solid #f0e7c9;
}
body.woocommerce-cart .mpw-fs-progress .mpw-fs-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #7a5c00;
  margin: 0 0 10px;
  line-height: 1.35;
}
body.woocommerce-cart .mpw-fs-progress .mpw-fs-amt { color: #8a6100; white-space: nowrap; }
body.woocommerce-cart .mpw-fs-progress .mpw-fs-track {
  height: 8px;
  border-radius: 999px;
  background: #f0e7c9;
  overflow: hidden;
}
body.woocommerce-cart .mpw-fs-progress .mpw-fs-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #facf39, #f5a800);
  transition: width .35s ease;
}
body.woocommerce-cart .mpw-fs-progress .mpw-fs-note {
  margin: 9px 2px 0;
  font-size: 12px;
  line-height: 1.55;
  color: #8a8062;
}
body.woocommerce-cart .mpw-fs-progress.mpw-fs-done .mpw-fs-note { color: #2e7d32; font-weight: 700; }

/* ---------- trust strip (below checkout button) ---------- */
body.woocommerce-cart .mpw-cart-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 14px;
  row-gap: 6px;
  padding: 12px 18px 2px;
  border-top: 1px dashed #f0e7c9;
}
body.woocommerce-cart .mpw-cart-trust span { font-size: 11.5px; font-weight: 600; color: #8a8062; }

/* ---------- continue shopping ---------- */
body.woocommerce-cart .mpw-cart-back {
  display: block;
  text-align: center;
  padding: 10px 18px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: #8a6100;
  text-decoration: none;
}
body.woocommerce-cart .mpw-cart-back:hover { color: #3c2c00; }

/* ---------- qty steppers in cart (buttons injected by child JS) ---------- */
body.woocommerce-cart table.cart td.product-quantity .quantity .minus,
body.woocommerce-cart table.cart td.product-quantity .quantity .plus {
  width: 34px;
  height: 34px;
  border: 0;
  background: #faf8f0;
  color: #7a735b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}
body.woocommerce-cart table.cart td.product-quantity .quantity .minus:hover,
body.woocommerce-cart table.cart td.product-quantity .quantity .plus:hover { background: #f0e7c9; color: #8a6100; }

/* ---------- mobile polish ---------- */
@media (max-width: 767px) {
  body.woocommerce-cart table.cart tbody tr { padding: 10px 14px 14px; }
  body.woocommerce-cart table.cart td.product-thumbnail img { width: 86px; height: 86px; }
  body.woocommerce-cart table.cart td.product-name a { font-size: 15px; }
  body.woocommerce-cart .mpw-fs-progress { padding: 12px 16px 14px; }
  body.woocommerce-cart .mpw-cart-trust { justify-content: flex-start; padding: 12px 16px 2px; }
  body.woocommerce-cart .mpw-cart-back { padding: 10px 16px 14px; }
}