.product-gallery {
    display: flex;
    align-items: stretch;
    gap: 14px;
    width: 100%;
}

.zoom-image-box {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    min-width: 0;
    flex: 1 1 auto;
    height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f8f9fa;

    img {
        max-width: 100%;
        max-height: 100%;
        user-select: none;
        -webkit-user-drag: none;
        transform-origin: center center;
        transition: transform .08s ease-out;
        cursor: grab;

        &.is-dragging {
            cursor: grabbing;
            transition: none;
        }
    }
}

.thumb-gallery {
    position: relative;
    flex: 0 0 96px;
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.thumb-viewport {
    overflow: hidden;
    width: 100%;
    height: 376px;
}

.image-thumb {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform .25s ease;
    will-change: transform;

    li {
        flex: 0 0 auto;
        width: 96px;
        height: 84px;
        overflow: hidden;
        border-radius: 8px;
    }

    button {
        width: 100%;
        height: 100%;
        padding: 0;
        border: 2px solid transparent;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        overflow: hidden;
        opacity: .75;
        transition: border-color .2s ease, opacity .2s ease, transform .2s ease;

        &:hover {
            opacity: 1;
            transform: translateX(2px);
        }

        &.is-active {
            border-color: #0d6efd;
            opacity: 1;
        }
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.thumb-arrow,
.image-modal-close,
.image-modal-arrow {
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .2s ease, transform .2s ease;

    &:hover {
        opacity: .9;
    }

    &.is-hidden {
        display: none;
    }
}

.thumb-arrow {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    background: #212529;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    z-index: 2;

    &:disabled {
        opacity: .35;
        cursor: default;
    }

    svg path {
        stroke: #fff;
    }
}

.image-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, .85);

    &.is-open {
        display: flex;
    }

    img {
        max-width: 95vw;
        max-height: 90vh;
        user-select: none;
        -webkit-user-drag: none;
        transform-origin: center center;
        cursor: grab;

        &.is-dragging {
            cursor: grabbing;
        }
    }
}

.image-modal-content {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-close,
.image-modal-arrow {
    position: fixed;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, .95);
    z-index: 10000;
}

.image-modal-close {
    top: 18px;
    right: 18px;
}

.image-modal-arrow {
    top: 50%;
}

.image-modal-arrow-prev {
    left: 18px;
}

.image-modal-arrow-next {
    right: 18px;
}

.zoom-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 5px 8px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 12px;
    pointer-events: none;
}

@media (max-width: 576px) {
    .product-gallery {
        gap: 8px;
    }

    .thumb-gallery {
        flex-basis: 72px;
        width: 72px;
        gap: 6px;
    }

    .thumb-viewport {
        height: 318px;
    }

    .image-thumb {
        gap: 8px;

        li {
            width: 72px;
            height: 58px;
        }
    }

    .thumb-arrow {
        width: 30px;
        height: 30px;
        font-size: 24px;
    }

    .zoom-image-box {
        height: 380px;
    }

    .image-modal {
        padding: 18px;
    }

    .image-modal-arrow {
        width: 42px;
        height: 42px;
        font-size: 34px;

        &-prev {
            left: 10px;
        }

        &-next {
            right: 10px;
        }
    }

    .zoom-hint {
        display: none;
    }
}