/**
 * HangNgoaiShop 3.9.55.68.2
 * CheckoutWC 11.3.1 / Cart Product Column Structural Compatibility Lock
 *
 * Scope: native WooCommerce Cart only.
 * - Restores a readable product-title column for long Vietnamese product names.
 * - Uses auto table layout so body-cell geometry can participate in sizing.
 * - Gives medium desktop/tablet landscape a full-width cart table and moves
 *   Order Summary below when the split layout cannot guarantee safe width.
 * - Keeps >=1280px as the locked two-column Quiet Premium Cart.
 * - Mobile (<850px) remains governed by the existing final mobile Cart layer.
 */

@media (min-width:850px){
  body.woocommerce-cart #content.content-area.page-wrapper{
    width:100%!important;
    max-width:1380px!important;
  }

  body.woocommerce-cart .woocommerce > .row.row-large.row-divided{
    width:100%!important;
    max-width:1320px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  body.woocommerce-cart .woocommerce-cart-form,
  body.woocommerce-cart .woocommerce-cart-form .cart-wrapper{
    width:100%!important;
    min-width:0!important;
  }

  body.woocommerce-cart table.shop_table.cart{
    width:100%!important;
    max-width:100%!important;
    table-layout:auto!important;
  }

  body.woocommerce-cart table.shop_table.cart th.product-name,
  body.woocommerce-cart table.shop_table.cart td.product-name{
    width:auto!important;
    min-width:280px!important;
    max-width:none!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    hyphens:none!important;
  }

  body.woocommerce-cart table.shop_table.cart td.product-name a{
    display:block!important;
    width:auto!important;
    max-width:none!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:break-word!important;
    hyphens:none!important;
  }

  body.woocommerce-cart table.shop_table.cart td.product-remove{
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
  }

  body.woocommerce-cart table.shop_table.cart td.product-thumbnail{
    width:86px!important;
    min-width:86px!important;
    max-width:86px!important;
  }

  body.woocommerce-cart table.shop_table.cart td.product-thumbnail img{
    width:72px!important;
    height:72px!important;
  }

  body.woocommerce-cart table.shop_table.cart th.product-price,
  body.woocommerce-cart table.shop_table.cart td.product-price{
    width:92px!important;
    min-width:92px!important;
    max-width:92px!important;
    white-space:nowrap!important;
  }

  body.woocommerce-cart table.shop_table.cart th.product-quantity,
  body.woocommerce-cart table.shop_table.cart td.product-quantity{
    width:102px!important;
    min-width:102px!important;
    max-width:102px!important;
    white-space:nowrap!important;
  }

  body.woocommerce-cart table.shop_table.cart th.product-subtotal,
  body.woocommerce-cart table.shop_table.cart td.product-subtotal{
    width:122px!important;
    min-width:122px!important;
    max-width:122px!important;
    white-space:nowrap!important;
    text-align:right!important;
  }
}

/* If the viewport cannot safely support the fixed summary + readable product
   column, use the already-established stacked Cart composition. */
@media (min-width:850px) and (max-width:1279px){
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided{
    display:block!important;
  }

  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-7.col,
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-5.col,
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .cart-collaterals{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    flex:none!important;
  }

  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-5.col,
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .cart-collaterals{
    margin-top:22px!important;
  }

  body.woocommerce-cart .cart-sidebar{
    position:static!important;
    top:auto!important;
    width:100%!important;
    max-width:420px!important;
    margin-left:auto!important;
    margin-right:0!important;
  }

  body.woocommerce-cart table.shop_table.cart th.product-name,
  body.woocommerce-cart table.shop_table.cart td.product-name{
    min-width:320px!important;
  }
}

/* Wide desktop: preserve the locked split composition, but guarantee the left
   rail cannot collapse below the structural table requirement. */
@media (min-width:1280px){
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided{
    display:flex!important;
    flex-wrap:nowrap!important;
    align-items:flex-start!important;
    gap:28px!important;
  }

  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-7.col{
    flex:1 1 auto!important;
    width:auto!important;
    max-width:none!important;
    min-width:820px!important;
  }

  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .large-5.col,
  body.woocommerce-cart .woocommerce > .row.row-large.row-divided > .cart-collaterals{
    flex:0 0 320px!important;
    width:320px!important;
    max-width:320px!important;
    min-width:320px!important;
  }
}
