/* Savannah Grid v1 - compact product cards on >=600px. Mobile (<600px) untouched.
   Rollback: delete mu-plugins/savannah-grid.php */

/* ---- shared compact card styling (>=768px) ---- */
@media (min-width:768px){
 body ul.products{gap:16px!important}
 body ul.products li.product{border-radius:14px!important;padding-bottom:12px!important}
 body ul.products li.product img,body ul.products li.product a img{margin:0 0 .75em!important}
 body ul.products li.product .woocommerce-loop-product__title{font-size:.9rem!important;line-height:1.3!important;padding:0 12px!important;margin-bottom:.3em!important}
 body ul.products li.product .price{font-size:.82rem!important;padding:0 12px!important;margin-bottom:.75em!important}
 body ul.products li.product .button{font-size:.78rem!important;padding:.55em 1em!important;margin-left:12px!important;margin-right:12px!important;line-height:1.2!important}
}

/* ---- tablet 768-1023: 4 per row ---- */
@media (min-width:768px) and (max-width:1023px){
 body ul.products.products,
 body.single-product .related ul.products,
 body.single-product .upsells ul.products{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

/* ---- small desktop 1024-1279: 5 per row ---- */
@media (min-width:1024px) and (max-width:1279px){
 body ul.products.products,
 body.single-product .related ul.products,
 body.single-product .upsells ul.products{grid-template-columns:repeat(5,minmax(0,1fr))!important}
}

/* ---- desktop >=1280: 6 per row ---- */
@media (min-width:1280px){
 body ul.products.products,
 body.single-product .related ul.products,
 body.single-product .upsells ul.products{grid-template-columns:repeat(6,minmax(0,1fr))!important}
}

/* ---- large tablet / phablet 600-767: 3 per row on catalog pages only (home + related keep 2) ---- */
@media (min-width:600px) and (max-width:767px){
 body.post-type-archive-product ul.products.products,
 body.tax-product_cat ul.products.products,
 body.tax-product_tag ul.products.products{grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

/* ---- related / upsells (4 items, centered heading): same card size as catalog, row centered ---- */
@media (min-width:1024px) and (max-width:1279px){
 body.single-product .related ul.products,
 body.single-product .upsells ul.products{grid-template-columns:repeat(4,calc((100% - 64px) / 5))!important;justify-content:center!important}
}
@media (min-width:1280px){
 body.single-product .related ul.products,
 body.single-product .upsells ul.products{grid-template-columns:repeat(4,calc((100% - 80px) / 6))!important;justify-content:center!important}
}
