/* ZAVRYNE 17.02 — PRODUCT LAYOUT REPAIR
   Restores a clean European product grid and prevents single cards from
   stretching across the full desktop viewport. Also removes legacy horizontal
   rail behaviour from shop/category/PDP recommendations. */

/* Core product collections */
body.woocommerce-shop .woocommerce-main ul.products,
body.tax-product_cat .woocommerce-main ul.products,
body.tax-product_tag .woocommerce-main 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 {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-auto-flow:row!important;
  gap:24px 18px!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin-left:auto!important;
  margin-right:auto!important;
  padding:0!important;
  overflow:visible!important;
  scroll-snap-type:none!important;
  touch-action:auto!important;
  cursor:default!important;
}

/* Never let a lone product become a full-width banner. */
body.woocommerce-shop .woocommerce-main ul.products > li.product,
body.tax-product_cat .woocommerce-main ul.products > li.product,
body.tax-product_tag .woocommerce-main 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 > * {
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  flex:none!important;
  margin:0!important;
  scroll-snap-align:none!important;
}

/* Consistent premium card media on WooCommerce archive grids. */
body.woocommerce-shop .woocommerce-main ul.products > li.product,
body.tax-product_cat .woocommerce-main ul.products > li.product,
body.tax-product_tag .woocommerce-main ul.products > li.product {
  display:block!important;
  overflow:hidden!important;
}
body.woocommerce-shop .woocommerce-main ul.products li.product a img,
body.tax-product_cat .woocommerce-main ul.products li.product a img,
body.tax-product_tag .woocommerce-main ul.products li.product a img {
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  height:auto!important;
  aspect-ratio:4/5!important;
  object-fit:cover!important;
  object-position:center top!important;
  margin:0 0 12px!important;
  border-radius:8px!important;
  background:#f5f1ec!important;
}
body.woocommerce-shop .woocommerce-main ul.products li.product .woocommerce-loop-product__title,
body.tax-product_cat .woocommerce-main ul.products li.product .woocommerce-loop-product__title,
body.tax-product_tag .woocommerce-main ul.products li.product .woocommerce-loop-product__title {
  font-size:14px!important;
  line-height:1.42!important;
  min-height:0!important;
  margin:0!important;
  padding:2px 0 0!important;
  white-space:normal!important;
  overflow:visible!important;
}
body.woocommerce-shop .woocommerce-main ul.products li.product .price,
body.tax-product_cat .woocommerce-main ul.products li.product .price,
body.tax-product_tag .woocommerce-main ul.products li.product .price {
  display:block!important;
  margin-top:7px!important;
  font-size:15px!important;
  line-height:1.25!important;
}

/* Progressive PDP feed should look like recommendations, not giant banners. */
body.single-product .zv1668-pdp-feed {
  width:min(1420px,calc(100% - 32px))!important;
  max-width:1420px!important;
  margin:26px auto 0!important;
  overflow:visible!important;
}
body.single-product .zv1668-feed-row {
  margin-bottom:26px!important;
}

/* Give recommendation areas a clean, deliberate width. */
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 {
  width:min(1420px,calc(100% - 32px))!important;
  max-width:1420px!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow:visible!important;
}

@media (max-width:1100px) {
  body.woocommerce-shop .woocommerce-main ul.products,
  body.tax-product_cat .woocommerce-main ul.products,
  body.tax-product_tag .woocommerce-main 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-main ul.products,
  body.tax-product_cat .woocommerce-main ul.products,
  body.tax-product_tag .woocommerce-main 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;
  }
}
