/* 07-11-2026: four compact material-category cards per desktop row.
   Only detailed quote > Materials. Original 4x lightbox kept intact. */
#detailed-quote.apg-compact-builder #quote-product-select .product-checkboxes{
 display:grid!important;
 grid-template-columns:repeat(4,minmax(0,1fr))!important;
 gap:12px!important;align-items:stretch!important;
 margin:0!important;padding:0!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-choice-card{
 display:grid!important;
 grid-template-columns:minmax(0,1fr)!important;
 grid-template-rows:auto 164px minmax(0,1fr)!important;
 min-height:0!important;min-width:0!important;
 border-radius:10px!important;box-shadow:0 2px 8px #28343610!important;
 overflow:hidden!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-card-title{
 grid-column:1!important;grid-row:1!important;
 min-height:49px!important;padding:9px 10px!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-select-label{
 font-size:15px!important;gap:8px!important;
 line-height:1.25!important;min-width:0!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-select-name{
 white-space:normal!important;overflow-wrap:anywhere!important;
 font-size:15px!important;line-height:1.24!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-select-label input{
 width:19px!important;height:19px!important;min-width:19px!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-carousel{
 grid-column:1!important;grid-row:2!important;
 width:100%!important;height:164px!important;min-height:0!important;
 align-self:stretch!important;overflow:hidden!important;
 background:#f7f6f3!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .product-carousel img{
 width:100%!important;height:100%!important;
 object-fit:contain!important;cursor:zoom-in;touch-action:manipulation;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-arrow{
 width:33px!important;height:38px!important;font-size:27px!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-prev{left:5px!important}
#detailed-quote.apg-compact-builder #quote-product-select .variant-next{right:5px!important}
#detailed-quote.apg-compact-builder #quote-product-select .variant-bottom{
 grid-column:1!important;grid-row:3!important;
 display:flex!important;flex-direction:column!important;
 min-width:0!important;min-height:140px!important;
 padding:10px 11px 12px!important;gap:7px!important;
 align-self:stretch!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-line{
 display:flex!important;align-items:flex-start!important;
 font-size:14px!important;gap:7px!important;min-width:0!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-name{
 min-width:0!important;font-size:14px!important;line-height:1.3!important;
 display:-webkit-box!important;-webkit-box-orient:vertical!important;
 -webkit-line-clamp:3!important;overflow:hidden!important;
 overflow-wrap:anywhere!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-count{
 font-size:12px!important;white-space:nowrap!important;flex:none!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-price-row{
 display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;
 gap:5px!important;min-width:0!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-price{
 font-size:21px!important;line-height:1.25!important;white-space:normal!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-unit{
 font-size:13px!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-controls{
 display:flex!important;align-items:center!important;justify-content:flex-start!important;
 gap:6px!important;min-height:38px!important;margin-top:auto!important;padding-top:2px!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-quantity-label{
 font-size:14px!important;gap:6px!important;flex-wrap:wrap!important;
}
#detailed-quote.apg-compact-builder #quote-product-select .variant-quantity{
 width:63px!important;min-height:36px!important;font-size:15px!important;padding:5px!important;
}
/* Card count follows available viewport; the four-column layout is for desktop. */
@media(max-width:1199px){
 #detailed-quote.apg-compact-builder #quote-product-select .product-checkboxes{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
 }
}
@media(max-width:900px){
 #detailed-quote.apg-compact-builder #quote-product-select .product-checkboxes{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
 }
}
@media(max-width:600px){
 #detailed-quote.apg-compact-builder #quote-product-select .product-checkboxes{
  grid-template-columns:minmax(0,1fr)!important;gap:10px!important;
 }
 #detailed-quote.apg-compact-builder #quote-product-select .product-choice-card{
  grid-template-rows:auto 205px minmax(0,1fr)!important;
 }
 #detailed-quote.apg-compact-builder #quote-product-select .product-carousel{
  height:205px!important;
 }
 #detailed-quote.apg-compact-builder #quote-product-select .variant-bottom{
  min-height:125px!important;
 }
}
/* Larger images still open in the previously implemented full-screen zoom. */

/* Full-image viewer. Size requested = 4x on-page thumbnail, bounded to device viewport. */
.apg-material-lightbox[hidden]{display:none!important}
.apg-material-lightbox{
 position:fixed;inset:0;z-index:90000;
 background:rgba(11,18,24,.88);
 display:flex;align-items:center;justify-content:center;
 padding:50px 18px 24px;box-sizing:border-box;
}
.apg-material-lightbox-image{
 display:block;width:auto;height:auto;max-width:94vw;max-height:83vh;
 object-fit:contain;border-radius:6px;
 background:#fff;box-shadow:0 13px 55px #0008;
}
.apg-material-lightbox-close{
 position:absolute;top:max(12px,env(safe-area-inset-top));right:15px;
 width:48px;height:48px;z-index:2;border:1px solid #ffffff75;
 border-radius:50%;background:#fdfdfd;color:#18232a;
 font:800 30px/1 Arial,sans-serif;cursor:pointer;
}
.apg-material-lightbox-close:focus-visible{outline:3px solid #eac05a;outline-offset:3px}
.apg-material-lightbox-title{
 position:absolute;left:18px;right:70px;top:18px;
 color:white;font:600 16px/1.3 Arial,sans-serif;
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.apg-material-lightbox-open{overflow:hidden!important}

.apg-material-lightbox-scroll{
 display:block;position:relative;overflow:auto;overscroll-behavior:contain;
 max-width:100%;width:min(96vw,1200px);height:calc(100vh - 92px);
 touch-action:pan-x pan-y;scrollbar-width:thin;
 text-align:left;background:#202428;border:1px solid #ffffff29;border-radius:8px;
}
.apg-material-lightbox .apg-material-lightbox-image{
 max-width:none!important;max-height:none!important;
 object-fit:contain!important;margin:0;background:#fff;
}
