.gallery-center-wrapper {
    width: 100%;
}

.catalog-gallery-stack {
    flex: 1 1 auto;           /* grow and shrink as needed */
    display: grid;            /* your fluid grid */
    position: relative;       /* for the segments & dots layers */
    aspect-ratio: 4 / 3;        /* change to your desired ratio */
    touch-action: pan-y;
}

.gallery-images {
    display: grid;
    height: auto;
    justify-content: center;
}

.gallery-images img {
    grid-area: 1 / 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity .2s;
}

.woocommerce .catalog-gallery-stack img {
    max-width: 433px !important;
    width: 100% !important;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    object-position: center;
}

.gallery-images img:first-child {
    opacity: 1;
}

.gallery-segments {
    z-index: 10;
    pointer-events: auto;
}

.gallery-segment {
    position: absolute;
    top:    0;
    bottom: 0;
    background: transparent;
    pointer-events: auto;
    z-index: 10;
}

.gallery-dots {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.5em 0;
    display: flex;
    justify-content: center;
    z-index: 20;
    pointer-events: auto;
    background: transparent;
}

.gallery-dot {
    position: relative;
    pointer-events: auto;
    border-radius: 50%;
    background: #ccc;
    margin: 0 4px;
    cursor: pointer;
    transition: 300ms opacity;
    z-index: 20;
    width: 6px;
    height: 6px;
    text-align: center;
    transform: translate3d(0, 0, 0);
}

.gallery-dot.active {
    background: #000;
}

.catalog-gallery-stack > .gallery-segment:hover ~ .gallery-images img {
    opacity: 0 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(1):hover ~ .gallery-images img:nth-child(1) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(2):hover ~ .gallery-images img:nth-child(2) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(3):hover ~ .gallery-images img:nth-child(3) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(4):hover ~ .gallery-images img:nth-child(4) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(5):hover ~ .gallery-images img:nth-child(5) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(6):hover ~ .gallery-images img:nth-child(6) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(7):hover ~ .gallery-images img:nth-child(7) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(8):hover ~ .gallery-images img:nth-child(8) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(9):hover ~ .gallery-images img:nth-child(9) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(10):hover ~ .gallery-images img:nth-child(10) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(11):hover ~ .gallery-images img:nth-child(11) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(12):hover ~ .gallery-images img:nth-child(12) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(13):hover ~ .gallery-images img:nth-child(13) {
    opacity: 1 !important;
}

.catalog-gallery-stack > .gallery-segment:nth-child(14):hover ~ .gallery-images img:nth-child(14) {
    opacity: 1 !important;
}
