/* Phase 4D.45.2: single-product-only, current and future Woo products. */
body.single-product div.product .woocommerce-product-gallery__image img:not(.zoomImg){
  display:block!important;width:auto!important;height:auto!important;max-width:min(100%,470px)!important;
  max-height:470px!important;object-fit:contain!important;margin-inline:auto!important;
}
body.single-product div.product .summary h1.product_title,
body.single-product .related.products .woocommerce-loop-product__title,
body.single-product .related.products .woocommerce-loop-product__title a{text-transform:none!important}
/* Aprin hides in-stock simple-product availability; keep Woo stock state visible for every product type. */
body.single-product div.product .summary p.stock{
  display:block!important;margin:12px 0 9px!important;color:#18262e!important;
  font:500 14px/1.5 Manrope,sans-serif!important;
}
body.single-product div.product .summary p.stock::before{display:none!important}
body.single-product div.product .summary p.stock.out-of-stock{color:#66737a!important}
body.single-product div.product .woocommerce-variation-availability p.stock{
  display:block!important;margin:12px 0 9px!important;color:#18262e!important;
  font:500 14px/1.5 Manrope,sans-serif!important;
}
body.single-product div.product .woocommerce-variation-availability p.stock::before{display:none!important}
body.single-product div.product .woocommerce-variation-availability p.stock.out-of-stock{color:#66737a!important}
/* Aprin's thumbnail Swiper adds arrow controls rendered as gray circles beneath the native rail. */
body.single-product .woocommerce-product-gallery .swiper-thumbs-horizontal > .swiper-button-next,
body.single-product .woocommerce-product-gallery .swiper-thumbs-horizontal > .swiper-button-prev{display:none!important}

/* Aprin's related carousel uses theme-wide breakpoints and oversized cards. Keep its links, use a compact grid here. */
body.single-product .related.products{margin-top:42px}
body.single-product .related.products h5{margin:0 0 20px;color:#18262e;font:600 24px/1.3 Manrope,sans-serif;text-transform:none}
body.single-product .related.products .aprin-theme-swiper,
body.single-product .related.products .aprin-swiper.swiper{overflow:visible!important}
body.single-product .related.products ul.products.swiper-wrapper{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:1fr;gap:18px;width:100%!important;
  margin:0!important;transform:none!important;
}
body.single-product .related.products li.product.swiper-slide{
  box-sizing:border-box;width:auto!important;min-width:0;height:auto!important;margin:0!important;padding:0!important;
}
body.single-product .related.products li.product .product-block{
  box-sizing:border-box;height:100%;padding:12px;border:1px solid #edf1f0;border-radius:9px;background:#fff;
}
body.single-product .related.products li.product .product-img-wrap{margin:0 0 10px}
body.single-product .related.products li.product .product-image img{
  display:block;width:auto!important;max-width:100%;height:190px!important;max-height:190px;
  object-fit:contain;margin:0 auto;
}
body.single-product .related.products li.product .second-image,
body.single-product .related.products li.product .group-action,
body.single-product .related.products li.product .count-review,
body.single-product .related.products li.product .button{display:none!important}
body.single-product .related.products li.product .woocommerce-loop-product__title{
  margin:0 0 8px;color:#18262e;font:600 15px/1.4 Manrope,sans-serif!important;
  display:block!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  overflow-wrap:break-word;-webkit-line-clamp:unset!important;
}
body.single-product .related.products li.product .price{
  margin:0;color:#18262e;font:600 15px/1.4 Manrope,sans-serif;
}
@media(max-width:1199px){
  body.single-product div.product .woocommerce-product-gallery__image img:not(.zoomImg){
    max-width:min(100%,430px)!important;max-height:430px!important;
  }
  body.single-product .related.products ul.products.swiper-wrapper{grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}
  body.single-product .related.products li.product .product-image img{height:170px!important;max-height:170px}
}
@media(max-width:600px){
  /* Aprin fixes the FlexSlider viewport at 395px below 425px, even when the gallery is narrower. */
  body.single-product div.product .woocommerce-product-gallery .flex-viewport{
    width:100%!important;max-width:100%;margin-bottom:32px;
  }
  body.single-product div.product .woocommerce-product-gallery__image img:not(.zoomImg){
    max-width:min(100%,360px)!important;max-height:360px!important;
    margin-left:auto!important;margin-right:auto!important;
  }
  body.single-product .related.products{margin-top:30px}
  body.single-product .related.products h5{font-size:20px;margin-bottom:14px}
  body.single-product .related.products ul.products.swiper-wrapper{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  body.single-product .related.products li.product .product-block{padding:8px}
  body.single-product .related.products li.product .product-image img{height:130px!important;max-height:130px}
  body.single-product .related.products li.product .woocommerce-loop-product__title{font-size:13px!important;line-height:1.4!important}
  body.single-product .related.products li.product .price{font-size:13px}
}
/* Aprin's fade image swap must not hide the primary image when second-image is disabled. */
body.single-product .related.products .product-block .product-img-wrap .product-image,
body.single-product .related.products .product-block:hover .product-img-wrap .product-image{
  opacity:1!important;visibility:visible!important;transform:none!important;transition:none!important;
  display:flex;align-items:center;justify-content:center;height:190px;
}
body.single-product .related.products .product-block .product-image img{
  opacity:1!important;visibility:visible!important;transform:none!important;transition:none!important;
  height:auto!important;max-height:190px;width:auto!important;object-fit:contain;
}
body.single-product .related.products .product-block{transition:border-color .15s ease,box-shadow .15s ease}
body.single-product .related.products .product-block:hover,
body.single-product .related.products .product-block:focus-within{
  border-color:#bfc8ce;box-shadow:0 2px 8px rgba(24,38,46,.05);transform:none!important;
}
body.single-product .related.products .product-caption{display:flex;flex-direction:column;flex:1}
body.single-product .related.products .product-caption .price{margin-top:auto}
@media(max-width:1199px){
  body.single-product .related.products .product-block .product-img-wrap .product-image,
  body.single-product .related.products .product-block:hover .product-img-wrap .product-image{height:170px}
  body.single-product .related.products .product-block .product-image img{max-height:170px}
}
@media(max-width:600px){
  body.single-product .related.products .product-block .product-img-wrap .product-image,
  body.single-product .related.products .product-block:hover .product-img-wrap .product-image{height:130px}
  body.single-product .related.products .product-block .product-image img{max-height:130px}
}
