/* ============= MODERN PRODUCT GALLERY ================ */

.modern-product-gallery {
  position: relative;
  width: 100%;
}

/* Main Image Container */
.gallery-main-container {
  position: relative;
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f9fa;
  aspect-ratio: 1;
  max-width: 600px;
  margin: 0 auto 1rem;
}

.gallery-main-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-main-wrapper:hover .gallery-main-image {
  transform: scale(1.05);
}

/* Zoom Lens */
.zoom-lens {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  display: none;
  z-index: 10;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Zoom Result */
.zoom-result {
  position: absolute;
  width: 400px;
  height: 400px;
  border: 2px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  display: none;
  z-index: 11;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  background: #fff;
  top: 0;
  right: -420px;
}

@media (max-width: 1200px) {
  .zoom-result {
    display: none !important;
  }
}

/* Fullscreen Button */
.gallery-fullscreen-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 5;
  backdrop-filter: blur(4px);
}

.gallery-fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Image Counter */
.gallery-counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 5;
  backdrop-filter: blur(4px);
}

/* Thumbnail Gallery */
.gallery-thumbnails-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.gallery-thumbnails {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.gallery-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.gallery-thumbnail-item {
  position: relative;
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.gallery-thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-thumbnail-item:hover {
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.gallery-thumbnail-item:hover img {
  transform: scale(1.1);
}

.gallery-thumbnail-item.active {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.thumbnail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
  font-size: 1.2rem;
}

.gallery-thumbnail-item:hover .thumbnail-overlay {
  opacity: 1;
}

/* Navigation Buttons */
.gallery-nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: #333;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.gallery-nav-btn:hover {
  background: #007bff;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.gallery-nav-btn:active {
  transform: scale(0.95);
}

/* Lightbox Modal */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
}

.lightbox-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrapper img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(4px);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  backdrop-filter: blur(4px);
}

.lightbox-prev {
  left: -70px;
}

.lightbox-next {
  right: -70px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-main-container {
    aspect-ratio: 1;
    max-width: 100%;
  }
  
  .gallery-thumbnail-item {
    width: 60px;
    height: 60px;
    min-width: 60px;
  }
  
  .gallery-nav-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .lightbox-prev {
    left: 10px;
  }
  
  .lightbox-next {
    right: 10px;
  }
  
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
  
  .lightbox-counter {
    bottom: 10px;
  }
  
  .zoom-result {
    display: none !important;
  }
  
  .gallery-main-wrapper {
    cursor: pointer;
  }
}

@media (max-width: 576px) {
  .gallery-thumbnail-item {
    width: 50px;
    height: 50px;
    min-width: 50px;
  }
  
  .gallery-thumbnails {
    gap: 0.5rem;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-lightbox.active .lightbox-image-wrapper img {
  animation: fadeIn 0.3s ease;
}
