.product-gallery {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    border-radius: 5px;
    gap: 15px; /* spacing between thumbnails and main image */
}

.main-image-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    padding: 8px;
}

.main-image-container img.main-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

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

/* nav buttons */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    color: black;
    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; }

/* Thumbnails on the right side */
.thumbnail-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90px;
    max-height: 425px;
    overflow-y: hidden;
    scrollbar-width: thin;
    padding: 5px 0;
}

.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.thumbnail-list img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.thumbnail-list img:hover {
    border-color: #ccc;
}

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

/* Responsive */
@media (max-width: 768px) {
    .product-gallery {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }

    .thumbnail-container {
        flex-direction: row;
        width: 100%;
        max-height: unset;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .thumbnail-list {
        flex-direction: row;
    }

    .thumbnail-list img {
        width: 70px;
        height: 70px;
    }

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