/* ==========================================================================
   Order summary — Cart & Checkout
   --------------------------------------------------------------------------
   Rewritten in one pass. The previous version had grown by accretion: ten
   appended sections, several undoing earlier ones, and one selector that
   matched the wrong row entirely.

   Class names below are taken from WooCommerce's own block source, not
   guessed:

     .wc-block-components-totals-wrapper      plain div around a group
     .wc-block-components-totals-item         EVERY price row
       __label  __value  __description
     .wc-block-components-totals-footer-item  added to the grand total ROW
                                              (it is also a totals-item)
     .wc-block-components-totals-coupon       the coupon toggle
     .wc-block-components-totals-shipping     the delivery row
     .wc-block-components-totals-taxes / -fees / -discount

   IMPORTANT: the grand total is NOT inside the totals block's wrapper list —
   it renders as a sibling after it. So `:last-child` inside that block is the
   TAX row, not the total. That mistake is what made Sales tax render large.
   Target .wc-block-components-totals-footer-item and nothing else.

   Theme rem base is 10px: 1.7rem = 17px.
   ========================================================================== */

:root {
  --lsdep-rule: rgba(31, 42, 82, 0.09);
  --lsdep-pad: 14px;
  --lsdep-size: 1.7rem;
}

/* --------------------------------------------------------------------------
   1. Clear every border and every stray gap. Nothing below re-adds one except
      the single row rule in section 2.
   -------------------------------------------------------------------------- */

.wc-block-components-order-summary,
.wc-block-components-order-summary__content,
.wc-block-components-totals-wrapper,
.wc-block-components-totals-wrapper::before,
.wc-block-components-totals-wrapper::after,
.wc-block-components-totals-item,
.wc-block-components-totals-footer-item,
.wc-block-components-totals-coupon,
.wc-block-components-totals-shipping,
.wc-block-components-totals-taxes,
.wc-block-components-totals-fees,
.wc-block-components-totals-discount,
.wp-block-woocommerce-cart-order-summary-block,
.wp-block-woocommerce-checkout-order-summary-block,
.wp-block-woocommerce-cart-order-summary-totals-block,
.wp-block-woocommerce-checkout-order-summary-totals-block,
.wp-block-woocommerce-cart-order-summary-coupon-form-block,
.wp-block-woocommerce-checkout-order-summary-coupon-form-block,
.wp-block-woocommerce-cart-order-summary-subtotal-block,
.wp-block-woocommerce-checkout-order-summary-subtotal-block,
.wp-block-woocommerce-cart-order-summary-fee-block,
.wp-block-woocommerce-checkout-order-summary-fee-block,
.wp-block-woocommerce-cart-order-summary-shipping-block,
.wp-block-woocommerce-checkout-order-summary-shipping-block,
.wp-block-woocommerce-cart-order-summary-taxes-block,
.wp-block-woocommerce-checkout-order-summary-taxes-block,
.wp-block-woocommerce-cart-order-summary-discount-block,
.wp-block-woocommerce-checkout-order-summary-discount-block {
  border-top: 0 !important;
  border-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  /* Horizontal inset is what made the price rows start further right than the
     heading, product line and coupon. Every element in the summary now shares
     the card's own padding and nothing adds its own. */
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* --------------------------------------------------------------------------
   2. ONE rule for every row: same size, same padding, one hairline above.
      Applies to WooCommerce's rows and the coupon toggle alike, so the rhythm
      cannot drift between them.
   -------------------------------------------------------------------------- */

.wc-block-components-totals-item,
.wc-block-components-totals-coupon {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 16px !important;
  margin: 0 !important;
  padding-top: var(--lsdep-pad) !important;
  padding-bottom: var(--lsdep-pad) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-top: 1px solid var(--lsdep-rule) !important;
  font-size: var(--lsdep-size) !important;
  line-height: 1.4 !important;
  text-transform: none !important;
}

.wc-block-components-totals-item__label,
.wc-block-components-totals-coupon .wc-block-components-panel__button {
  font-size: var(--lsdep-size) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  color: var(--base-text-color, #5b6488) !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
}

.wc-block-components-totals-item__value {
  font-size: var(--lsdep-size) !important;
  font-weight: 700 !important;
  text-align: right;
  white-space: nowrap;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: var(--h1-h6-color, #1f2a52) !important;
}

/* Nothing inside a value may re-introduce capitals (the free-shipping label
   is uppercased by WooCommerce). */
.wc-block-components-totals-item__value *,
.wc-block-components-totals-shipping .wc-block-components-totals-item__value,
.wc-block-components-totals-shipping .wc-block-components-totals-item__value * {
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Free delivery reads as good news. */
.wc-block-components-totals-shipping .wc-block-components-totals-item__value {
  color: var(--color-green-1, #21a584) !important;
}

/* WooCommerce's small caption under a row; the design has none.
   NOT A BLANKET RULE — see below. */
.wc-block-components-totals-item__description {
  display: none !important;
}

/* ...except on the Discount row. WooCommerce renders the APPLIED COUPON CHIPS
   into that row's description slot, and each chip carries the only "remove
   coupon" control there is. Hiding descriptions wholesale therefore left a
   customer with a coupon they could see but could not take off — which on a
   live store meant a stuck cart with no way back. */
.wc-block-components-totals-discount .wc-block-components-totals-item__description,
.wc-block-components-totals-discount__coupon-list {
  display: block !important;
  margin-top: 8px !important;
}

.wc-block-components-totals-discount__coupon-list-item {
  display: inline-flex !important;
}

/* Make the remove control unmistakably clickable. */
.wc-block-components-chip__remove,
.wc-block-components-chip__remove-icon {
  display: inline-flex !important;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   3. The grand total — the ONLY row that differs, and only in size/weight.
   -------------------------------------------------------------------------- */

.wc-block-components-totals-item.wc-block-components-totals-footer-item {
  padding-top: 18px !important;
  padding-bottom: 18px !important;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-size: 2.2rem !important;
  font-weight: 800 !important;
  color: var(--h1-h6-color, #1f2a52) !important;
}

/* --------------------------------------------------------------------------
   4. Product lines at the top of the summary
   -------------------------------------------------------------------------- */

.wc-block-components-order-summary__content {
  padding-top: 12px !important;
}

.wc-block-components-order-summary-item {
  border-top: 0 !important;
  border-bottom: 0 !important;
  padding: 0 0 14px !important;
  margin: 0 !important;
}

/* The deposit panel and disclaimer are filled boxes, so they keep their own
   inner padding but their OUTER edges line up with the rows above. */
.lsdep-block,
.lsdep-panel,
.lsdep-disclaimer,
.lsdep-policy {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* --------------------------------------------------------------------------
   5. Coupon panel body, once opened
   -------------------------------------------------------------------------- */

.wc-block-components-totals-coupon .wc-block-components-panel__content {
  padding: 12px 0 2px !important;
  margin: 0 !important;
}

.wc-block-components-totals-coupon__form {
  margin: 0 !important;
  padding: 4px 0 0 !important;
}

/* --------------------------------------------------------------------------
   6. Deposit panel
   -------------------------------------------------------------------------- */

.lsdep-block { margin-top: 0; }

.lsdep-panel {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(115deg, #fdeaf3 0%, #f3ecfb 55%, #eaf0fe 100%);
}

.lsdep-panel__due {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--lsdep-rule);
}

.lsdep-panel__due-label {
  font-weight: 700;
  font-size: var(--lsdep-size);
  color: var(--h1-h6-color, #1f2a52);
}

.lsdep-panel__due-value {
  font-weight: 800;
  font-size: 2.9rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-pink-3, #e5187c);
  white-space: nowrap;
}

.lsdep-panel__balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
  font-size: var(--lsdep-size);
  font-weight: 600;
  color: var(--base-text-color, #5b6488);
}

.lsdep-panel__balance-value {
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--h1-h6-color, #1f2a52);
  white-space: nowrap;
}

.lsdep-panel__note {
  margin: 11px 0 0;
  font-size: 1.45rem;
  line-height: 1.55;
  color: var(--base-text-color, #5b6488);
}

/* ---- policy sentence (only when figures are unavailable) ----------------- */

.lsdep-policy {
  margin: 12px 0 0;
  padding: 11px 15px;
  border-radius: 14px;
  background: var(--color-pink-6, #ffe9f4);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--h1-h6-color, #1f2a52);
}

/* ---- disclaimer, cart only ----------------------------------------------- */

.lsdep-disclaimer {
  position: relative;
  margin: 16px 0 0;
  padding: 13px 16px 13px 38px;
  border-radius: 14px;
  background: var(--color-amber-6, #fef7e8);
  font-size: 1.45rem;
  line-height: 1.55;
  color: var(--color-amber-1, #c48a12);
}

.lsdep-disclaimer::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.9;
}

.lsdep-disclaimer::after {
  content: "i";
  position: absolute;
  left: 19.5px;
  top: 16px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 14px;
  color: var(--color-amber-6, #fef7e8);
}

@media (max-width: 600px) {
  .lsdep-panel__due-value { font-size: 2.4rem; }

  .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
  .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 2rem !important;
  }
}

/* "No deposit due" — the Non-Profit Check Payment state. Same card as the
   deposit panel so the summary does not visibly restructure when the customer
   switches payment method; just without a figure, because there isn't one. */
.lsdep-panel--none .lsdep-panel__due {
  border-bottom: 0;
  padding-bottom: 0;
}

.lsdep-panel--none .lsdep-panel__due-label {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--color-green-1, #21a584);
}
