/* ZAVRYNE 17.03 — CUSTOMER-SAFE PRODUCT GRID EMERGENCY FIX
   Hard reset for WooCommerce/product recommendation cards that could collapse
   into ultra-narrow columns on desktop. This intentionally wins over all
   legacy grid/rail/card sizing rules. */

/* Product collections on archives and single-product recommendation areas. */
body.woocommerce-shop .woocommerce ul.products,
body.tax-product_cat .woocommerce ul.products,
body.tax-product_tag .woocommerce ul.products,
body.single-product .related.products ul.products,
body.single-product .upsells.products ul.products,
body.single-product .cross-sells ul.products,
body.single-product .zavryne-catalog-grid,
body.single-product .zv1520-look-grid,
body.single-product .look-builder-grid,
body.single-product .zv1520-rail__track,
body.single-product .zv38-complements__rail,
body.single-product .zv1668-feed-row {
  box-sizing:border-box!important;
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-auto-columns:auto!important;
  grid-auto-flow:row!important;
  align-items:start!important;
  justify-items:stretch!important;
  justify-content:stretch!important;
  gap:24px 18px!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding-left:0!important;
  padding-right:0!important;
  overflow:visible!important;
  overflow-x:visible!important;
  scroll-snap-type:none!important;
  transform:none!important;
}

/* Hard reset every direct card. width:auto is important for CSS Grid items. */
body.woocommerce-shop .woocommerce ul.products > li.product,
body.tax-product_cat .woocommerce ul.products > li.product,
body.tax-product_tag .woocommerce ul.products > li.product,
body.single-product .related.products ul.products > li.product,
body.single-product .upsells.products ul.products > li.product,
body.single-product .cross-sells ul.products > li.product,
body.single-product .zavryne-catalog-grid > *,
body.single-product .zv1520-look-grid > *,
body.single-product .look-builder-grid > *,
body.single-product .zv1520-rail__track > *,
body.single-product .zv38-complements__rail > *,
body.single-product .zv1668-feed-row > * {
  box-sizing:border-box!important;
  display:block!important;
  float:none!important;
  clear:none!important;
  position:relative!important;
  flex:none!important;
  flex-basis:auto!important;
  width:auto!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding-left:0!important;
  padding-right:0!important;
  transform:none!important;
  writing-mode:horizontal-tb!important;
  scroll-snap-align:none!important;
}

/* Text must wrap by words, never one or two letters per line. */
body.woocommerce-shop .woocommerce ul.products li.product *,
body.tax-product_cat .woocommerce ul.products li.product *,
body.tax-product_tag .woocommerce ul.products li.product *,
body.single-product .related.products ul.products li.product *,
body.single-product .upsells.products ul.products li.product *,
body.single-product .cross-sells ul.products li.product *,
body.single-product .zavryne-catalog-grid > * *,
body.single-product .zv1520-look-grid > * *,
body.single-product .look-builder-grid > * *,
body.single-product .zv1520-rail__track > * *,
body.single-product .zv38-complements__rail > * *,
body.single-product .zv1668-feed-row > * * {
  min-width:0!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  writing-mode:horizontal-tb!important;
}

/* Keep product media at a normal usable card width. */
body.woocommerce-shop .woocommerce ul.products li.product img,
body.tax-product_cat .woocommerce ul.products li.product img,
body.tax-product_tag .woocommerce ul.products li.product img,
body.single-product .related.products ul.products li.product img,
body.single-product .upsells.products ul.products li.product img,
body.single-product .cross-sells ul.products li.product img {
  display:block!important;
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  height:auto!important;
}

/* The wrappers themselves stay inside the usable viewport. */
body.single-product .related.products,
body.single-product .upsells.products,
body.single-product .cross-sells,
body.single-product .zavryne-catalog-more,
body.single-product .zv1520-complete-look,
body.single-product .zv1617-recommendations,
body.single-product .zv1668-pdp-feed {
  box-sizing:border-box!important;
  width:min(1420px,calc(100% - 32px))!important;
  min-width:0!important;
  max-width:1420px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow:visible!important;
}

@media (max-width:1100px) {
  body.woocommerce-shop .woocommerce ul.products,
  body.tax-product_cat .woocommerce ul.products,
  body.tax-product_tag .woocommerce ul.products,
  body.single-product .related.products ul.products,
  body.single-product .upsells.products ul.products,
  body.single-product .cross-sells ul.products,
  body.single-product .zavryne-catalog-grid,
  body.single-product .zv1520-look-grid,
  body.single-product .look-builder-grid,
  body.single-product .zv1520-rail__track,
  body.single-product .zv38-complements__rail,
  body.single-product .zv1668-feed-row {
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:20px 14px!important;
  }
}

@media (max-width:760px) {
  body.woocommerce-shop .woocommerce ul.products,
  body.tax-product_cat .woocommerce ul.products,
  body.tax-product_tag .woocommerce ul.products,
  body.single-product .related.products ul.products,
  body.single-product .upsells.products ul.products,
  body.single-product .cross-sells ul.products,
  body.single-product .zavryne-catalog-grid,
  body.single-product .zv1520-look-grid,
  body.single-product .look-builder-grid,
  body.single-product .zv1520-rail__track,
  body.single-product .zv38-complements__rail,
  body.single-product .zv1668-feed-row {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:18px 10px!important;
  }
  body.single-product .related.products,
  body.single-product .upsells.products,
  body.single-product .cross-sells,
  body.single-product .zavryne-catalog-more,
  body.single-product .zv1520-complete-look,
  body.single-product .zv1617-recommendations,
  body.single-product .zv1668-pdp-feed {
    width:calc(100% - 20px)!important;
    max-width:calc(100% - 20px)!important;
  }
}
