
/* V437X - Products desktop table overlap fix */

/* Keep horizontal scrolling inside the product panel only when truly needed. */
.v271-products-page .v271-products-table-wrap{
  width:100%;
  max-width:100%;
  overflow-x:auto!important;
  overflow-y:visible;
  -webkit-overflow-scrolling:touch;
}

/* Stable desktop column geometry.
   The old 760px minimum became too narrow after "Lịch sử giá" was added. */
.v271-products-page .v437x-products-table{
  width:100%;
  min-width:1120px!important;
  table-layout:fixed!important;
  border-collapse:collapse;
}

/* Mã */
.v437x-products-table th:nth-child(1),
.v437x-products-table td:nth-child(1){width:10%!important}
/* Sản phẩm */
.v437x-products-table th:nth-child(2),
.v437x-products-table td:nth-child(2){width:29%!important}
/* Danh mục */
.v437x-products-table th:nth-child(3),
.v437x-products-table td:nth-child(3){width:16%!important}
/* ĐVT */
.v437x-products-table th:nth-child(4),
.v437x-products-table td:nth-child(4){width:7%!important}
/* Giá nhập */
.v437x-products-table th:nth-child(5),
.v437x-products-table td:nth-child(5){width:11%!important}
/* VAT nhập */
.v437x-products-table th:nth-child(6),
.v437x-products-table td:nth-child(6){width:8%!important}
/* Giá bán */
.v437x-products-table th:nth-child(7),
.v437x-products-table td:nth-child(7){width:10%!important}
/* Thao tác */
.v437x-products-table th:nth-child(8),
.v437x-products-table td:nth-child(8){width:19%!important}

.v437x-products-table th,
.v437x-products-table td{
  box-sizing:border-box;
  vertical-align:middle!important;
}

/* Never allow the action group to visually spill into the selling-price cell. */
.v437x-product-price{
  position:relative;
  z-index:1;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis;
}
.v437x-product-actions{
  position:relative;
  z-index:2;
  overflow:hidden!important;
  white-space:nowrap!important;
}
.v437x-product-actions-inner{
  width:100%;
  min-width:0;
  flex-wrap:nowrap!important;
  align-items:center;
}
.v437x-product-actions-inner button{
  flex:0 0 auto;
  min-width:0;
}
.v437x-history-btn{
  padding-left:6px!important;
  padding-right:6px!important;
  font-size:10px!important;
}

/* Keep long names/SKUs from pushing neighbouring columns. */
.v437x-products-table td:nth-child(1),
.v437x-products-table td:nth-child(2),
.v437x-products-table td:nth-child(3){
  overflow:hidden;
  text-overflow:ellipsis;
}
.v437x-products-table td:nth-child(1){
  white-space:nowrap;
}
.v437x-products-table td:nth-child(2),
.v437x-products-table td:nth-child(3){
  white-space:normal;
  overflow-wrap:anywhere;
}

/* 12–15 inch desktop/laptop */
@media(min-width:768px) and (max-width:1366px){
  .v271-products-page .v437x-products-table{
    min-width:1080px!important;
  }
  .v437x-products-table th,
  .v437x-products-table td{
    padding-left:8px!important;
    padding-right:8px!important;
    font-size:10.5px!important;
  }
  .v437x-history-btn{
    font-size:9px!important;
    padding-left:5px!important;
    padding-right:5px!important;
  }
  .v437x-product-actions-inner{
    gap:2px!important;
  }
  .v437x-product-actions-inner button{
    padding-left:5px!important;
    padding-right:5px!important;
  }
}

/* Mobile uses product cards, not this desktop table.
   Keep card controls compact and never let them overflow. */
@media(max-width:767px){
  .v271-products-page{
    overflow-x:hidden;
  }
  .v271-products-page article{
    max-width:100%;
  }
  .v271-products-page article button{
    max-width:100%;
  }
}
