.ht-product-gallery {
    position: relative;
    width: 100%;
    margin: 0 0 24px;
}

.ht-product-gallery__stage {
    position: relative;
}

.ht-product-gallery__viewport {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
    touch-action: pan-y pinch-zoom;
    cursor: default;
    user-select: none;
}

.ht-product-gallery.is-zoomed .ht-product-gallery__viewport {
    cursor: zoom-out;
    touch-action: none;
}

.ht-product-gallery__track {
    display: flex;
    width: 100%;
    transition: transform 0.28s ease;
    will-change: transform;
}

.ht-product-gallery.is-dragging .ht-product-gallery__track {
    transition: none;
}

.ht-product-gallery__slide {
    flex: 0 0 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.ht-product-gallery__slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    pointer-events: none;
}

.ht-product-gallery__zoom {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.ht-product-gallery__zoom[hidden] {
    display: none !important;
}

.ht-product-gallery__zoom-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(1);
    transform-origin: center center;
    will-change: transform;
}

.ht-product-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.ht-product-gallery--fine-pointer .ht-product-gallery__nav {
    display: flex;
    opacity: 0;
}

.ht-product-gallery--fine-pointer .ht-product-gallery__stage:hover .ht-product-gallery__nav,
.ht-product-gallery--fine-pointer .ht-product-gallery__nav:focus-visible {
    opacity: 1;
}

.ht-product-gallery__nav:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.62);
}

.ht-product-gallery__nav:disabled {
    opacity: 0.25 !important;
    cursor: default;
}

.ht-product-gallery__nav--prev {
    left: 12px;
}

.ht-product-gallery__nav--next {
    right: 12px;
}

.ht-product-gallery__counter {
    margin: 10px 0 0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.ht-product-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.ht-product-gallery__thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
}

.ht-product-gallery__thumb.is-active {
    border-color: #007cba;
}

.ht-product-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 640px) {
    .ht-product-gallery__slide {
        min-height: 200px;
    }

    .ht-product-gallery__thumb {
        width: 60px;
        height: 60px;
    }
}
