/*
 * Suntex Pages v8.8: full-bleed photo framing.
 * Only photographic placeholders are targeted; sourcing map, flags, and logos are excluded.
 * Preserve the existing layout and container ratios while preventing image overflows.
 */

/* Image frames must be able to shrink inside Elementor and CSS grids. */
.stx-pg-block .grid2 > .visual,
.stx-pg-block .card-img,
.stx-pg-block .split-visual .image,
.stx-pg-block .product-hero .image,
.stx-pg-block[data-suntex-section="index__03"] .stx-v87-fit-visual {
  position:relative!important;
  box-sizing:border-box!important;
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
  isolation:isolate;
}
.stx-pg-block .grid2 > *,
.stx-pg-block .card,
.stx-pg-block .split-visual > *,
.stx-pg-block .product-hero > * {
  min-width:0!important;
}

/* Homepage What Suntex Does: keep its approved frame, fill the frame completely. */
.stx-pg-block[data-suntex-section="index__03"] .stx-v87-fit-visual {
  display:block!important;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:5 / 4!important;
  background:#f3f3f1;
}

/* The product category cards keep their established card sizing. */
.stx-pg-block[data-suntex-section="index__04"] .card-img,
.stx-pg-block[data-suntex-section="products__01"] .card-img {
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:1.15 / 1!important;
  min-height:0!important;
  padding:0!important;
}

/* Text/photo sections: give the visual area a dependable height and avoid flex centering gaps. */
.stx-pg-block .grid2 > .visual {
  display:block!important;
  width:100%!important;
  min-height:420px!important;
  height:100%!important;
  max-height:none!important;
  padding:0!important;
  align-self:stretch!important;
}

/* Full-width image panes on about and product detail pages. */
.stx-pg-block .split-visual .image,
.stx-pg-block .product-hero .image {
  display:block!important;
  width:100%!important;
  min-height:480px!important;
  height:100%!important;
  padding:0!important;
}

/*
 * Force photos to cover their frames instead of the old `contain` + `max-height:320px` rules.
 * Absolutely positioned images cannot expand their grid cell and bleed past its edges.
 */
.stx-pg-block .grid2 > .visual > img,
.stx-pg-block[data-suntex-section="index__03"] .stx-v87-fit-visual > img,
.stx-pg-block .card-img > img,
.stx-pg-block .split-visual .image > img,
.stx-pg-block .product-hero .image > img {
  position:absolute!important;
  top:0!important;
  right:0!important;
  bottom:0!important;
  left:0!important;
  inset:0!important;
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  height:100%!important;
  min-width:100%!important;
  min-height:100%!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  object-fit:cover!important;
  object-position:center center!important;
  transform:none!important;
}

/* Gallery photographs are direct children of the grid; retain their original tile heights. */
.stx-pg-block .gallery {
  min-width:0!important;
  max-width:100%!important;
  overflow:hidden!important;
}
.stx-pg-block .gallery > img {
  display:block!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  max-height:none!important;
  padding:0!important;
  margin:0!important;
  object-fit:cover!important;
  object-position:center!important;
}

/* Keep hero and new Phase 2 photographic strips full-bleed too. */
.stx-pg-block .hero > img.hero-bg,
.stx-pg-block .stx-p2-photo > img,
.stx-pg-block .stx-v85-process-visual > img,
.stx-pg-block .stx-p2-boutique-photo {
  object-fit:cover!important;
  object-position:center!important;
  max-height:none!important;
}

@media (max-width:980px) {
  .stx-pg-block .grid2 > .visual { min-height:380px!important; }
  .stx-pg-block .product-hero .image { min-height:520px!important; }
}
@media (max-width:620px) {
  .stx-pg-block[data-suntex-section="index__03"] .stx-v87-fit-visual { aspect-ratio:4 / 3!important; }
  .stx-pg-block .grid2 > .visual { min-height:340px!important; }
  .stx-pg-block .split-visual .image { min-height:360px!important; }
  .stx-pg-block .product-hero .image { min-height:440px!important; }
}
