/* ===============================================================
 RIMAV CART V6 — scoped presentation correction (Desktop only).
 Companion stylesheet loaded after V5; retains auto update + gift.
 =============================================================== */
@media (min-width: 981px) {
  /* V4 used two AUTO rows under a product form spanning both rows.
     With several cart items the first row expands, creating the giant
     empty band between coupon and totals. Fix track sizing itself. */
  .rimav-cart-page-v4 .rimav-cart-native > .woocommerce {
    grid-template-rows: max-content minmax(0, 1fr) !important;
    align-content: start !important;
    row-gap: 12px !important;
  }

  /* The same six physical columns for the headers AND product cells.
     Reset legacy Woo/Bricks hide rules, including the 621–1250px range. */
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead tr,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > tbody tr.cart_item {
    display: grid !important;
    grid-template-columns: 78px minmax(145px, 1fr) 88px 98px 102px 26px !important;
    column-gap: clamp(6px, .65vw, 10px) !important;
    align-items: center !important;
    direction: rtl !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > tbody tr.cart_item {
    grid-template-areas: 'thumb name qty price total remove' !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-price,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-subtotal,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > tbody td.product-price,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > tbody td.product-subtotal {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 0 !important;
    width: auto !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-thumbnail {grid-column:1 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-name {grid-column:2 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-quantity {grid-column:3 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-price {grid-column:4 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-subtotal {grid-column:5 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-remove {grid-column:6 !important;}
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-quantity,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-price,
  .rimav-cart-page-v4 .woocommerce-cart-form table.shop_table > thead th.product-subtotal,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-price,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-subtotal {
    text-align: center !important;
    justify-self: center !important;
    align-self: center !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-name {
    justify-self: stretch !important;
    align-self: center !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-thumbnail img {
    width: 78px !important;
    height: 100px !important;
  }

  /* Display totals distinctly without changing monetary calculations. */
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-price,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-subtotal {
    font-size: 14px !important;
    line-height: 1.5 !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-price .woocommerce-Price-amount {
    font-weight: 700 !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-subtotal .woocommerce-Price-amount {
    font-weight: 800 !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-price .woocommerce-Price-currencySymbol,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-subtotal .woocommerce-Price-currencySymbol {
    font-size: 13px !important;
  }

  /* Quantity widget, including plus/minus injected by another component.
     Keep a single compact control well inside its 88px table column. */
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    width: max-content !important;
    max-width: 86px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    float: none !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity input.qty {
    display: block !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 35px !important;
    min-height: 35px !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    border-radius: 5px !important;
    -moz-appearance: textfield;
    appearance: textfield;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity input.qty::-webkit-outer-spin-button,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity > :is(button, input[type="button"], a, span).plus,
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-quantity .quantity > :is(button, input[type="button"], a, span).minus {
    box-sizing: border-box !important;
    display: inline-flex !important;
    flex: 0 0 23px !important;
    align-items: center !important;
    justify-content: center !important;
    width: 23px !important;
    min-width: 23px !important;
    max-width: 23px !important;
    height: 35px !important;
    min-height: 35px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    border: 1px solid var(--rc-border,#e8e2dc) !important;
    border-radius: 5px !important;
  }
  .rimav-cart-page-v4 .woocommerce-cart-form td.product-remove {
    justify-self: center !important;
    align-self: center !important;
    text-align: center !important;
  }
}

/* Coupon's *own* summary row only: keep the discount and its remove link
   readable and RTL; all coupon links remain WooCommerce-generated. */
.rimav-cart-page-v4 .cart_totals tr.cart-discount th,
.rimav-cart-page-v4 .cart_totals tr.cart-discount td {
  vertical-align: middle !important;
  font-size: 12px !important;
  line-height: 1.8 !important;
  overflow-wrap: anywhere !important;
}
.rimav-cart-page-v4 .cart_totals tr.cart-discount td {
  text-align: left !important;
}
.rimav-cart-page-v4 .cart_totals tr.cart-discount .woocommerce-remove-coupon {
  display: inline-block !important;
  white-space: nowrap !important;
  margin-inline-start: 6px !important;
  color: var(--rc-accent-dark,#8d5e4d) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}
