.product-gallery {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    border-radius: 5px;
}

.main-image-container {
    position: relative;
    margin-bottom: 15px;
}

.main-image {
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    padding: 8px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* or 'contain' if you prefer */
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.main-image img.fade-out {
    opacity: 0;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    background-color: transparent;
    transition: opacity 0.3s, background-color 0.3s;
}

.nav-btn:hover {
    opacity: 0.8;
    background-color: rgba(0, 0, 0, 0.5);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.thumbnail-container {
  width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0;
  display: block;
   scrollbar-width: auto;
}

.thumbnail-list {
  display: flex;
  flex-wrap: nowrap;
  width: max-content;
  gap: 10px;
}

.thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 10px;
}

.thumbnail:hover {
    border-color: #ccc;
    border-radius: 10px;
}

.thumbnail.active {
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .product-gallery {
        padding: 0;
        margin: 0;
    }

    .nav-btn {
        width: 30px;
        height: 50px;
        font-size: 16px;
    }

    .main-image {
        padding: 8px;
    }

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