.custom-swiper-gallery-wrapper {
  display: flex;
  gap: 20px;
  position: relative;
  width: 100%;
}
.swiper-main-container {
  flex: 1;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.swiper-main {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #f5f5f5;
}
.swiper-main .swiper-wrapper {
  height: 100%;
}
.swiper-main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  cursor: pointer;
  height: 100%;
}
.swiper-main .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.swiper-button-prev,
.swiper-button-next {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}
.swiper-button-prev:after,
.swiper-button-next:after {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}
.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: #fff;
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.swiper-thumbs-container {
  flex: 0 0 16%;
  width: 16%;
  min-width: 140px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3/2;
}
.swiper-thumbs {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.swiper-thumbs .swiper-wrapper {
  display: flex;
  flex-direction: column;
  gap: calc((100% - (100% / 1.5 * 5)) / 4);
  height: 100%;
}
.swiper-thumbs .swiper-slide {
  width: 100% !important;
  height: calc(100% / 5 - (100% - (100% / 1.5 * 5)) / 5);
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  background: #f5f5f5;
  flex-shrink: 0;
}
.swiper-thumbs .swiper-slide.thumb-hidden {
  display: none !important;
}
.swiper-thumbs .swiper-slide .thumb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  position: relative;
}
.swiper-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.swiper-thumbs .swiper-slide:hover {
  border-color: #ddd;
  transform: scale(1.05);
}
.swiper-thumbs .swiper-slide:hover img {
  transform: scale(1.05);
}
.swiper-thumbs .swiper-slide.swiper-slide-thumb-active {
  border-color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.swiper-thumbs .swiper-slide.has-overlay .thumb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 5;
  border-radius: 6px;
  transition: background 0.3s ease;
  pointer-events: none;
}
.swiper-thumbs .swiper-slide.has-overlay:hover .thumb-overlay {
  background: rgba(0, 0, 0, 0.85);
}
.thumb-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  z-index: 10;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.thumb-counter:hover {
  transform: translate(-50%, -50%) scale(1.2);
}
.swiper-main .swiper-slide {
  opacity: 1;
  transition: opacity 0.5s ease;
}
.swiper-main .swiper-slide-active {
  opacity: 1;
  animation: fadeInScale 0.5s ease;
}
@keyframes fadeInScale {
  0% {
    opacity: 0.7;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
.swiper-thumbs .swiper-slide::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.3s ease;
  pointer-events: none;
  border-radius: 6px;
}
.swiper-thumbs .swiper-slide.swiper-slide-thumb-active::after,
.swiper-thumbs .swiper-slide:hover::after {
  background: rgba(0, 0, 0, 0);
}
.swiper-thumbs .swiper-slide.has-overlay::after {
  display: none;
}
.lg-backdrop {
  background-color: rgba(0, 0, 0, 0.95);
}
.lg-outer .lg-item {
  transition: opacity 0.3s ease;
}
.lg-outer .lg-current {
  opacity: 1;
}
.lg-sub-html {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: 20px;
  transition: opacity 0.3s ease;
}
.lg-sub-html h4 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}
.lg-toolbar {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}
.lg-icon {
  opacity: 0.8;
  transition: opacity 0.3s ease;
}
.lg-icon:hover {
  opacity: 1;
}
@media (max-width: 768px) {
  .custom-swiper-gallery-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  .swiper-main-container {
    width: 100%;
    aspect-ratio: 3/2;
  }
  .swiper-thumbs-container {
    width: 100%;
    aspect-ratio: auto;
    height: auto;
    min-width: 0;
    max-width: none;
  }
  .swiper-thumbs {
    height: auto;
    width: 100%;
  }
  .swiper-thumbs .swiper-wrapper {
    flex-direction: row;
    height: auto;
    width: 100%;
    justify-content: space-between;
  }
  .swiper-thumbs .swiper-slide {
    height: auto !important;
    width: calc(20% - 8px) !important;
    aspect-ratio: 3/2;
    flex-shrink: 0;
  }
  .swiper-thumbs .swiper-slide img {
    height: auto;
    width: 100%;
  }
  .thumb-counter {
    font-size: 24px;
  }
}
@media (max-width: 480px) {
  .custom-swiper-gallery-wrapper {
    gap: 12px;
  }
  .swiper-thumbs .swiper-wrapper {
    gap: 0px;
  }
/*   .swiper-thumbs .swiper-slide {
    width: calc(20% - 6.4px) !important;
  } */
  .thumb-counter {
    font-size: 20px;
  }
}