/* Product page image only; the small gallery thumbnails keep their current size. */
#product-product .thumbnails > li:first-child:not(.image-additional) > a.thumbnail > img {
    display: block;
    width: auto;
    max-width: 100%;
    max-width: min(100%, 750px);
    height: auto;
    max-height: 500px;
    margin: 0 auto;
}

/* All popup overrides are scoped: blog image popups continue using the vendor CSS. */
.sudotronic-image-viewer .mfp-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
}

.sudotronic-image-viewer .mfp-container:before,
.sudotronic-image-viewer .mfp-figure:after {
    display: none;
}

.sudotronic-image-viewer .mfp-content {
    width: 1500px;
    max-width: 100%;
    margin: auto;
}

.sudotronic-image-viewer .sudotronic-gallery {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 96px);
    height: calc(100dvh - 96px);
    max-height: 1100px;
    line-height: 1.5;
    color: #f5f5f5;
    background: #20252b;
    border-radius: 6px;
    overflow: hidden;
}

.sudotronic-image-viewer .sudotronic-gallery.mfp-loading {
    display: none;
}

.sudotronic-image-viewer .sudotronic-gallery-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px;
}

.sudotronic-image-viewer .sudotronic-gallery-toolbar button,
.sudotronic-image-viewer .sudotronic-gallery-original {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 7px 12px;
    border: 1px solid #68717b;
    border-radius: 4px;
    font: inherit;
    font-size: 18px;
    line-height: 1.4;
    color: #fff;
    background: #303943;
    cursor: pointer;
    text-decoration: none;
}

.sudotronic-image-viewer .sudotronic-gallery-toolbar button:hover,
.sudotronic-image-viewer .sudotronic-gallery-original:hover {
    background: #465363;
}

.sudotronic-image-viewer .sudotronic-gallery-toolbar button:disabled {
    opacity: 0.45;
    cursor: default;
}

.sudotronic-image-viewer .sudotronic-gallery-toolbar button[aria-pressed="true"] {
    border-color: #b6d8ff;
}

.sudotronic-image-viewer .sudotronic-gallery-scale {
    min-width: 55px;
    padding: 0 4px;
    font-size: 18px;
    text-align: center;
}

.sudotronic-image-viewer .sudotronic-gallery-original {
    margin-left: auto;
}

.sudotronic-image-viewer .sudotronic-gallery-stage {
    position: relative;
    border: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    cursor: default;
    -webkit-overflow-scrolling: touch;
}

.sudotronic-image-viewer .sudotronic-gallery-stage.has-pointer-events {
    touch-action: none;
}

.sudotronic-image-viewer .sudotronic-gallery-stage.is-zoomed { cursor: grab; }
.sudotronic-image-viewer .sudotronic-gallery-stage.is-dragging { cursor: grabbing; }

.sudotronic-image-viewer .sudotronic-gallery-canvas {
    position: relative;
    min-width: 100%;
    min-height: 100%;
    overflow: hidden;
}

.sudotronic-image-viewer img.mfp-img {
    position: absolute;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.sudotronic-image-viewer .sudotronic-gallery-caption {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 0 0 auto;
    max-height: 90px;
    overflow: auto;
    padding: 8px 12px;
}

.sudotronic-image-viewer .mfp-title {
    flex: 1 1 auto;
    padding: 0;
    font-size: 18px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.sudotronic-image-viewer .mfp-counter {
    position: static;
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1.4;
    color: #eee;
}

.sudotronic-image-viewer > .mfp-close {
    position: fixed;
    top: 2px;
    right: 12px;
    width: 44px;
    height: 44px;
    padding: 0;
    line-height: 44px;
    text-align: center;
    background: #20252b;
    border-radius: 4px;
    color: #fff;
    opacity: 1;
}

.sudotronic-image-viewer .mfp-arrow {
    width: 44px;
    height: 56px;
    margin-top: -28px;
    background: #20252b;
    border-radius: 4px;
    opacity: 0.9;
    transform: none;
}

.sudotronic-image-viewer .mfp-arrow:active { margin-top: -28px; }
.sudotronic-image-viewer .mfp-arrow-left { left: 6px; }
.sudotronic-image-viewer .mfp-arrow-right { right: 6px; }
.sudotronic-image-viewer .mfp-arrow:before { display: none; }
.sudotronic-image-viewer .mfp-arrow:after {
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -4px;
    border: 0;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(45deg);
}
.sudotronic-image-viewer .mfp-arrow-right:after {
    margin-left: -8px;
    transform: rotate(225deg);
}

.sudotronic-image-viewer button:focus-visible,
.sudotronic-image-viewer a:focus-visible,
.sudotronic-image-viewer .sudotronic-gallery-stage:focus-visible {
    outline: 3px solid #80baff;
    outline-offset: -3px;
}

@media (max-width: 767px) {
    .sudotronic-image-viewer .mfp-container { padding: 48px 8px; }
    .sudotronic-image-viewer .sudotronic-gallery-toolbar { gap: 4px; padding: 6px; }
    .sudotronic-image-viewer .sudotronic-gallery-toolbar button,
    .sudotronic-image-viewer .sudotronic-gallery-original { padding: 7px 8px; }
    .sudotronic-image-viewer .mfp-arrow { opacity: 0.8; }
    .sudotronic-image-viewer .mfp-arrow-left { left: 10px; }
    .sudotronic-image-viewer .mfp-arrow-right { right: 10px; }
}
