/* ==========================================================
   THE POLITICAL RIFT — CART
   Fortune 500 / Museum Grade
   Stable. Clean. Boring (in the best way).
   Goals:
   - Desktop: clean table + totals card
   - Mobile: stacked rows, sticky checkout
   - No coupons UI
   - Update cart button RIGHT aligned
   - Proceed to checkout button RIGHT aligned
   - Shipping row:
       Left column: "Shipping"
       Right column: Top line shows "Flat rate:" (left) + "$5.99" (right)
       Address + change address beneath (right aligned)
   ========================================================== */

/* ---------- Page container ---------- */
body.woocommerce-cart .woocommerce{
  max-width:1120px;
  margin:0 auto;
  padding:28px;
  background:rgba(255,255,255,0.70);
  border:1px solid rgba(0,0,0,0.10);
  border-radius:22px;
  box-shadow:0 18px 60px rgba(0,0,0,0.12);
}

/* Title */
body.woocommerce-cart h1,
body.woocommerce-cart .entry-title{
  font-size:42px;
  font-weight:900;
  margin:10px 0 20px;
}

/* Prevent odd overflow */
body.woocommerce-cart .woocommerce,
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart table.shop_table{
  overflow:hidden;
}

/* ---------- Notices ---------- */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-error{
  border-radius:14px;
  box-shadow:none;
  border:1px solid rgba(0,0,0,0.10);
}

/* ==========================================================
   CART TABLE — DESKTOP (AUTHORITATIVE)
========================================================== */

body.woocommerce-cart table.shop_table{
  width:100% !important;
  border-collapse:collapse;
  table-layout:auto;
  background:transparent;
  border:0 !important;
}

/* Headers */
body.woocommerce-cart table.shop_table thead th{
  font-weight:700;
  opacity:0.65;
  padding:14px 12px;
  border-bottom:1px solid rgba(0,0,0,0.12);
  text-align:left;
  white-space:nowrap;
}

/* Cells */
body.woocommerce-cart table.shop_table td{
  padding:18px 12px;
  vertical-align:middle;
  border-bottom:1px solid rgba(0,0,0,0.08);
}

/* --- COLUMN LOCK (prevents theme weirdness) --- */
body.woocommerce-cart td.product-thumbnail{ width:140px; }
body.woocommerce-cart td.product-name{ width:auto; }
body.woocommerce-cart td.product-price{ width:120px; }
body.woocommerce-cart td.product-quantity{ width:140px; }
body.woocommerce-cart td.product-subtotal{ width:140px; font-weight:800; }

/* Thumbnail */
body.woocommerce-cart td.product-thumbnail img{
  display:block;
  width:120px;
  height:auto;
  border-radius:16px;
  box-shadow:0 14px 36px rgba(0,0,0,0.16);
}

/* Product name */
body.woocommerce-cart td.product-name a{
  font-size:18px;
  font-weight:800;
  text-decoration:none;
  display:block;
  line-height:1.25;
}
body.woocommerce-cart td.product-name a:hover{
  text-decoration:underline;
  text-underline-offset:3px;
}

/* Kill any absolute/flex nonsense from theme inside these cells */
body.woocommerce-cart td.product-name *,
body.woocommerce-cart td.product-thumbnail *{
  position:static !important;
}

/* Prices (clean emphasis) */
body.woocommerce-cart td.product-price,
body.woocommerce-cart td.product-subtotal{
  font-weight:800;
}

/* Quantity */
body.woocommerce-cart .quantity .qty{
  max-width:90px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(0,0,0,0.18);
  background:rgba(255,255,255,0.85);
}

/* Remove button */
body.woocommerce-cart a.remove{ opacity:0.60; border-radius:999px; }
body.woocommerce-cart a.remove:hover{ opacity:1; }

/* Buttons */
body.woocommerce-cart button.button,
body.woocommerce-cart a.button{
  border-radius:16px !important;
  font-weight:800 !important;
  padding:12px 16px !important;
  box-shadow:0 10px 28px rgba(0,0,0,0.12);
}

/* ---------- ACTIONS ROW (Update cart right aligned) ---------- */
body.woocommerce-cart td.actions{
  text-align:right !important;
  padding-top:16px !important;
}
body.woocommerce-cart td.actions .button,
body.woocommerce-cart td.actions button,
body.woocommerce-cart td.actions input[type="submit"]{
  float:none !important;
  display:inline-flex !important;
  justify-content:center;
  align-items:center;
}

/* Ensure Update cart always visible */
body.woocommerce-cart button[name="update_cart"]{
  display:inline-flex !important;
  opacity:1 !important;
  visibility:visible !important;
}

/* ---------- Remove coupon UI ---------- */
body.woocommerce-cart .coupon,
body.woocommerce-cart td.actions .coupon,
body.woocommerce-cart form.woocommerce-cart-form .coupon,
body.woocommerce-cart button[name="apply_coupon"]{
  display:none !important;
}

/* ==========================================================
   CART TOTALS (RECEIPT)
========================================================== */

body.woocommerce-cart .cart-collaterals{
  margin-top:22px;
}

body.woocommerce-cart .cart_totals{
  margin-top:24px;
  padding:20px;
  background:rgba(255,255,255,0.75);
  border:1px solid rgba(0,0,0,0.10);
  border-radius:20px;
  box-shadow:0 14px 44px rgba(0,0,0,0.10);
}

body.woocommerce-cart .cart_totals h2{
  font-size:20px;
  font-weight:900;
  margin:4px 0 10px;
}

body.woocommerce-cart .cart_totals table{
  width:100%;
  border-collapse:collapse;
}

body.woocommerce-cart .cart_totals th,
body.woocommerce-cart .cart_totals td{
  padding:12px 10px !important;
  border-top:1px solid rgba(0,0,0,0.06);
}

body.woocommerce-cart .cart_totals th{
  text-align:left;
  font-weight:800;
  width:42%;
}

body.woocommerce-cart .cart_totals td{
  text-align:right;
}

/* ==========================================================
   SHIPPING (CLEAN & ALIGNED)
   Works best with the PHP filter that outputs:
   <span class="pr-ship-line">
     <span class="pr-ship-name">Flat rate:</span>
     <span class="pr-ship-price">$5.99</span>
   </span>
========================================================== */

/* Clean shipping methods list */
body.woocommerce-cart .cart_totals ul#shipping_method,
body.woocommerce-cart .cart_totals ul#shipping_method li{
  list-style:none !important;
  margin:0 !important;
  padding:0 !important;
}

/* Remove pill styling some themes add */
body.woocommerce-cart .cart_totals ul#shipping_method label{
  background:none !important;
  border:none !important;
  padding:0 !important;
  box-shadow:none !important;
}

/* Hide radios but keep functional */
body.woocommerce-cart .cart_totals ul#shipping_method input[type="radio"]{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* Force the method line to be a full-width row in the right column */
body.woocommerce-cart .cart_totals ul#shipping_method li{
  display:block;
  width:100%;
}

/* Our deterministic line: left words + right price */
body.woocommerce-cart .pr-ship-line{
  display:grid !important;
  grid-template-columns:1fr auto;
  align-items:baseline;
  width:100%;
  column-gap:10px;
}
body.woocommerce-cart .pr-ship-name{
  text-align:left !important;
  justify-self:start;
  font-weight:800;
}
body.woocommerce-cart .pr-ship-price{
  text-align:right !important;
  justify-self:end;
  white-space:nowrap;
  font-weight:900;
}

/* Address line */
body.woocommerce-cart .woocommerce-shipping-destination{
  margin-top:6px;
  font-size:14px;
  opacity:0.85;
  text-align:right;
  line-height:1.35;
}

/* Remove forced <br> stacks if present */
body.woocommerce-cart .woocommerce-shipping-destination br{
  display:none !important;
}

/* Change address link */
body.woocommerce-cart .shipping-calculator-button,
body.woocommerce-cart .woocommerce-shipping-calculator a{
  display:inline-block;
  margin-top:4px;
  font-size:13px;
  font-weight:700;
  opacity:0.70;
  text-decoration:none !important;
  border-bottom:1px solid rgba(0,0,0,0.25);
  padding-bottom:2px;
}
body.woocommerce-cart .shipping-calculator-button:hover,
body.woocommerce-cart .woocommerce-shipping-calculator a:hover{
  opacity:1;
}

/* Total emphasis */
body.woocommerce-cart .order-total th,
body.woocommerce-cart .order-total td{
  font-size:18px;
  font-weight:900;
}

/* ==========================================================
   CHECKOUT BUTTON — RIGHT ALIGNED
========================================================== */

body.woocommerce-cart .wc-proceed-to-checkout{
  text-align:right !important;
  margin-top:12px;
}

body.woocommerce-cart .checkout-button,
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{
  border-radius:18px !important;
  font-weight:900 !important;
  padding:16px 18px !important;
  box-shadow:0 16px 50px rgba(0,0,0,0.18);
  display:inline-flex !important;
  width:auto !important;
  float:none !important;
}

/* ==========================================================
   MOBILE — STACKED & SAFE
========================================================== */

@media (max-width:979px){

  body.woocommerce-cart .woocommerce{
    padding:18px;
  }

  /* Hide cart table headers */
  body.woocommerce-cart table.shop_table thead{
    display:none;
  }

  /* Stack rows */
  body.woocommerce-cart table.shop_table,
  body.woocommerce-cart table.shop_table tbody,
  body.woocommerce-cart table.shop_table tr,
  body.woocommerce-cart table.shop_table td{
    display:block;
    width:100%;
  }

  body.woocommerce-cart table.shop_table tr{
    padding:10px 0;
  }

  body.woocommerce-cart table.shop_table td{
    border:none !important;
    padding:8px 0 !important;
  }

  /* Thumbnail */
  body.woocommerce-cart td.product-thumbnail{
    width:100% !important;
    padding-bottom:10px !important;
  }
  body.woocommerce-cart td.product-thumbnail img{
    max-width:200px;
    width:auto;
  }

  /* Hide subtotal column on mobile */
  body.woocommerce-cart td.product-subtotal{
    display:none !important;
  }

  /* Update cart stays right aligned */
  body.woocommerce-cart td.actions{
    text-align:right !important;
  }

  /* Totals spacing */
  body.woocommerce-cart .cart_totals{
    margin-top:18px;
  }

  /* Sticky proceed-to-checkout bar */
  body.woocommerce-cart .wc-proceed-to-checkout{
    position:sticky;
    bottom:12px;
    z-index:20;
    background:rgba(253,246,227,0.92);
    padding:10px;
    border-radius:18px;
    box-shadow:0 16px 46px rgba(0,0,0,0.16);
    text-align:right !important;
  }
}