/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/


.custom-product-gallery {
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  display: block;
}

/* Swiper içindeki görseller */
.custom-product-gallery .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

/* Ok butonları */
.custom-product-gallery .swiper-button-prev,
.custom-product-gallery .swiper-button-next {
  width: 32px !important;
  height: 32px !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  border-radius: 50% !important;
  color: #fff !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  position: absolute !important;
}

/* Ok ikonları */
.custom-product-gallery .swiper-button-prev::after,
.custom-product-gallery .swiper-button-next::after {
  font-size: 16px !important;
  color: white !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

/* Ok pozisyonları */
.custom-product-gallery .swiper-button-next { right: 10px !important; }
.custom-product-gallery .swiper-button-prev { left: 10px !important; }

/* 🧼 Mağaza/kategori sayfalarında eski görselleri temizce kaldır */
body.archive.woocommerce .product-grid-item figure:not(.custom-product-gallery),
body.archive.woocommerce .product-grid-item .product-image-wrapper:not(:has(.custom-product-gallery)),
body.archive.woocommerce .product-grid-item .product-element-top:not(:has(.custom-product-gallery)),
body.archive.woocommerce .product-grid-item a.woocommerce-LoopProduct-link > figure:not(:has(.custom-product-gallery)) {
  display: none !important;
}

/* İkinci img varsa, onu da gizle */
body.archive.woocommerce .product-grid-item figure > img:nth-of-type(2) {
  display: none !important;
}
