/* OUTER: must clear sidebar floats and occupy full row */
.nwss-cat-tiles-below-outer{
  clear: both;
  width: 100%;
  margin: 28px 0 10px;
}

/* INNER: keep it inside theme container width */
.nwss-cat-tiles-below{
  width: 100%;
}

/* If wrapper ends up outside theme container, constrain it a bit */
.site-content .nwss-cat-tiles-below,
#content .nwss-cat-tiles-below{
  padding-left: 0;
  padding-right: 0;
}

/* Ensure the moved widget behaves like a normal block */
.nwss-cat-tiles-below .nwss-moved-cat-tiles,
.nwss-cat-tiles-below .nwss-moved-cat-tiles .elementor-widget-container{
  width: 100% !important;
  max-width: 100% !important;
}

/* Critical fixes:
   - Theme had selectors that may not apply after move.
   - Restore positioning context so absolute overlays don't expand to full row. */
.nwss-cat-tiles-below .grid-item,
.nwss-cat-tiles-below .product-cat,
.nwss-cat-tiles-below .category-product-img{
  position: relative !important;
}

/* Keep overlay inside each tile */
.nwss-cat-tiles-below .product-cat-content{
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  width: auto !important;
  max-width: none !important;
}

/* Restore grid (the theme uses class="layout-2 d-grid" i.e. 2 classes) */
.nwss-cat-tiles-below .layout-2.d-grid{
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

/* Tablet */
@media (max-width: 1024px){
  .nwss-cat-tiles-below .layout-2.d-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 767px){
  .nwss-cat-tiles-below .layout-2.d-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

/* Make tiles visually consistent and avoid huge vertical stretching */
.nwss-cat-tiles-below .category-product-img img{
  width: 100% !important;
  height: auto !important;
  display: block !important;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* If theme sets weird heights, cap them on small screens */
@media (max-width: 767px){
  .nwss-cat-tiles-below .category-product-img img{
    max-height: 360px;
  }
}
