.custom-product-gallery {
    width: 45%;
    float: left;
}

.custom-product-gallery .thumbnails {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 4px;
    margin-bottom: 12px;
}

.custom-product-gallery .thumbnails img {
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 10px;
    width: 100px;
    border: 2px solid #d9d9d9;
}

.custom-product-gallery .main-image {
    margin-bottom: 18px;
    border: 1px solid #dcdcdc;
    position: relative;
}

.custom-product-gallery .main-image img {
    width: 100%;
    height: auto;
}

.custom-product-gallery img.thumbnail.active {
    outline: 4px solid #f4911e;
    border: 2px solid #fff;
}

#loading-spinner {
    background-color: #fff;
    opacity: 0;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute;
    z-index: 200;
    background-image: url("/wp-content/themes/anti/assets/img/spinner.gif");
    background-repeat: no-repeat;
    background-position-y: 50%;
    background-position-x: 50%;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#loading-spinner.visible {
    opacity: 0.7;
    transition: opacity 1s ease;
}

/* Prevent dragging images inside the thumbnails container */
.thumbnails img {
    user-drag: none;
    /* Standard syntax */
    -webkit-user-drag: none;
    /* Safari syntax */
    -moz-user-drag: none;
    /* Firefox syntax */
    -ms-user-drag: none;
    /* Internet Explorer syntax */
    /* Alternatively, use */
    /* cursor: grab; or cursor: move; to indicate dragging */
}

.main-image {
    overflow: hidden;
    position: relative;
    transition: height 0.3s ease;
    /* Adjust duration and easing as needed */
}

.main-image img {
    display: block;
    width: 100%;
    /* Ensure image fits container */
    height: auto;
    /* Maintain aspect ratio */
}

/* CSS for screen widths under 1000 pixels */
@media (max-width: 1100px) {
    .custom-product-gallery {
        width: 100%;
        float: none;
    }

    .custom-product-gallery .thumbnails img {
        cursor: pointer;
        margin-right: 10px;
        margin-bottom: 10px;
        width: 74px;
        border: 2px solid #d9d9d9;
    }
}