/* XXL Only - Ultra-wide monitors, 4K screens */
@media (min-width: 1400px) {
}

/* XL Only - Large desktops, wide screens */
@media (min-width: 1200px) and (max-width: 1399px) {
  .gallery {
    width: 450px !important;
  }
}

/* L Only - Desktops, large tablets in landscape */
@media (min-width: 992px) and (max-width: 1200px) {
  .gallery {
    width: 375px !important;
  }
}

/* M Only - Tablets, iPads, small laptops */
@media (min-width: 768px) and (max-width: 992px) {
  .gallery {
    width: 280px !important;
    max-height: 350px;
  }

  .arrow {
    margin: 0 5px !important;
  }

  .thumbnails img {
    margin: 0 3px !important;
  }
}

/* S Only - Large phones (Landscape), small tablets */
@media (min-width: 576px) and (max-width: 768px) {
}

/* XS Only - Most phones (Portrait) < 576px */
@media (max-width: 575.98px) {
  .gallery {
    width: 375px !important;
  }
}

.gallery {
  text-align: center;
  width: 500px;
  height: 100%;
  margin: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  touch-action: pan-x pan-y; /* Allow swiping */
  overflow: hidden; /* Hide overflowing content during swipe */
}

.main-image-container {
  width: 100%;
  height: auto;
  border: 2px solid #000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f0f0f0;
  position: relative;
  cursor: zoom-in;
}


.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
  transform-origin: center center;
}

.main-image.zoomed {
  transform: scale(3.5); /* Increased zoom scale */
}

.thumbnail-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.thumbnails-wrapper {
  width: 100%; /* Ensure thumbnails don't overflow */
  overflow: hidden;
}

.thumbnails {
  display: flex;
  transition: transform 0.3s ease;
}

.thumbnails img {
  width: 60px;
  height: 60px;
  margin: 0 5px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.3s;
}

.thumbnails img.active {
  border: 2px solid #ff7300;
}

.arrow {
  cursor: pointer;
  font-size: 24px;
  color: #333;
  margin: 0 10px;
  user-select: none;
}

.arrow:hover {
  color: #666;
}

/* Optional for better swipe experience on mobile */
@media (max-width: 768px) {
  .gallery {
    width: 100%;
  }
}
