/* Scoped equal-height behaviour for database-backed catalogue cards. */
.products-list.grid,.products-list.so-filter-gird,.nmg-popular-static-grid,.nmg-quality-reference-grid{align-items:stretch}
.products-list.grid>.product-layout,.products-list.so-filter-gird>.product-layout,.nmg-popular-static-grid>.product-layout,.nmg-quality-reference-grid>.nmg-quality-ref-card{align-self:stretch}
.products-list.grid>.product-layout>.product-item-container,.products-list.so-filter-gird>.product-layout>.product-item-container,.nmg-popular-static-grid>.product-layout>.product-item-container,.nmg-quality-reference-grid>.nmg-quality-ref-card{display:flex;flex-direction:column;width:100%;height:100%}
.products-list.grid .product-item-container>.left-block,.products-list.so-filter-gird .product-item-container>.left-block,.nmg-popular-static-grid .product-item-container>.left-block{display:block!important;flex:0 0 var(--nmg-equal-image-height,240px)!important;width:100%!important;height:var(--nmg-equal-image-height,240px)!important;min-height:var(--nmg-equal-image-height,240px)!important;max-height:var(--nmg-equal-image-height,240px)!important;box-sizing:border-box!important;overflow:hidden!important}
.products-list.grid .product-image-container,.products-list.so-filter-gird .product-image-container,.nmg-popular-static-grid .product-image-container,.nmg-quality-reference-grid .nmg-quality-ref-media{display:flex!important;align-items:center!important;justify-content:center!important;height:var(--nmg-equal-image-height,240px)!important;min-height:var(--nmg-equal-image-height,240px)!important;box-sizing:border-box!important;overflow:hidden!important}
.products-list.grid .product-image-container>a,.products-list.so-filter-gird .product-image-container>a,.nmg-popular-static-grid .product-image-container>a,.nmg-quality-reference-grid .nmg-quality-ref-media>a{display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important}
.products-list.grid .product-image-container img,.products-list.so-filter-gird .product-image-container img,.nmg-popular-static-grid .product-image-container img,.nmg-quality-reference-grid .nmg-quality-ref-image{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important}
.products-list.grid .product-image-container:before,.products-list.so-filter-gird .product-image-container:before,.nmg-popular-static-grid .product-image-container:before,.nmg-quality-reference-grid .nmg-quality-ref-media:before{pointer-events:none!important}
.products-list.grid .product-image-container:not(.second_img) .img-1,.products-list.so-filter-gird .product-image-container:not(.second_img) .img-1,.nmg-popular-static-grid .product-image-container:not(.second_img) .img-1{opacity:1!important;visibility:visible!important;position:relative!important;transform:none!important}
.products-list.grid .product-item-container>.right-block,.products-list.so-filter-gird .product-item-container>.right-block,.nmg-popular-static-grid .product-item-container>.right-block,.nmg-quality-reference-grid .nmg-quality-ref-body{display:flex!important;flex:1 1 auto!important;flex-direction:column!important;min-width:0}
.products-list.grid .right-block>h4,.products-list.so-filter-gird .right-block>h4,.nmg-popular-static-grid .right-block>h4,.nmg-quality-reference-grid .nmg-quality-ref-name{min-height:var(--nmg-equal-name-height,0)!important;height:auto!important;overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere}
.nmg-popular-static-grid .nmg-popular-description{min-height:var(--nmg-equal-description-height,0)!important;height:auto!important;overflow:visible!important}
.products-list.grid .right-block>.button-group,.products-list.so-filter-gird .right-block>.button-group,.nmg-popular-static-grid .right-block>.button-group,.nmg-quality-reference-grid .nmg-quality-ref-actions{margin-top:auto!important}

/* Compact product-card actions; retain the existing colours and shape. */
html body .products-list.grid .button-group.cartinfo--static,
html body .products-list.so-filter-gird .button-group.cartinfo--static,
html body .nmg-popular-static-grid .button-group.cartinfo--static,
html body .nmg-quality-reference-grid .nmg-quality-ref-actions{
  width:170px!important;
  max-width:calc(100% - 24px)!important;
  height:auto!important;
  min-height:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
}
html body .products-list.grid .button-group.cartinfo--static>.addToCart,
html body .products-list.so-filter-gird .button-group.cartinfo--static>.addToCart,
html body .nmg-popular-static-grid .button-group.cartinfo--static>.addToCart,
html body .nmg-quality-reference-grid .nmg-quality-ref-actions>.addToCart{
  width:100%!important;
  height:46px!important;
  min-height:46px!important;
  max-height:46px!important;
  padding:0 14px!important;
  font-size:13px!important;
}
html body .products-list.grid .nmg-view-product-wrap>a.nmg-view-product-button,
html body .products-list.so-filter-gird .nmg-view-product-wrap>a.nmg-view-product-button,
html body .nmg-popular-static-grid .nmg-view-product-wrap>a.nmg-view-product-button,
html body .nmg-quality-reference-grid .nmg-quality-ref-actions>.product-buttons__view{
  width:170px!important;
  min-width:0!important;
  max-width:calc(100% - 24px)!important;
  height:42px!important;
  min-height:42px!important;
  max-height:42px!important;
  padding:0 14px!important;
  font-size:13px!important;
}
html body .nmg-quality-reference-grid .nmg-quality-ref-actions>.product-buttons__view{
  max-width:100%!important;
}

/* Homepage product actions: both controls share one responsive width. */
html body #so_listing_tabs_4 .nmg-popular-static-grid .button-group.cartinfo--static,
html body #so_listing_tabs_4 .nmg-popular-static-grid .nmg-view-product-wrap{
  width:170px!important;
  max-width:calc(100% - 24px)!important;
  margin-left:auto!important;
  margin-right:auto!important;
  box-sizing:border-box!important;
}
html body #so_listing_tabs_4 .nmg-popular-static-grid .nmg-view-product-wrap>a,
html body #so_listing_tabs_4 .nmg-popular-static-grid .button-group.cartinfo--static>.addToCart,
html body .nmg-quality-reference-grid .nmg-quality-ref-actions>.addToCart,
html body .nmg-quality-reference-grid .nmg-quality-ref-actions>.product-buttons__view{
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
}
