/* Responsive product image gallery used on catalogue product detail pages. */
.product-gallery {
    display: block;
    width: 100%;
}

.product-main-image {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: #f8f8f8;
    border: 0;
}

.product-main-image img,
.single-product .product-main-image img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    display: block;
    object-fit: contain !important;
    object-position: center center;
    padding: 12px;
    opacity: 1;
    aspect-ratio: auto;
    transition: opacity 220ms ease;
}

.product-main-image img.is-changing {
    opacity: 0;
}

.sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 6px;
    background: #dc3545;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.product-thumbnails {
    position: relative;
    z-index: 2;
    display: flex !important;
    gap: 5px;
    width: 100%;
    min-height: 96px;
    margin-top: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.product-thumbnail {
    display: block !important;
    flex: 0 0 86px;
    width: 86px;
    height: 86px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    background: #f8f8f8;
    cursor: pointer;
    transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.product-thumbnail:hover {
    opacity: 0.82;
    transform: translateY(-1px);
}

.product-thumbnail.active {
    border-color: #dc3545;
}

.product-thumbnail img,
.single-product .product-thumbnail img {
    width: 100%;
    height: 100% !important;
    max-height: none !important;
    display: block;
    object-fit: contain !important;
    object-position: center center;
    padding: 4px;
    aspect-ratio: auto;
}

@media (max-width: 767.98px) {
    .product-gallery {
        max-width: 100%;
    }

    .product-thumbnail {
        flex-basis: 74px;
        width: 74px;
        height: 74px;
    }
}
