/* ShopBuilder classic cart: show each product as a readable card on narrow screens. */
/* Keep each cart variation label beside its value, including long colour names. */
body.woocommerce-cart .rtsb-cart-table td.product-name dl.variation {
  display: grid !important; grid-template-columns: max-content minmax(0,1fr);
  align-items: baseline; column-gap: 7px; row-gap: 5px;
  width: 100%; max-width: 100%; margin: 10px 0 0;
}
body.woocommerce-cart .rtsb-cart-table td.product-name dl.variation :is(dt,dd) {
  float: none !important; clear: none !important; width: auto !important;
  min-width: 0; margin: 0 !important; padding: 0 !important;
  line-height: 1.4; text-align: left; overflow-wrap: break-word;
}
body.woocommerce-cart .rtsb-cart-table td.product-name dl.variation dt { font-weight: 600; }
body.woocommerce-cart .rtsb-cart-table td.product-name dl.variation dd p { margin: 0; display: inline; }
@media (max-width: 767px) {
  body.woocommerce-cart .rtsb-cart-table,
  body.woocommerce-cart .rtsb-cart-table .woocommerce-cart-form,
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart {
    width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    box-sizing: border-box; overflow: visible !important;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart,
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tbody,
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tfoot { display: block !important; }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart thead { display: none !important; }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item {
    display: flex !important; flex-direction: column; gap: 10px;
    width: 100%; min-width: 0; box-sizing: border-box;
    padding: 16px; margin: 0 0 16px;
    border: 1px solid #DEE2E6; border-radius: 12px; background: #FFFFFF;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td {
    display: flex !important; align-items: center; justify-content: space-between;
    gap: 12px; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    box-sizing: border-box; padding: 6px 0 !important; border: 0 !important;
    text-align: left !important; white-space: normal !important;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td:is(.product-name,.product-data,.product-thumbnail) {
    display: block !important; overflow-wrap: anywhere;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td.product-remove { justify-content: flex-end; order: -2; }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td.product-thumbnail { order: -1; }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td.product-thumbnail img { width: 76px; max-width: 100%; height: auto; }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td:is(.product-price,.product-quantity,.product-subtotal)::before {
    content: attr(data-title); flex: 0 0 38%; max-width: 38%;
    color: #586A73; font-weight: 600; font-size: 13px; line-height: 1.4;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td .table-column-wrapper {
    min-width: 0; max-width: 100%; overflow-wrap: anywhere;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item > td:is(.product-price,.product-quantity,.product-subtotal) .table-column-wrapper {
    flex: 1 1 auto; display: flex; justify-content: flex-end; text-align: right;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item .quantity {
    display: inline-flex !important; flex-direction: row !important; align-items: center;
    max-width: 100%; width: auto !important;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item .rtsb-quantity-box-group {
    display: inline-flex !important; flex-direction: row !important; align-items: stretch;
    width: auto !important; max-width: 100%; min-width: 0;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item .rtsb-quantity-box-group .screen-reader-text {
    position: absolute !important; width: 1px !important; height: 1px !important;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tr.cart_item .quantity :is(input,button,.minus,.plus) {
    min-width: 36px !important; width: 36px !important; height: 40px !important; box-sizing: border-box;
  }
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tfoot tr,
  body.woocommerce-cart .rtsb-cart-table table.shop_table.cart tfoot td { display: block !important; width: 100% !important; box-sizing: border-box; }
  body.woocommerce-cart .rtsb-cart-table .actions-button-wrapper { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

  body.woocommerce-cart .rtsb-cart-totals,
  body.woocommerce-cart .rtsb-cart-totals .cart_totals,
  body.woocommerce-cart .rtsb-cart-totals table.shop_table {
    display: block; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    box-sizing: border-box; overflow: visible !important;
  }
  body.woocommerce-cart .rtsb-cart-totals table.shop_table tbody { display: block; }
  body.woocommerce-cart .rtsb-cart-totals table.shop_table tr {
    display: grid !important; grid-template-columns: minmax(76px, 36%) minmax(0, 1fr);
    width: 100%; min-width: 0; box-sizing: border-box;
  }
  body.woocommerce-cart .rtsb-cart-totals table.shop_table :is(th,td) {
    display: block !important; width: auto !important; min-width: 0 !important; max-width: 100%;
    box-sizing: border-box; padding: 12px 8px !important; overflow-wrap: anywhere;
    white-space: normal !important;
  }
  body.woocommerce-cart .rtsb-cart-totals table.shop_table td { text-align: right; }
  body.woocommerce-cart .rtsb-cart-totals table.shop_table :is(.amount,.woocommerce-Price-amount) { white-space: nowrap; }
  body.woocommerce-cart .rtsb-cart-totals :is(.woocommerce-shipping-methods,.woocommerce-shipping-destination) {
    max-width: 100%; overflow-wrap: anywhere; white-space: normal;
  }
}
