/* Catalog integrity — 2026-10-24. Scoped media/layout rules loaded after legacy catalog styles.
   Fixed media frames prevent image intrinsic sizes from expanding cards or overlapping descriptions. */
body.rosh-x009-catalog .cx-discovery,
body.rosh-x009-catalog .catalog-shell,
body.rosh-x009-catalog #products {min-width:0;max-width:100%}
body.rosh-x009-catalog .cx-rail {
  width:100%;max-width:100%;min-width:0;display:flex;align-items:stretch;
  overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;
  overscroll-behavior-x:contain;scrollbar-width:thin;
  gap:14px;padding:5px 4px 18px;
}
body.rosh-x009-catalog .cx-tile {
  flex:0 0 clamp(210px,23vw,270px);width:clamp(210px,23vw,270px);
  min-width:0;max-width:calc(100% - 4px);min-height:0;
  display:flex;flex-direction:column;overflow:hidden;
  scroll-snap-align:start;
}
body.rosh-x009-catalog .cx-tile-image {
  position:relative;display:flex;align-items:center;justify-content:center;
  flex:0 0 165px;width:100%;height:165px;min-width:0;min-height:0;
  overflow:hidden;border-radius:10px;background:#eef2f5;
}
body.rosh-x009-catalog .cx-tile-image img {
  position:absolute;inset:0;display:block;
  width:100%!important;height:100%!important;min-width:0;min-height:0;
  max-width:100%;max-height:100%;box-sizing:border-box;
  object-fit:contain;object-position:center;padding:12px;
}
body.rosh-x009-catalog .cx-tile-meta {flex:0 0 auto;overflow-wrap:anywhere}
body.rosh-x009-catalog .cx-tile strong {
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;
  overflow:hidden;min-height:0;line-height:1.38;overflow-wrap:anywhere;
  color:inherit;
}
body.rosh-x009-catalog .cx-tile-sku {overflow-wrap:anywhere}
body.rosh-x009-catalog .cx-tile-foot {padding-top:9px}
body.rosh-x009-catalog #products .product {
  min-width:0;min-height:0;overflow:hidden;
}
body.rosh-x009-catalog #products .product-photo {
  position:relative;display:flex;align-items:center;justify-content:center;
  flex:0 0 210px;width:100%;height:210px!important;
  min-height:0!important;max-height:210px;
  aspect-ratio:auto!important;overflow:hidden;isolation:isolate;
}
body.rosh-x009-catalog #products .product-photo img {
  position:absolute;inset:0;display:block;
  width:100%!important;height:100%!important;
  max-width:100%;max-height:100%;min-width:0;min-height:0;
  padding:clamp(12px,1.3vw,19px);
  object-fit:contain;object-position:center;box-sizing:border-box;
}
body.rosh-x009-catalog #products .product-body {
  position:relative;z-index:1;min-width:0;max-width:100%;
  overflow-wrap:anywhere;
}
body.rosh-x009-catalog #products .product h3 {min-height:0;overflow-wrap:anywhere}
body.rosh-x009-catalog #products .product-bottom {gap:9px}
body.rosh-x009-catalog #products .product-bottom a {
  text-align:center;white-space:normal;overflow-wrap:anywhere;
}
body.rosh-x009-catalog :is(.product-photo,.cx-tile-image) > :is(.placeholder,.catalog-photo-fallback) {
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;width:100%;height:100%;min-width:0;padding:16px;
  text-align:center;font-size:12px;line-height:1.45;font-weight:500;
  color:#667887;background:#edf2f5;
}
body.rosh-x009-catalog .catalog-photo-fallback-icon {
  width:40px;height:40px;display:grid;place-items:center;
  border:1px solid rgba(90,115,133,.20);border-radius:12px;
  color:#8799a7;font-size:21px;
}
html[data-rosh-theme="dark"] body.rosh-x009-catalog .cx-tile strong {color:var(--rosh-ink)}
html[data-rosh-theme="dark"] body.rosh-x009-catalog .cx-all,
html[data-rosh-theme="dark"] body.rosh-x009-catalog .cx-tile-foot,
html[data-rosh-theme="dark"] body.rosh-x009-catalog .product-inspect {color:#80c4ed}
@media (max-width:740px) {
 body.rosh-x009-catalog .cx-rail {gap:11px;padding-bottom:12px;scroll-snap-type:x mandatory}
 body.rosh-x009-catalog .cx-tile {
   flex:0 0 min(76vw,310px)!important;width:min(76vw,310px);
 }
 body.rosh-x009-catalog .cx-tile-image {
   height:175px!important;flex-basis:175px;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product-photo {
   height:155px!important;max-height:155px;flex-basis:155px;
 }
 body.rosh-x009-catalog #products .product-body {min-width:0}
 body.rosh-x009-catalog .catalog-tools > * {min-width:0}
}
@media (max-width:520px) {
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) {
   display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px!important;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product-photo {
   height:140px!important;max-height:140px;flex-basis:140px;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product-bottom {
   flex-direction:column;align-items:stretch;
 }
 body.rosh-x009-catalog #products.catalog-list-view .product-photo,
 body.rosh-x009-catalog #products.catalog-compact-view .product-photo {
   width:100%;height:100%!important;max-height:none;min-height:145px!important;
 }
 body.rosh-x009-catalog #products .product-body {padding:12px!important}
 body.rosh-x009-catalog #products .product-bottom a {width:100%}
}
/* Very narrow devices need a single legible product row, not two 140px cards. */
@media (max-width:365px) {
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) {
   grid-template-columns:minmax(0,1fr)!important;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product {
   display:grid;grid-template-columns:minmax(105px,38%) minmax(0,1fr);
   align-items:stretch;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product-photo {
   width:100%;height:100%!important;min-height:185px!important;
   max-height:none;aspect-ratio:auto!important;flex-basis:auto;
 }
 body.rosh-x009-catalog #products:not(.catalog-list-view):not(.catalog-compact-view) .product-body {
   min-width:0;
 }
}
@media (prefers-reduced-motion:reduce) {
 body.rosh-x009-catalog .cx-tile,
 body.rosh-x009-catalog #products .product-photo img {transition:none!important}
}