/* TR Global v431 — Order Summary image-column containment hotfix.
   Loaded LAST on order-summary.html so the v400 three-visual master layout
   cannot overflow into Style No. / Name or Description columns. */

body[data-order-summary-page] .order-summary-table{
  min-width:1980px!important;
}
body[data-order-summary-page] .order-summary-table col.order-col-picture{
  width:320px!important;
}
body[data-order-summary-page] .order-sheet-image-cell{
  width:320px!important;
  min-width:320px!important;
  max-width:320px!important;
  overflow:hidden!important;
  vertical-align:top!important;
  box-sizing:border-box!important;
}
body[data-order-summary-page] .order-sheet-master-visuals{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  align-items:start!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
}
body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
  margin:0!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  border-radius:10px!important;
}
body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link img,
body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link.is-primary img{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:132px!important;
  min-height:132px!important;
  padding:4px!important;
  object-fit:contain!important;
  box-sizing:border-box!important;
  background:#f7f3ec!important;
}
body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link small{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:5px 3px 4px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:9px!important;
  line-height:1.15!important;
  text-align:center!important;
}
body[data-order-summary-page] .order-sheet-style-cell{
  min-width:210px!important;
  position:relative!important;
  z-index:1!important;
}
body[data-order-summary-page] .order-sheet-description-cell{
  min-width:260px!important;
  position:relative!important;
  z-index:1!important;
}

/* The table already scrolls horizontally on smaller screens. Keep the three
   visuals inside their own fixed-width cell rather than stacking outside it. */
@media(max-width:900px){
  body[data-order-summary-page] .order-summary-table{
    min-width:1980px!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals .is-primary{
    grid-column:auto!important;
  }
}

@media print{
  body[data-order-summary-page] .order-summary-table col.order-col-picture{
    width:50mm!important;
  }
  body[data-order-summary-page] .order-sheet-image-cell{
    width:50mm!important;
    min-width:50mm!important;
    max-width:50mm!important;
    overflow:hidden!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:1.2mm!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link,
  body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link.is-primary{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link img,
  body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link.is-primary img{
    width:100%!important;
    max-width:100%!important;
    height:24mm!important;
    min-height:24mm!important;
    padding:.7mm!important;
    object-fit:contain!important;
  }
  body[data-order-summary-page] .order-sheet-master-visuals .order-sheet-image-link small{
    font-size:5.5pt!important;
    padding:.7mm .4mm!important;
  }
}
