/**
 * What: Every structural rule the three Cart elements need — Items, Totals, Coupon.
 * Why:  One stylesheet, shipped through each element's own dependencies(), matching
 *       bss-wp-checkout.css's own reasoning (BssWpAuthCheckoutForm's header): the three refresh
 *       together as one unit (assets/js/bss-wp-cart.js), so a page carrying only one of them still
 *       needs to know how the others would have looked, and a rule split per element risks the same
 *       silent drift bss-wp-checkout.css's own header records once already happening for real.
 * How:  Custom properties with WooCommerce's OWN values as the fallbacks, so an untouched control
 *       changes nothing and a set one wins without `!important` — same contract as bss-wp-checkout.css.
 *
 * No !important anywhere.
 */

/* ---------------------------------------------------------------------------------------------- */
/* Shared                                                                                          */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-items,
.bss-cart-totals,
.bss-cart-coupon,
.bss-cart-checkout {
  width: 100%;
}

/* The builder-only "WooCommerce is not active" notice. Deliberately plain, matching
   .bss-checkout-notice's own reasoning in bss-wp-checkout.css — a note to an author, not an error a
   customer would ever see. */
.bss-cart-builder-notice {
  margin: 0.5rem 0;
  padding: 0.6rem 0.75rem;
  border-left: 3px solid currentColor;
  font-size: 0.875rem;
  line-height: 1.5;
  opacity: 0.75;
}

/* bss-wp-cart.js's own error slot (includes/cart/render.php\notice_html()) — hidden until the
   script has something to say. */
.bss-cart-notice {
  margin: 0 0 0.75em;
  padding: 0.5em 0.75em;
  border-left: 3px solid #c0392b;
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  font-size: 0.875em;
}

.bss-cart-notice[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------------------------- */
/* Items                                                                                           */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-items__table {
  width: 100%;
  border-color: rgba(0, 0, 0, 0.1);
}

.bss-cart-items__cell,
.bss-cart-items__head {
  padding: 9px 12px;
  border-top-color: rgba(0, 0, 0, 0.1);
}

/* The picture's size is the shared line's (set from --bss-cart-image-size below); its corners are this element's. */
.bss-cart-items__table .product-thumbnail img {
  border-radius: var(--bss-cart-image-radius, 0);
}

.bss-cart-items__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bss-cart-remove-size, 1.5em);
  height: var(--bss-cart-remove-size, 1.5em);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.1em;
  line-height: 1;
}

.bss-cart-items__empty {
  padding: 1em;
}

/* ---------------------------------------------------------------------------------------------- */
/* Totals                                                                                          */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-totals__table {
  width: 100%;
  border-color: rgba(0, 0, 0, 0.1);
}

.bss-cart-totals__row th,
.bss-cart-totals__row td {
  padding: 9px 12px;
  border-top-color: rgba(0, 0, 0, 0.1);
}

.bss-cart-totals__row--total th,
.bss-cart-totals__row--total td {
  color: var(--bss-cart-total-colour, inherit);
  font-size: var(--bss-cart-total-size, inherit);
}

/* The "Calculate shipping" toggle and its form — WooCommerce's own real markup
   (cart/cart-shipping.php + cart/shipping-calculator.php), styled, not rebuilt. */
.bss-cart-totals .shipping-calculator-button {
  color: var(--bss-cart-shipping-toggle-colour, inherit);
}

.bss-cart-totals .shipping-calculator-form .input-text,
.bss-cart-totals .shipping-calculator-form select {
  color: var(--bss-cart-shipping-input-colour, inherit);
  border-color: var(--bss-cart-shipping-input-border, inherit);
}

/* ---------------------------------------------------------------------------------------------- */
/* Coupon                                                                                          */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-coupon__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 0.75em;
}

.bss-cart-coupon__input {
  flex: 1 1 12em;
}

.bss-cart-coupon__applied {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 0.5em;
  padding: 0.4em 0.75em;
  border-radius: 3px;
  background: rgba(0, 128, 0, 0.08);
  color: #2e7d32;
  font-size: 0.9em;
}

.bss-cart-coupon__remove {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------------------------- */
/* Checkout                                                                                        */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-checkout .checkout-button {
  display: inline-block;
  background: var(--bss-cart-checkout-bg, inherit);
  color: var(--bss-cart-checkout-text, inherit);
  border-radius: var(--bss-cart-checkout-radius, 0);
  padding-top: var(--bss-cart-checkout-padding, inherit);
  padding-bottom: var(--bss-cart-checkout-padding, inherit);
}

/* ============================================================================================== */
/* Cart Page (BssWpAuthCartPage): items left, summary right, the checkout's look (owner, 2026-10-25) */
/* ============================================================================================== */

/*
 * The checkout's three text sizes and its line and corner, so the cart and the checkout read as one
 * shop (bss-wp-checkout.css "Three text sizes"). Declared here as well because the cart page does
 * not load the checkout stylesheet.
 */
.bss-cart-page {
  --bss-ck-text-title: 1.25rem;
  --bss-ck-text: 1rem;
  --bss-ck-text-sub: 0.875rem;
  --bss-cart-line: var(--bss-checkout-border, var(--bde-woo-forms__inputs-border-color, #d1d5db));
  width: 100%;
  font-size: var(--bss-ck-text);
}

.bss-cart-page__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .bss-cart-page__grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 2rem;
  }

  /* The summary column stays in view while a long cart scrolls, as the checkout's payment does. */
  .bss-cart-page__side {
    position: sticky;
    top: 1rem;
  }
}

/* An empty cart is one message and a way back; there is nothing to summarise. */
.bss-cart-page__grid:has(.bss-cart-items__empty) .bss-cart-page__side {
  display: none;
}

/* ---------------------------------------------------------------------------------------------- */
/* The items: one row per product, not a spreadsheet                                               */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-page .bss-cart-items__table,
.bss-cart-page .bss-cart-items__table tbody {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: separate;
}

.bss-cart-page .bss-cart-items__table {
  border: 1px solid var(--bss-cart-line);
}

.bss-cart-page .bss-cart-items__table thead {
  display: none;
}

/*
 * Each row is the shared product line (includes/product-line.php, bss-wp-product-line.css) in one
 * cell: the row is a block with a rule under it, nothing more.
 */
.bss-cart-page .bss-cart-items__row {
  display: block;
  padding: 1rem;
  border-bottom: 1px solid var(--bss-cart-line);
  background: transparent;
}

.bss-cart-page .bss-cart-items__row:last-child {
  border-bottom: 0;
}

.bss-cart-page .bss-cart-items__row > td {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

/* WooCommerce's responsive table prints each cell's label before it on a phone; not here. */
.bss-cart-page .bss-cart-items__row > td::before {
  display: none;
  content: none;
}

/* The Cart Items element's image size control sets the line's picture size (its css.twig). */
.bss-cart-items .bss-line--options {
  --bss-line-media: var(--bss-cart-image-size, 7.5rem);
}

.bss-cart-page .bss-cart-items__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.6;
}

.bss-cart-page .bss-cart-items__remove:hover,
.bss-cart-page .bss-cart-items__remove:focus-visible {
  opacity: 1;
}

/* ---------------------------------------------------------------------------------------------- */
/* The summary column                                                                              */
/* ---------------------------------------------------------------------------------------------- */

.bss-cart-page__summary {
  padding: 1rem;
  border: 1px solid var(--bss-cart-line);
}

.bss-cart-page__title {
  margin: 0 0 0.75rem;
  font-size: var(--bss-ck-text-title);
  font-weight: 700;
  line-height: 1.3;
}

.bss-cart-page .bss-cart-totals__table {
  width: 100%;
  margin: 0;
  border: 0;
}

.bss-cart-page .bss-cart-totals__table th,
.bss-cart-page .bss-cart-totals__table td {
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  font-size: var(--bss-ck-text);
  font-weight: 400;
  vertical-align: top;
}

.bss-cart-page .bss-cart-totals__table th {
  text-align: left;
}

.bss-cart-page .bss-cart-totals__table td {
  text-align: right;
}

.bss-cart-page .bss-cart-totals__row--total th,
.bss-cart-page .bss-cart-totals__row--total td {
  padding-top: 0.75rem;
  border-top: 1px solid var(--bss-cart-line);
  font-weight: 700;
}

/* Shipping: the method, where it goes and "Change address", as supporting text under the amount. */
.bss-cart-page .woocommerce-shipping-totals td {
  font-size: var(--bss-ck-text-sub);
}

.bss-cart-page #shipping_method {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bss-cart-page .woocommerce-shipping-destination,
.bss-cart-page .woocommerce-shipping-calculator {
  margin: 0.25rem 0 0;
  font-size: var(--bss-ck-text-sub);
  opacity: 0.85;
}

/* The coupon box, under the totals: one row, the code and Apply. */
.bss-cart-page__coupon {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bss-cart-line);
}

.bss-cart-page .bss-cart-coupon__form {
  display: flex;
  gap: 0.5rem;
}

.bss-cart-page .bss-cart-coupon__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 0.9em;
  border: 1px solid var(--bss-cart-line);
  border-radius: 0;
  font-size: max(16px, 1em);
}

.bss-cart-page .bss-cart-coupon__apply {
  flex: none;
  height: 44px;
  padding: 0 1.1em;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: var(--bss-ck-text);
  font-weight: 400;
}

.bss-cart-page .bss-cart-coupon__applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 0.5rem;
  font-size: var(--bss-ck-text-sub);
}

/* Smart Coupons' list keeps its own coupon cards; only its frame is brought into line. */
.bss-cart-page__available {
  margin-top: 1rem;
  font-size: var(--bss-ck-text-sub);
}

.bss-cart-page__available #coupons_list {
  margin: 0;
  border-radius: 0;
}

/* The checkout button: full width, the total on it. */
.bss-cart-page__checkout {
  margin-top: 1rem;
}

.bss-cart-page .bss-cart-checkout__block {
  margin: 0;
  padding: 0;
}

.bss-cart-page .bss-cart-checkout__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0.75em 1.25em;
  border-radius: var(--bde-button-border-radius, 3px);
  background-color: var(--bde-button-primary-background-color, #11519b);
  color: var(--bde-button-primary-text-color, #fff);
  font-size: var(--bss-ck-text);
  text-align: center;
  text-decoration: none;
}

.bss-cart-page .bss-cart-checkout__amount {
  white-space: nowrap;
}

/*
 * Below 1024px: one column, the summary after the items, and the checkout button fixed to the
 * bottom of the screen for as long as the cart is on it. The side column dissolves (`display:
 * contents`) so the button is a child of the grid itself; sticky inside the side column it would
 * only ever stick within the summary's own height.
 */
@media (max-width: 1023px) {
  .bss-cart-page__side {
    display: contents;
  }

  .bss-cart-page__checkout {
    position: sticky;
    bottom: 0;
    z-index: 5;
    /*
     * The page's width, so the button is centred under the content (owner, 2026-10-25: a -1rem
     * side margin moved this grid item left without widening it, and the button sat off-centre).
     * A wide spread shadow paints the white bar out to the screen's edges, whatever the page's
     * gutter; the clip keeps it (and the rule above the bar) from covering anything over the bar.
     */
    margin: 0;
    padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--bde-background-color, #fff);
    box-shadow: 0 -1px 0 var(--bss-cart-line), 0 0 0 100vmax var(--bde-background-color, #fff);
    clip-path: inset(-1px -100vmax 0 -100vmax);
  }
}

/*
 * The quantity stepper: − | number | + in one bordered box. Breakdance's quantity script adds the
 * two buttons but draws them only inside its own cart widget — there they are absolutely placed
 * against a positioned box and given icons. Here the box was not positioned, so the empty buttons
 * landed against the edge of the whole table.
 */
.bss-cart-page .bss-cart-items__row .quantity {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--bss-cart-line);
  background: #fff;
}

.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button {
  position: static;
  top: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button::before,
.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button::after {
  content: none;
}

.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button--dec::before {
  content: "\2212";
}

.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button--inc::before {
  content: "+";
}

.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button:hover,
.bss-cart-page .bss-cart-items__row .quantity .bde-quantity-button:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}

.bss-cart-page .bss-cart-items__row .quantity input.qty {
  width: 2.75em;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: max(16px, 1em);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.bss-cart-page .bss-cart-items__row .quantity input.qty::-webkit-outer-spin-button,
.bss-cart-page .bss-cart-items__row .quantity input.qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

/* "Proceed to checkout · ₹X": the gap is set here because a flex item drops its leading space. */
.bss-cart-page .bss-cart-checkout__button {
  gap: 0.4em;
}

/* WooCommerce's notices (added to cart, coupon applied, out of stock) across the top of the page. */
.bss-cart-page__notices:empty {
  display: none;
}

.bss-cart-page__notices {
  margin: 0 0 1rem;
}

/*
 * Savings in green, every other amount neutral, the total in bold — the checkout summary's rule
 * (owner, 2026-10-25). A coupon, or a payment offer (a negative fee, marked by render.php).
 */
.bss-cart-totals__row--coupon td,
.bss-cart-totals__row--saving td {
  color: var(--bss-ck-saving, #067647);
  font-weight: 700;
}

/* The Cart Page sets every totals cell to regular weight at a higher specificity; a saving stays bold. */
.bss-cart-page .bss-cart-totals__table .bss-cart-totals__row--coupon td,
.bss-cart-page .bss-cart-totals__table .bss-cart-totals__row--saving td {
  font-weight: 700;
}

.bss-cart-totals__row--total th,
.bss-cart-totals__row--total td {
  font-weight: 700;
}

/* Room for a fixed (sticky) Breakdance header, measured by bss-wp-header-gap.js (owner, 2026-10-25). */
.bss-cart-page {
  --bss-header-overlap: 0px; /* the script's inline value wins */
  margin-top: var(--bss-header-overlap, 0px);
}

/* Phones: the checkout's smaller sizes on the cart too (owner, 2026-10-25: "smaller, crisper"). */
@media (max-width: 599px) {
  .bss-cart-page {
    --bss-ck-text-title: 1.125rem;
    --bss-ck-text: 0.9375rem;
    --bss-ck-text-sub: 0.8125rem;
  }

  .bss-cart-page__summary {
    padding: 0.75rem;
  }

  .bss-cart-page .bss-cart-checkout__button {
    min-height: 48px;
  }
}

/*
 * The cart on a real phone (owner, 2026-10-25):
 * - The delivery address and "Change address" under Shipping are dropped from the cart page: the
 *   address is chosen at checkout, after sign-in, and on the cart it was a long right-aligned block
 *   in the middle of the totals. The shipping method and its price stay.
 * - The totals table collapses its borders, so the line above the total runs unbroken.
 * - WooCommerce's notices ("added to your cart") read as a quiet framed line, not loose text.
 */
.bss-cart-page .woocommerce-shipping-destination,
.bss-cart-page .woocommerce-shipping-calculator {
  display: none;
}

.bss-cart-page .bss-cart-totals__table {
  border-collapse: collapse;
}

.bss-cart-page__notices .woocommerce-message,
.bss-cart-page__notices .woocommerce-info,
.bss-cart-page__notices .woocommerce-error {
  margin: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--bss-cart-line);
  border-left-width: 3px;
  background: transparent;
  font-size: var(--bss-ck-text-sub);
  text-align: left;
}

.bss-cart-page__notices .woocommerce-message::before,
.bss-cart-page__notices .woocommerce-info::before {
  display: none;
}

.bss-cart-page__notices .woocommerce-message .button,
.bss-cart-page__notices .woocommerce-message a {
  float: none;
  margin: 0 0 0 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
}

/* An applied coupon's row: the amount, and "Remove" on the line under it (owner, 2026-10-25). */
.bss-cart-totals__row--coupon .woocommerce-remove-coupon {
  display: block;
  margin-top: 0.1rem;
  color: inherit;
  font-size: var(--bss-ck-text-sub, 0.875rem);
  font-weight: 400;
  text-decoration: underline;
}

/* The store's colour on checkboxes and radios, and "Remove" in the text colour (owner, 2026-10-25). */
.bss-cart-page input[type="checkbox"],
.bss-cart-page input[type="radio"] {
  accent-color: var(--bde-brand-primary-color, #11519b);
}

.bss-cart-totals__row--coupon .woocommerce-remove-coupon {
  color: var(--bde-body-text-color, #1f2937);
}
