/* Shared gallery for the original Soo 01–05 product pages. */
html:has(body.product-gallery-page),
body.product-gallery-page {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}
.product-gallery-page .sororam-wrap { height: 100%; min-height: 0; }
.product-gallery-page .image-grid-1 {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: minmax(0, 1fr);
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    justify-content: start;
    gap: var(--photo-gap);
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: default;
}
.product-gallery-page .image-grid-1::-webkit-scrollbar { display: none; }
.product-gallery-page .image-grid-1.is-dragging {
    scroll-snap-type: none;
    user-select: none;
}
.product-gallery-page .image-grid-1 > .image-box {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}
.product-gallery-page .product-img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    overflow: hidden;
    border: 0;
    padding: 0;
}
.product-gallery-page .product-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    user-select: none;
    -webkit-user-drag: none;
}
.product-gallery-page .product-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #eeefef url('/images/common/backgrounds/optimized/studio-floor-shared.jpg') center / cover no-repeat;
    pointer-events: none;
}
.product-gallery-page .product-cover .product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: inherit;
    -webkit-tap-highlight-color: transparent;
}
.product-gallery-page .product-cover img {
    /* Keep the same shirt scale as the exclusive pages and the old desktop column. */
    flex: none;
    width: calc((100% - var(--photo-gap) * 2) / 3);
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent),
        linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent),
        linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    -webkit-mask-composite: source-in;
    mask-composite: intersect;
}
.product-gallery-page .image-grid-1::after {
    content: '';
    position: fixed;
    left: var(--gallery-cursor-x, -100px);
    top: var(--gallery-cursor-y, -100px);
    width: 18px;
    height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Cpath d='M3 9h12m-4-4 4 4-4 4' fill='none' stroke='%23aaaaaa' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: difference;
}
.product-gallery-page .image-grid-1[data-gallery-direction="next"],
.product-gallery-page .image-grid-1[data-gallery-direction="next"] *,
.product-gallery-page .image-grid-1[data-gallery-direction="previous"],
.product-gallery-page .image-grid-1[data-gallery-direction="previous"] * {
    cursor: none;
}
.product-gallery-page .image-grid-1[data-gallery-direction="next"]::after,
.product-gallery-page .image-grid-1[data-gallery-direction="previous"]::after {
    opacity: 1;
}
.product-gallery-page .image-grid-1[data-gallery-direction="previous"]::after {
    transform: translate(-50%, -50%) rotate(180deg);
}
.product-gallery-page .gallery-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.product-gallery-page .gallery-indicators {
    position: fixed;
    z-index: 1900;
    left: 50%;
    bottom: 82px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    pointer-events: none;
    mix-blend-mode: difference;
}
.product-gallery-page .gallery-indicators[hidden] { display: none; }
.product-gallery-page .gallery-indicator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #aaa;
    opacity: 0.5;
}
.product-gallery-page .gallery-indicator.is-active {
    opacity: 1;
}
@media (min-width: 769px) {
    .product-gallery-page .image-grid-1 > .portrait-photo { display: none; }
}
@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    .product-gallery-page .image-grid-1::after { display: none; }
    .product-gallery-page .image-grid-1[data-gallery-direction],
    .product-gallery-page .image-grid-1[data-gallery-direction] * { cursor: auto; }
}
@media (max-width: 768px) {
    .product-gallery-page .image-grid-1 > .desktop-photo { display: none; }
    .product-gallery-page .product-cover img {
        width: max(100%, calc(100vh * 3 / 4));
        width: max(100%, calc(100svh * 3 / 4));
        width: max(100%, calc(100dvh * 3 / 4));
    }
}
