/* REC0DET Shop subcategory square grid restoration, Nov 2026.
   All Shop subcategory renderer classes (legacy, coded icons and reference cards).
   Service subcategory cards are excluded. Other modules remain untouched. */
#viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
#viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
#viewSubcats #subcatGrid.electronicsV99Grid,
#viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) {
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  grid-auto-rows:auto!important;
  align-items:start!important;
  justify-items:stretch!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
}
#viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid > .electronicsCodedSubcategoryCard,
#viewSubcats #subcatGrid.recodetCodedSubcategoryGrid > .recodetCodedSubcategoryCard,
#viewSubcats #subcatGrid.electronicsV99Grid > .electronicsV99Card,
#viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) > .tile {
  display:flex!important;
  position:relative!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:1/1!important;
  padding:0!important;
  margin:0!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
  border-radius:13px!important;
  background:#0e1013!important;
}
#viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid > .electronicsCodedSubcategoryCard > .electronicsCodedSubcategoryImage,
#viewSubcats #subcatGrid.recodetCodedSubcategoryGrid > .recodetCodedSubcategoryCard > .recodetCodedSubcategoryImage {
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:0!important;
  margin:0!important;
  box-sizing:border-box!important;
  flex:1 1 auto!important;
}
#viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) > .tile > .img {
  width:100%!important;
  height:auto!important;
  aspect-ratio:1/1!important;
  min-height:0!important;
}
#viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) > .tile > .label {
  max-width:100%!important;
  overflow:hidden!important;
  text-align:center!important;
  font-size:clamp(9px,2.5vw,13px)!important;
}
@media(max-width:370px) {
  #viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
  #viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
  #viewSubcats #subcatGrid.electronicsV99Grid,
  #viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) {
    gap:6px!important;
  }
}
@media(min-width:761px) {
  #viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
  #viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
  #viewSubcats #subcatGrid.electronicsV99Grid,
  #viewSubcats #subcatGrid.gridCat:not(:has(> .serviceSubcategoryCard)) {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:12px!important;
  }
}
/* Price is a visible part of every Shop product card; never suppress it
   with card-compaction or catalogue-only display rules. */
#viewProducts .shopProductCard .shopProductBottom .shopPriceDisplay,
#viewShopSaved .shopProductCard .shopProductBottom .shopPriceDisplay {
  display:block!important;
  color:#ecc864!important;
  font-size:clamp(10px,2.7vw,14px)!important;
  font-weight:850!important;
  line-height:1.25!important;
  min-width:0!important;
  overflow-wrap:anywhere!important;
}
#viewProducts .shopProductCard .shopProductBottom .shopPriceDisplay[data-kind="indicative"],
#viewShopSaved .shopProductCard .shopProductBottom .shopPriceDisplay[data-kind="indicative"] {
  color:#bca778!important;
}


/* Specificity repair: an earlier Shop stylesheet forces one full-width row
   using body:has(#bottomBar[data-module="shop"]) #subcatGrid. The selectors
   below must win that rule and preserve the approved three-across layout. */
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.gridCat,
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsV99Grid {
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:8px!important;
  width:100%!important;
  max-width:100%!important;
}
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid > button.tile,
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid > .electronicsV99Card {
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-height:none!important;
  height:auto!important;
  aspect-ratio:1/1!important;
  padding:0!important;
  text-align:center!important;
}
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid > button > [class$="Art"] {
  position:relative!important;
  width:65%!important;
  height:auto!important;
  margin:0 auto!important;
  flex:0 1 auto!important;
}
body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid > button > [class$="Label"] {
  position:relative!important;
  margin:0!important;
  width:100%!important;
  text-align:center!important;
}
@media(max-width:370px){
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.gridCat,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsV99Grid{gap:6px!important}
}
@media(min-width:761px){
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.gridCat,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsCodedSubcategoryGrid,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.recodetCodedSubcategoryGrid,
  body:has(#bottomBar[data-module="shop"]) #viewSubcats #subcatGrid.electronicsV99Grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
