.product-details-page .pdp-main-product-image {
    cursor: pointer;
}

.product-image-viewer[hidden] {
    display: none !important;
}

.product-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr) 104px;
    overflow: hidden;
    background: #050505;
    color: #fff;
    direction: ltr;
}

body.product-image-viewer-open {
    overflow: hidden;
}

body.product-image-viewer-open .product-details-page .pdp-gallery {
    z-index: 1300;
}

.product-image-viewer__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
}

.product-image-viewer__counter {
    color: rgba(255, 255, 255, .72);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.product-image-viewer__tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-image-viewer__tools button,
.product-image-viewer__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: #fff;
    background: transparent;
    cursor: pointer;
}

.product-image-viewer__tools button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.product-image-viewer__tools button:hover,
.product-image-viewer__nav:hover {
    background: rgba(255, 255, 255, .12);
}

.product-image-viewer__tools svg,
.product-image-viewer__nav svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.product-image-viewer__stage {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
}

.product-image-viewer__image {
    display: block;
    max-width: min(calc(100% - 160px), 1200px);
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transform: scale(1);
    transform-origin: center;
    transition: transform .16s ease;
    will-change: transform;
}

.product-image-viewer__image.is-zoomed {
    cursor: grab;
    transition: none;
}

.product-image-viewer__image.is-dragging {
    cursor: grabbing;
}

.product-image-viewer__stage.is-zoomed {
    align-items: flex-start;
    justify-content: flex-start;
    overflow: auto;
    touch-action: none;
}

.product-image-viewer[data-zoom-level="1"] .product-image-viewer__image {
    transform: scale(1.5);
}

.product-image-viewer[data-zoom-level="2"] .product-image-viewer__image {
    transform: scale(2);
}

.product-image-viewer[data-zoom-level="3"] .product-image-viewer__image {
    transform: scale(2.5);
}

.product-image-viewer[data-zoom-level="4"] .product-image-viewer__image {
    transform: scale(3);
}

.product-image-viewer[data-zoom-level="5"] .product-image-viewer__image {
    transform: scale(3.5);
}

.product-image-viewer[data-zoom-level="6"] .product-image-viewer__image {
    transform: scale(4);
}

.product-image-viewer__nav {
    position: absolute;
    z-index: 1;
    top: 50%;
    width: 52px;
    height: 64px;
    border-radius: 8px;
    transform: translateY(-50%);
}

.product-image-viewer__nav--previous {
    left: 16px;
}

.product-image-viewer__nav--next {
    right: 16px;
}

.product-image-viewer__other-images {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 10px 20px 16px;
}

.product-image-viewer__thumbnails {
    display: flex;
    max-width: 100%;
    gap: 10px;
    overflow-x: auto;
    padding: 3px 3px 8px;
    scrollbar-color: rgba(255, 255, 255, .4) transparent;
    scrollbar-width: thin;
}

.product-image-viewer__thumbnail {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 5px;
    background: #202020;
    cursor: pointer;
}

.product-image-viewer__thumbnail[aria-current="true"] {
    border-color: #fff;
}

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

body.product-image-viewer-open .mobile-bottom-navigation {
    visibility: hidden;
}

@media (max-width: 600px) {
    .product-image-viewer {
        grid-template-rows: 52px minmax(0, 1fr) 92px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .product-image-viewer__toolbar {
        gap: 6px;
        padding-inline: 8px;
    }

    .product-image-viewer__counter {
        font-size: 14px;
    }

    .product-image-viewer__tools {
        gap: 0;
    }

    .product-image-viewer__tools button {
        width: 38px;
        height: 38px;
    }

    .product-image-viewer__tools svg {
        width: 21px;
        height: 21px;
    }

    .product-image-viewer__image {
        max-width: calc(100% - 84px);
        max-height: 100%;
    }

    .product-image-viewer__stage.is-zoomed .product-image-viewer__image {
        max-width: none;
        max-height: none;
    }

    .product-image-viewer__nav {
        width: 38px;
        height: 52px;
        background: rgba(0, 0, 0, .35);
    }

    .product-image-viewer__nav--previous {
        left: 4px;
    }

    .product-image-viewer__nav--next {
        right: 4px;
    }

    .product-image-viewer__other-images {
        justify-content: flex-start;
        padding: 8px 8px 12px;
    }

    .product-image-viewer__thumbnails {
        gap: 8px;
        margin-inline: auto;
    }

    .product-image-viewer__thumbnail {
        flex-basis: 60px;
        width: 60px;
        height: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-image-viewer__image {
        transition: none;
    }
}
