.images .doro-custom-gallery {
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;

    @media (max-width: 767px) {
        > * {
            flex: 0 0;
        }
    }

    @media (min-width: 768px) {
        flex-direction: row;
    }
}

.wc-product-gallery.swiper:not(.images__top--single) {
    --swiper-theme-color: #212529;
    --swiper-navigation-color: #495057;
    --swiper-navigation-size: 25px;
    --active-border-width: 3px;
    --focus-color: #DEE2E6;
    --thumbnail-height: 120px;

    /** Thumbnail count and gap are set in JS. this is a fallback. */
    --thumbnail-count: 3;
    --thumbnail-gap: 5px;

    &.images__top {
        width: 100%;
        order: 2;
    }

    &.images__bottom {
        width: 100%;
        order: 1;
        /* Set fixed height for vertical thumbnails */
        height: calc(var(--thumbnail-count) * var(--thumbnail-height) + var(--thumbnail-gap) * (var(--thumbnail-count) - 1));

        .swiper-slide {
            /* Override aspect-ratio stretching */
            height: auto;
            aspect-ratio: 1;
            /* Limit individual thumbnail height */
            max-height: var(--thumbnail-height);
            max-width: 100%;

            :is(a, img, video) {
                object-fit: contain;
            }
        }

        .swiper-horizontal > .swiper-scrollbar, .swiper-scrollbar.swiper-scrollbar-horizontal {
            width: 100%;
            left: 0;
        }

        /* Override scrollbar positioning for vertical layout */

        .swiper-vertical > .swiper-scrollbar, .swiper-scrollbar.swiper-scrollbar-vertical {
            width: 4px;
            inset-inline-start: 0;
            inset-block-start: 0;
            height: 100%;
        }
    }

    &.swiper-thumbs {
        .swiper-slide {
            cursor: pointer;

            &.video-slide {
                &::after {
                    content: "\e071";
                    display: flex;
                    position: absolute;
                    align-items: center;
                    justify-content: center;
                    border-radius: 50%;
                    background: rgba(0, 0, 0, 50%);
                    width: 50px;
                    height: 50px;
                    color: white;
                    font-family: 'simple-line-icons', sans-serif;
                    speak: none;
                    font-style: normal;
                    font-weight: normal;
                    font-variant: normal;
                    text-transform: none;
                    line-height: 1;
                    -webkit-font-smoothing: antialiased;
                    -moz-osx-font-smoothing: grayscale;
                    opacity: 0.7;
                }

                &:hover::after {
                    opacity: 1;
                }
            }
        }
    }

    .swiper-slide {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--active-border-width);
        aspect-ratio: 1;

        :is(a, img, video) {
            object-fit: cover;
            height: 100%;
            width: 100%;
            object-position: center center;
        }

        :is(video) {
            object-fit: contain;
        }

        &.swiper-slide-thumb-active {
            box-shadow: inset 0 0 0 2px var(--focus-color);
        }
    }

    @media (min-width: 768px) {
        --thumbnail-count: 4;

        &.images__top:not(.images__top--single) {
            width: 80%;
        }

        &.images__bottom {
            width: 20%;
        }
    }

    .swiper-button-next, .swiper-button-prev {
        margin-top: 0;
        translate: 0 -50%;
        padding: 20px;

        &.swiper-button-disabled {
            pointer-events: auto;
            cursor: not-allowed;
        }
    }

    /** Disabled button should be interactable to allow focus */
    .swiper-button-next.swiper-button-disabled, .swiper-button-prev.swiper-button-disabled {
    }
}