/* enucz V1.4.11 – product grid stability / category infinite loading */

/* ---------- Universal product media safety ---------- */
.product-grid{min-width:0}
.product-card{
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  position:relative !important;
  isolation:isolate;
  contain:layout paint;
}
.product-card .product-image,
.product-media-safe{
  width:100% !important;
  max-width:100% !important;
  overflow:hidden !important;
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:none !important;
  box-sizing:border-box !important;
  isolation:isolate;
}
.product-card .product-image img,
.product-media-safe img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  max-width:100% !important;
  max-height:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  object-fit:contain !important;
  object-position:center center !important;
  box-sizing:border-box !important;
  margin:0 !important;
  transform:none !important;
}
.product-card .product-info{
  position:relative !important;
  z-index:3 !important;
  min-width:0 !important;
  width:100% !important;
  overflow:hidden !important;
  background:#fff !important;
}
.product-card .product-info h3,
.product-card .product-info h3 a{
  min-width:0 !important;
  max-width:100% !important;
  overflow:hidden !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
.product-card .product-info h3{
  display:-webkit-box !important;
  -webkit-box-orient:vertical !important;
  -webkit-line-clamp:3 !important;
  line-clamp:3 !important;
}

/* homepage: exactly 12 products fit into a stable responsive grid */
.home-recommended-grid{grid-template-columns:repeat(6,minmax(0,1fr)) !important;align-items:stretch !important}
.home-recommended-card{display:flex !important;flex-direction:column !important;height:100% !important}
.home-recommended-card .product-image{height:215px !important;padding:14px !important;background:#fafbfc !important}
.home-recommended-card .product-info{flex:1 !important;display:flex !important;flex-direction:column !important}
.home-recommended-card .price-line{margin-top:auto !important;padding-top:8px !important}
.random-showcase-category{display:block;margin-top:5px;color:#8c9196;font-size:10px;font-weight:700}

/* ---------- Category layout: sidebar and result column never collide ---------- */
.v141-catalog-layout{
  grid-template-columns:260px minmax(0,1fr) !important;
  column-gap:18px !important;
  row-gap:0 !important;
  width:100% !important;
}
.trendy-filter-sidebar{
  width:260px !important;
  min-width:260px !important;
  max-width:260px !important;
  max-height:none !important;
  overflow:visible !important;
  align-self:start !important;
  scrollbar-width:none !important;
}
.trendy-filter-sidebar::-webkit-scrollbar{display:none !important}
.trendy-filter-sidebar>form{min-width:0 !important;overflow:visible !important}
.v141-catalog-results,.catalog-results{min-width:0 !important;width:100% !important;overflow:visible !important}
.catalog-results-toolbar{width:100% !important;min-width:0 !important;position:relative !important;z-index:2 !important}
.category-product-grid{width:100% !important;min-width:0 !important;align-items:stretch !important}
.category-product-card{display:flex !important;flex-direction:column !important;height:100% !important;min-width:0 !important}
.category-product-card .product-image{height:225px !important;padding:14px !important;flex:none !important}
.category-product-card .product-info{flex:1 !important;display:flex !important;flex-direction:column !important}
.category-product-card .product-info h3{min-height:49px !important;max-height:49px !important;-webkit-line-clamp:3 !important}
.category-product-card .seller-compare-line{margin-top:auto !important}

/* ---------- Infinite loading ---------- */
.catalog-infinite-loader{
  min-height:92px;
  margin:18px 0 4px;
  border:1px solid #e4e6e9;
  border-radius:9px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  color:#4c5156;
  text-align:center;
}
.catalog-infinite-loader b{font-size:11px}
.catalog-infinite-loader small{font-size:9px;color:#94999e}
.catalog-spinner{width:24px;height:24px;border:3px solid #eee;border-top-color:#f56600;border-radius:50%;animation:catalogSpin .75s linear infinite}
.catalog-infinite-loader.is-idle .catalog-spinner{animation-play-state:paused;opacity:.45}
.catalog-infinite-loader.is-error .catalog-spinner{display:none}
.catalog-infinite-loader.is-done{min-height:54px;background:transparent;border-style:dashed}
.catalog-infinite-loader.is-done .catalog-spinner{display:none}
.catalog-infinite-loader [data-infinite-retry]{margin-top:5px;border:0;border-radius:6px;background:#f56600;color:#fff;padding:8px 13px;font-size:10px;font-weight:800;cursor:pointer}
@keyframes catalogSpin{to{transform:rotate(360deg)}}

@media(max-width:1300px){
  .home-recommended-grid{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
}
@media(max-width:1200px) and (min-width:901px){
  .v141-catalog-layout{grid-template-columns:240px minmax(0,1fr) !important;column-gap:14px !important}
  .trendy-filter-sidebar{width:240px !important;min-width:240px !important;max-width:240px !important}
}
@media(max-width:900px){
  .home-recommended-grid{display:flex !important;overflow-x:auto !important;gap:9px !important;margin:0 -12px !important;padding:0 12px 6px !important;scroll-snap-type:x mandatory !important;scrollbar-width:none !important}
  .home-recommended-grid::-webkit-scrollbar{display:none}
  .home-recommended-card{flex:0 0 168px !important;width:168px !important;scroll-snap-align:start !important}
  .home-recommended-card .product-image{height:160px !important;padding:9px !important}
  .v141-catalog-layout{display:block !important;width:100% !important}
  .trendy-filter-sidebar{
    width:100% !important;min-width:0 !important;max-width:none !important;
    max-height:88vh !important;overflow-y:auto !important;overflow-x:hidden !important;
    scrollbar-width:thin !important;
  }
  .category-product-card .product-image{height:185px !important;padding:9px !important}
}
@media(max-width:560px){
  .home-recommended-card{flex-basis:158px !important;width:158px !important}
  .home-recommended-card .product-image{height:150px !important}
  .category-product-card .product-image{height:158px !important;padding:7px !important}
  .category-product-card .product-info h3{min-height:44px !important;max-height:44px !important}
  .catalog-infinite-loader{min-height:78px;margin-top:12px}
}
