
/* =========================================================
   V565 - FIX TEMP PRODUCT AREA / MATCH APPROVED DESIGN
   ========================================================= */

/* Desktop: keep all fields and add button inside the card */
.v392-temp-product{
  display:grid!important;
  grid-template-columns:
    minmax(220px,1.55fr)
    minmax(92px,.58fr)
    minmax(150px,.92fr)
    minmax(110px,.66fr)
    minmax(180px,1.05fr)!important;
  gap:8px!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  padding:12px!important;
  overflow:hidden!important;
  border:1px dashed #bfd1c6!important;
  border-radius:10px!important;
  background:#fbfdfc!important;
}

.v392-temp-head{
  grid-column:1/-1!important;
  margin:0 0 2px!important;
  color:#55665d!important;
  font-size:10px!important;
  line-height:1.2!important;
  font-weight:900!important;
  letter-spacing:.05em!important;
}

.v392-temp-product input,
.v392-temp-product select,
.v392-temp-product button{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

.v392-temp-product input,
.v392-temp-product select{
  min-height:42px!important;
  height:42px!important;
  padding:0 11px!important;
  border:1px solid #dfe6e2!important;
  border-radius:8px!important;
  background:#fff!important;
  font-size:11.5px!important;
}

.v392-temp-product button{
  min-height:42px!important;
  height:42px!important;
  padding:0 14px!important;
  border:0!important;
  border-radius:8px!important;
  background:linear-gradient(90deg,#076a40,#0a854d)!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:900!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  box-shadow:0 4px 10px rgba(7,106,64,.14)!important;
}

/* Product list button below-left, not squeezed beside add button */
.v392-temp-product + button,
.v388-quote-product-source + button,
.v370-order-panel .v388-product-list-button{
  justify-self:start!important;
}

/* Force the existing "Danh sách sản phẩm" button to sit on a new row */
.v370-order-panel:has(.v392-temp-product) .v392-temp-product ~ button{
  margin-top:8px!important;
}

/* If "Danh sách sản phẩm" is inside the same parent after the temp block */
.v370-order-panel:has(.v392-temp-product) button{
  box-sizing:border-box!important;
}

.v370-order-panel:has(.v392-temp-product) button:not(.delete-line):not(.primary):not(.preview):not(.ghost){
  max-width:100%!important;
}

/* Make the product-source area visually match the approved layout */
.v388-quote-product-source{
  margin-bottom:8px!important;
}

.v370-product-search{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}

/* Desktop width safety */
@media(min-width:1100px){
  .v370-order-panel:has(.v392-temp-product){
    overflow:hidden!important;
  }
}

/* Tablet */
@media(max-width:1180px){
  .v392-temp-product{
    grid-template-columns:
      minmax(200px,1.45fr)
      minmax(90px,.58fr)
      minmax(140px,.9fr)
      minmax(100px,.64fr)
      minmax(160px,1fr)!important;
  }
  .v392-temp-product button{
    font-size:10.5px!important;
    padding:0 10px!important;
  }
}

/* Mobile: stack like mockup */
@media(max-width:1100px){
  .v392-temp-product{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
    padding:10px!important;
  }

  .v392-temp-head{
    grid-column:1/-1!important;
  }

  .v392-temp-product input:first-of-type{
    grid-column:1/-1!important;
  }

  .v392-temp-product select{
    grid-column:1/-1!important;
  }

  .v392-temp-product button{
    grid-column:1/-1!important;
    min-height:44px!important;
    height:44px!important;
    font-size:11.5px!important;
  }

  .v370-order-panel:has(.v392-temp-product) .v392-temp-product ~ button{
    width:100%!important;
    min-height:42px!important;
    margin-top:8px!important;
    border:1px solid #d9e5de!important;
    border-radius:8px!important;
    background:#fff!important;
    color:#086a40!important;
    font-size:11px!important;
    font-weight:900!important;
  }
}

/* Small phone */
@media(max-width:430px){
  .v392-temp-product{
    grid-template-columns:1fr!important;
  }

  .v392-temp-product > *{
    grid-column:1!important;
  }

  .v392-temp-head{
    grid-column:1!important;
  }
}
