.avs-product-gallery {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    overflow: visible;
}

.avs-gallery-thumbs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.avs-gallery-thumbs .swiper {
    width: 100%;
    height: auto;
}

.avs-gallery-thumbs .swiper-slide {
    cursor: pointer;
    width: 66px !important;
    height: 72px !important;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    box-sizing: border-box;
    opacity: .88;
    background: transparent;
    transition: border-color .15s ease, opacity .15s ease;
}

.avs-gallery-thumbs .swiper-slide-thumb-active,
.avs-gallery-thumbs .swiper-slide.is-active-thumb {
    border-color: #5b5b5b;
    opacity: 1;
}

.avs-gallery-thumb-ratio {
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avs-gallery-thumb-ratio img,
.avs-gallery-thumb-ratio video,
.avs-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
}

.avs-product-gallery .avs-thumbs-nav {
    box-sizing: border-box;
    background: #fff;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    padding: 0 10px;
}

.avs-product-gallery .avs-thumbs-nav svg {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: block;
}

.avs-product-gallery .avs-thumbs-nav:hover,
.avs-product-gallery .avs-thumbs-nav:focus,
.avs-product-gallery .avs-thumbs-nav:active {
    background: #fff;
    color: #222;
    border: 0;
    box-shadow: none;
    outline: none;
}

.avs-product-gallery .avs-thumbs-nav.swiper-button-disabled {
    opacity: .35;
}

.avs-gallery-main,
.avs-gallery-main .swiper,
.avs-gallery-main .swiper-wrapper,
.avs-gallery-main .swiper-slide {
    min-width: 0;
}

.avs-gallery-main .swiper {
    overflow: hidden;
}

.avs-gallery-main .swiper-slide {
    border-radius: 22px;
    overflow: hidden;
    background: #f3f3f3;
}

.avs-gallery-media-ratio {
    aspect-ratio: 3 / 4;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 22px;
}

.avs-gallery-media-ratio img,
.avs-gallery-media-ratio video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f3f3f3;
}

.avs-gallery-video-wrap video {
    max-width: 100%;
    max-height: 100%;
}

.avs-video-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
}

.avs-video-icon {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}

.avs-video-icon::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 12px;
    border-left: 12px solid #fff;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.avs-product-gallery.avs-gallery-single {
    grid-template-columns: minmax(0, 1fr);
}

.avs-product-gallery.avs-gallery-single .avs-gallery-thumbs {
    display: none !important;
}

@media (max-width: 768px) {
    .avs-product-gallery {
        display: block;
    }

    .avs-gallery-thumbs,
    .avs-thumbs-nav {
        display: none !important;
    }

    .avs-gallery-main {
        overflow: visible;
    }

    .avs-gallery-main .swiper {
        overflow: visible;
        width: 100%;
    }

    .avs-gallery-main .swiper-wrapper {
        align-items: stretch;
    }

    .avs-gallery-main .swiper-slide {
        border-radius: 20px;
    }

    .avs-gallery-media-ratio {
        border-radius: 20px;
    }

    .avs-product-gallery.avs-gallery-single .avs-gallery-main .swiper {
        overflow: hidden;
    }

    .avs-product-gallery.avs-gallery-single .avs-gallery-main .swiper-slide {
        width: 100% !important;
        margin-right: 0 !important;
    }
}
