/* Product Gallery Styles */
.product-gallery-container {
  position: relative;
  max-width: 100%;
}

/* Main Swiper */
.gallery-main {
  width: 100%;
  margin-bottom: 10px;
  position: relative;
}

.gallery-main .swiper-wrapper {
  position: relative;
  height: 550px;
}

.gallery-main .swiper-slide {
  text-align: center;
  background: white;
  display: flex;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.gallery-main .swiper-slide img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Force pagination to bottom */
.product-gallery-container .swiper-pagination {
  position: absolute !important;
  bottom: 10px !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 10 !important;
  width: 100% !important;
  text-align: center;
}

/* Bullet pagination styling */
.product-gallery-container .swiper-pagination-bullet {
  width: 8px !important;
  height: 8px !important;
  background: rgba(0, 0, 0, 0.5) !important;
  opacity: 1 !important;
  margin: 0 4px !important;
}

.product-gallery-container .swiper-pagination-bullet-active {
  background: #000 !important;
  width: 10px !important;
  height: 10px !important;
}

/* Thumbnails container */
.gallery-thumbs {
  box-sizing: border-box;
  padding: 10px 0;
}

/* Square thumbnails with aspect ratio */
.gallery-thumbs .swiper-slide {
  width: 25%;
  opacity: 0.4;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  border-radius: 15px;
  overflow: hidden;
  /* Force square aspect ratio */
  aspect-ratio: 1 / 1;
  position: relative;
}

.gallery-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  border-color: #000;
}

.gallery-thumbs .swiper-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px; /* Slightly smaller to account for border */
}

/* Navigation arrows */
.swiper-button-next,
.swiper-button-prev {
  color: #000;
  background: rgba(255, 255, 255, 0.8);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 20px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .gallery-thumbs .swiper-slide {
    width: 20%;
  }
}

/* Single image fallback */
.single-product-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Main image height control */
@media (min-width: 200px) {
  .gallery-main .swiper-slide img {
    height: 500px;
    width: auto;
  }
}