/* =====================================================
   CS cart benefits summary
   Compact presentation shared by mini-cart, cart and checkout.
   ===================================================== */

.cs-cart-benefits {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 7px 0;
  border-top: 1px solid rgba(96, 1, 101, .1);
  background: transparent;
  color: #28172a;
  text-align: left;
}

.cs-cart-benefits,
.cs-cart-benefits * {
  box-sizing: border-box;
}

.cs-cart-benefits__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 2px 0;
  font-size: 11.5px;
  line-height: 1.3;
}

.cs-cart-benefits__row > span {
  min-width: 0;
  color: rgba(40, 23, 42, .68);
  font-weight: 650;
}

.cs-cart-benefits__row > strong,
.cs-cart-benefits__row .amount {
  flex: 0 0 auto;
  color: #600165;
  font-size: 13px;
  font-weight: 850;
  line-height: inherit;
  white-space: nowrap;
}

.cs-cart-benefits__row--secondary {
  margin-top: 4px;
  padding-top: 5px;
  border-top: 1px solid rgba(40, 23, 42, .06);
  font-size: 10.5px;
}

/* Cart and checkout may disclose the source without expanding into a widget. */
.cs-cart-benefits__row--detail {
  padding-bottom: 1px;
  font-size: 10.5px;
}

.cs-cart-benefits__row--detail > span {
  color: rgba(40, 23, 42, .58);
  font-weight: 600;
}

.cs-cart-benefits__row--detail > strong {
  color: rgba(40, 23, 42, .78);
  font-size: 11.5px;
  font-weight: 700;
}

.cs-cart-benefits__row--secondary > strong {
  font-size: 10.5px;
  font-weight: 750;
}

/* Mini-cart: keep the benefit line inside the existing totals surface. */
.cs-mini-cart .cs-cart-benefits {
  margin: 0;
  padding: 5px 0;
}

.cs-mini-cart .cs-cart-benefits__row {
  gap: 8px;
  padding-block: 1px;
  font-size: 11px;
}

.cs-mini-cart .cs-cart-benefits__row > strong,
.cs-mini-cart .cs-cart-benefits__row .amount {
  font-size: 12.5px;
}

.cs-mini-cart .cs-cart-benefits__row--secondary {
  margin-top: 3px;
  padding-top: 4px;
  font-size: 10px;
}

.cs-mini-cart .cs-cart-benefits__row--secondary > strong {
  font-size: 10px;
}

/* Cart: the hook is emitted as one structurally valid totals table row. */
body.woocommerce-cart .cs-cart-totals table.shop_table tr.cs-cart-benefits-row {
  display: block;
  padding: 4px 0 6px;
  border-bottom: 0;
}

body.woocommerce-cart .cs-cart-totals table.shop_table tr.cs-cart-benefits-row > td {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0;
  text-align: left;
}

body.woocommerce-cart .cs-cart-totals table.shop_table tr.cs-cart-benefits-row > td::before {
  display: none;
}

body.woocommerce-cart .cs-cart-benefits,
body.woocommerce-checkout .cs-cart-benefits {
  width: 100%;
}

/* Checkout: keep the compact line adjacent to the authoritative total. */
body.woocommerce-checkout .cs-checkout-review-totals > .cs-cart-benefits {
  margin: 4px 0;
}

@media (max-width: 420px) {
  .cs-cart-benefits__row {
    gap: 8px;
  }
}
