.carouselContainer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}

.productImage {
  width: 99%;
  height: auto;
  object-fit: contain;
  // transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

/* Fixed frame container to prevent layout shifts */
.fixedFrameContainer {
  position: relative;
  width: 100%;
  aspect-ratio: 1; /* Square container */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  overflow: hidden;
}

/* Style for product card (non-detail view) images */
.cardImage {
  width: auto;
  height: 300px; /* Increased height for card view */
  max-width: 100%;
  margin: auto;
  object-fit: contain;
}

/* Style for images inside detail view */
.detailImage {
  width: auto;
  height: auto;
  max-width: 90%;
  max-height: 90%;
  margin: auto;
  object-fit: contain;
}

/* Specific styles for the detail carousel */
.detailCarousel {
  .carouselContainer {
    height: auto;
    min-height: 400px;
  }

  .fixedFrameContainer {
    min-height: 400px;
  }
}

.imageWrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

// .transitioning img {
//   opacity: 0.8;
//   transition: opacity 0.3s ease-in-out;
// }

.arrowButton {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

  &:hover {
    background-color: white;
  }

  svg {
    color: #333;
  }
}

/* Fixed positions for arrows - they won't move with image size changes */
.leftArrow {
  left: 8px;
}

.rightArrow {
  right: 8px;
}

/* Make sure the carousel wrapper has a defined position */
.carouselWrapper {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carouselContainer:hover .arrowButton {
  opacity: 1;
}

.indicators {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(200, 200, 200, 0.7);
  transition: background-color 0.2s ease;

  &:hover {
    background-color: rgba(255, 255, 255, 0.8);
  }

  &.active {
    background-color: #333;
  }
}

.thumbnailContainer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  justify-content: center;
  width: 100%;
  position: relative;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  opacity: 0.7;
  transition: all 0.2s ease;

  &:hover {
    opacity: 1;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.activeThumbnail {
  opacity: 1;
  border: 2px solid #ff6b00;
}

/* Responsive styling */
@media (max-width: 768px) {
  .thumbnailContainer {
    justify-content: center;
  }

  .thumbnail {
    width: 50px;
    height: 50px;
  }

  .detailCarousel {
    .carouselContainer {
      min-height: 300px;
    }

    .fixedFrameContainer {
      min-height: 300px;
    }
  }

  .cardImage {
    height: 180px; /* Adjusted height for mobile view */
  }
}
