[x-cloak] {
    display: none !important;
}

.tm-product-gallery {
    --tm-gallery-control-bg: rgba(255, 255, 255, 0.92);
    --tm-gallery-control-border: rgba(15, 23, 42, 0.16);
    --tm-gallery-control-color: #0f172a;
    --tm-gallery-accent: #2563eb;
}

.tm-product-gallery-modal-open {
    overflow: hidden;
}

.tm-product-gallery__dialog {
    position: relative;
}

.tm-product-gallery__dialog--fullscreen {
    align-items: center;
    background: #21140f;
    box-sizing: border-box;
    display: grid;
    height: 100vh;
    height: 100dvh;
    inset: 0;
    justify-content: center;
    justify-items: center;
    margin: 0;
    max-width: none;
    overflow: hidden;
    padding: 4rem 2rem 3rem;
    place-items: center;
    position: fixed;
    width: 100vw;
    z-index: 999;
}

.tm-product-gallery__stage {
    min-height: 18rem;
}

.tm-product-gallery .tm-product-gallery__stage {
    overflow: visible !important;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__stage {
    grid-row: 1;
}

.tm-product-gallery__lightbox-thumbs-wrap {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 auto;
    grid-column: 1;
    grid-row: 2;
    justify-content: center;
    justify-self: center;
    max-width: calc(100vw - 2rem);
    min-width: 0;
    position: relative;
    width: min(72rem, calc(100vw - 2rem));
    z-index: 5;
}

.tm-product-gallery__lightbox-thumbs-wrap::before,
.tm-product-gallery__lightbox-thumbs-wrap::after {
    content: none;
    display: none;
}

.tm-product-gallery__lightbox-thumbs-wrap--prev::before,
.tm-product-gallery__lightbox-thumbs-wrap--next::after {
    content: "";
    display: block;
    height: 100%;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 2.75rem;
    z-index: 4;
}

.tm-product-gallery__lightbox-thumbs-wrap--prev::before {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.45), transparent);
    left: 0;
}

.tm-product-gallery__lightbox-thumbs-wrap--next::after {
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.45), transparent);
    right: 0;
}

.tm-product-gallery__lightbox-thumbs {
    display: flex;
    flex: 0 1 auto;
    gap: 0.5rem;
    justify-content: flex-start;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    padding: 0.35rem 2px 0.85rem;
    scroll-behavior: smooth;
    scroll-padding-inline: 0;
    scrollbar-width: none;
    width: max-content;
}

.tm-product-gallery__lightbox-thumbs-wrap--prev .tm-product-gallery__lightbox-thumbs {
    padding-left: 3rem;
    scroll-padding-left: 3rem;
}

.tm-product-gallery__lightbox-thumbs-wrap--next .tm-product-gallery__lightbox-thumbs {
    padding-right: 3rem;
    scroll-padding-right: 3rem;
}

.tm-product-gallery__lightbox-thumbs::-webkit-scrollbar {
    display: none;
}

.tm-product-gallery__lightbox-chevron {
    align-items: center;
    background: rgba(15, 23, 42, 0.72);
    border: 0;
    border-radius: 999px;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    display: none;
    height: 2.5rem;
    justify-content: center;
    padding: 0;
    position: absolute;
    top: calc(50% - 0.25rem);
    transform: translateY(-50%);
    width: 2.5rem;
    z-index: 6;
}

.tm-product-gallery__lightbox-thumbs-wrap--prev .tm-product-gallery__lightbox-chevron--prev,
.tm-product-gallery__lightbox-thumbs-wrap--next .tm-product-gallery__lightbox-chevron--next {
    display: inline-flex;
}

.tm-product-gallery__lightbox-chevron--prev {
    left: 0;
}

.tm-product-gallery__lightbox-chevron--next {
    right: 0;
}

.tm-product-gallery__lightbox-chevron svg {
    display: block;
    height: 1.5rem;
    stroke-width: 2;
    width: 1.5rem;
}

.tm-product-gallery__lightbox-chevron:hover,
.tm-product-gallery__lightbox-chevron:focus-visible {
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
}

.tm-product-gallery__lightbox-chevron:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .tm-product-gallery__lightbox-thumbs {
        scroll-behavior: auto;
    }
}

.tm-product-gallery__lightbox-thumb {
    background: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    flex: 0 0 4.5rem;
    height: 4.5rem;
    overflow: hidden;
    padding: 0;
    width: 4.5rem;
}

.tm-product-gallery__lightbox-thumb img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tm-product-gallery__lightbox-thumb--active {
    border-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

@media (max-width: 767px) {
    .tm-product-gallery__lightbox-thumb {
        flex-basis: 2.75rem;
        height: 2.75rem;
        width: 2.75rem;
    }

    .tm-product-gallery__lightbox-chevron {
        height: 2.75rem;
        width: 2.75rem;
    }
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__stage {
    align-items: center;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    grid-column: 1;
    justify-content: center;
    justify-self: center;
    margin: 0 auto;
    max-width: min(76vw, 58rem);
    min-height: 0;
    overflow: visible !important;
    position: relative;
    width: max-content;
    z-index: 1;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__viewport {
    align-items: center;
    background: #fff;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: min(76vw, 58rem);
    width: auto;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__zoom-pane,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__lens,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__zoom-window {
    display: none !important;
}

.tm-product-gallery__image {
    aspect-ratio: 1 / 1;
    cursor: pointer;
    max-height: 42rem;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__image {
    aspect-ratio: auto;
    border-radius: 12px;
    display: block;
    filter: drop-shadow(0 1.5rem 3rem rgba(0, 0, 0, 0.4));
    height: auto;
    margin: 0 auto;
    max-height: min(72vh, 46rem);
    max-width: min(76vw, 58rem);
    object-fit: contain;
    overflow: hidden;
    width: auto;
}

.tm-product-gallery__lens {
    /* The spotlight is a huge box-shadow. Opacity fades it; display stays in
       the stylesheet because Alpine's :style replaces the whole style attribute. */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 0.15rem;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.28),
        0 0 0 9999px rgba(255, 255, 255, 0.5);
    height: min(38%, 12rem);
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, -50%);
    transition: opacity 180ms ease, visibility 0s linear 180ms;
    visibility: hidden;
    width: min(38%, 12rem);
    z-index: 12;
}

.tm-product-gallery--zoom-lens .tm-product-gallery__lens {
    border-radius: 0.35rem;
    overflow: hidden;
}

.tm-product-gallery--zoom-window .tm-product-gallery__lens {
    background: transparent;
    border-radius: 0.15rem;
}

.tm-product-gallery__zoom-pane {
    /* Stay hidden unless inner zoom is on and the large image has loaded.
       Otherwise this full-size layer covers the photo with an empty white box. */
    display: none;
    background-color: #fff;
    border: 0;
    box-shadow: none;
    height: 100%;
    inset: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 11;
}

.tm-product-gallery__zoom-window {
    /* In-column panel under the photo. Do not use left: calc(100% + 1rem); that covers
       the Hyvä product-info column (price, options, add to cart). */
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.95);
    box-shadow:
        0 0 0 1px rgba(148, 163, 184, 0.55),
        0 0.75rem 1.75rem rgba(15, 23, 42, 0.16);
    pointer-events: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    z-index: 16;
}

.tm-product-gallery__dialog:not(.tm-product-gallery__dialog--fullscreen) .tm-product-gallery__viewport {
    overflow: hidden;
}

.tm-product-gallery__dialog:not(.tm-product-gallery__dialog--fullscreen) .tm-product-gallery__fullscreen {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0.2rem 0.65rem rgba(15, 23, 42, 0.2);
}

.tm-product-gallery--show-lens .tm-product-gallery__lens,
.tm-product-gallery--show-window-lens .tm-product-gallery__lens {
    opacity: 1;
    transition: opacity 180ms ease, visibility 0s linear 0s;
    visibility: visible;
}

.tm-product-gallery--show-inner .tm-product-gallery__zoom-pane,
.tm-product-gallery--show-window .tm-product-gallery__zoom-window {
    display: block;
}

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

.tm-product-gallery--zoom-window-active {
    overflow: visible !important;
}

.tm-product-gallery--zoom-window-active.tm-product-gallery--zoom-pos-bottom {
    padding-bottom: var(--tm-zoom-pad, 19rem);
}

.tm-product-gallery--zoom-window-active .tm-product-gallery__dialog {
    overflow: visible !important;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop {
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(34px);
    inset: 0;
    opacity: 1;
    pointer-events: none;
    position: fixed;
    transform: scale(1.08);
    z-index: 0;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop::before {
    background-image: var(--tm-gallery-backdrop);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    content: "";
    inset: 0;
    opacity: 0;
    position: absolute;
    z-index: 0;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop--out::before {
    opacity: 1;
    transition: opacity 200ms ease;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop::after {
    background: rgba(19, 12, 8, 0.56);
    content: "";
    inset: 0;
    position: absolute;
    z-index: 1;
}

.tm-product-gallery__modal-title {
    bottom: -2.25rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    left: 0;
    line-height: 1.4;
    position: absolute;
    right: 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.tm-product-gallery__nav,
.tm-product-gallery__fullscreen,
.tm-product-gallery__close {
    align-items: center;
    background: var(--tm-gallery-control-bg);
    border: 1px solid var(--tm-gallery-control-border);
    border-radius: 999px;
    color: var(--tm-gallery-control-color);
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    position: absolute;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    z-index: 20;
}

.tm-product-gallery__nav--stage {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.18);
    min-height: 3.5rem;
    min-width: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.tm-product-gallery__nav--stage:hover,
.tm-product-gallery__nav--stage:focus-visible {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0.5rem 1.25rem rgba(15, 23, 42, 0.24);
    outline: none;
    transform: translateY(-50%) scale(1.04);
}

.tm-product-gallery__nav--stage:active {
    transform: translateY(-50%) scale(0.98);
}

.tm-product-gallery__fullscreen,
.tm-product-gallery__close {
    min-height: 2.75rem;
    min-width: 2.75rem;
}

.tm-product-gallery__fullscreen:hover,
.tm-product-gallery__close:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.45);
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--stage {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.32);
    color: var(--tm-gallery-control-color);
    min-height: 4rem;
    min-width: 4rem;
    z-index: 30;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--stage:hover,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--stage:focus-visible,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--stage:active {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.36);
    outline: none;
    transform: translateY(-50%);
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__close {
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: #fff;
    height: 3rem;
    min-height: 3rem;
    min-width: 3rem;
    position: fixed;
    right: 0.5rem;
    top: 0.5rem;
    transform: none;
    width: 3rem;
    z-index: 30;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__close .tm-product-gallery__icon {
    height: 3rem;
    width: 3rem;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__close:hover,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__close:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    outline: 1px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
    transform: none;
}

.tm-product-gallery__icon {
    display: block;
    fill: currentColor;
    height: 1.5rem;
    width: 1.5rem;
}

.tm-product-gallery__icon--nav {
    height: 2rem;
    width: 2rem;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__icon--nav {
    height: 2.25rem;
    width: 2.25rem;
}

.tm-product-gallery__video-play {
    background: transparent;
    border: 0;
    color: #fff;
    display: grid;
    margin: auto;
    place-items: center;
}

.tm-product-gallery__video-play .tm-product-gallery__icon {
    background: rgba(15, 23, 42, 0.48);
    border-radius: 999px;
    box-sizing: content-box;
    height: 2rem;
    padding: 1rem;
    width: 2rem;
}

.tm-product-gallery__video-play:hover .tm-product-gallery__icon {
    background: rgba(15, 23, 42, 0.65);
}

.tm-product-gallery__video iframe,
.tm-product-gallery__video video {
    border: 0;
    height: 100%;
    width: 100%;
}

.tm-product-gallery__thumbs-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 100%;
    min-width: 0;
}

.tm-product-gallery__thumbs-row .tm-product-gallery__thumbs {
    flex: 1 1 auto;
}

.tm-product-gallery__thumbs {
    isolation: isolate;
    position: relative;
    scrollbar-width: none;
    z-index: 2;
}

.tm-product-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

.tm-product-gallery__thumbs.tm-product-gallery__thumbs--carousel {
    scrollbar-width: thin;
}

.tm-product-gallery__thumbs.tm-product-gallery__thumbs--carousel::-webkit-scrollbar {
    display: block;
    height: 0.45rem;
}

.tm-product-gallery__thumbs.tm-product-gallery__thumbs--stack {
    flex-wrap: wrap;
    overflow: visible;
}

.tm-product-gallery:not(.tm-product-gallery--thumbs-left):not(.tm-product-gallery--thumbs-right) .tm-product-gallery__thumbs.tm-product-gallery__thumbs--stack {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(5.625rem, 1fr));
    overflow: visible;
    width: 100%;
}

.tm-product-gallery:not(.tm-product-gallery--thumbs-left):not(.tm-product-gallery--thumbs-right) .tm-product-gallery__thumbs.tm-product-gallery__thumbs--stack .tm-product-gallery__thumb {
    aspect-ratio: 1;
    box-sizing: border-box;
    flex: none;
    height: auto;
    max-width: none;
    min-width: 0;
    width: auto;
}

.tm-product-gallery:not(.tm-product-gallery--thumbs-left):not(.tm-product-gallery--thumbs-right) .tm-product-gallery__thumbs.tm-product-gallery__thumbs--stack .tm-product-gallery__thumb img {
    aspect-ratio: 1;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.tm-product-gallery__thumb-nav {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 999px;
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.2);
    color: #0f172a;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
}

.tm-product-gallery__thumb-nav:hover,
.tm-product-gallery__thumb-nav:focus-visible {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.55);
    outline: none;
}

.tm-product-gallery__thumb {
    background: #fff;
    border-radius: 0.5rem;
    flex: 0 0 5.625rem;
    height: 5.625rem;
    max-width: 5.625rem;
    min-width: 5.625rem;
    overflow: hidden;
    position: relative;
    width: 5.625rem;
}

.tm-product-gallery__thumb img {
    display: block;
    height: 5.625rem;
    max-width: 100%;
    object-fit: cover;
    width: 5.625rem;
}

.tm-product-gallery__thumb--active {
    border-color: var(--tm-gallery-accent);
    box-shadow: 0 0 0 1px var(--tm-gallery-accent);
}

.tm-product-gallery__thumb-video {
    align-items: center;
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    display: inline-flex;
    inset: 0;
    justify-content: center;
    position: absolute;
}

.tm-product-gallery__nav--next {
    left: auto;
    right: 1rem;
}

.tm-product-gallery__nav--previous {
    left: 1rem;
    right: auto;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--previous {
    left: 1rem;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--next {
    right: 1rem;
}

.tm-product-gallery__fullscreen {
    bottom: 10px;
    right: 10px;
    top: auto;
    transform: none;
}

@media (max-width: 767px) {
    .tm-product-gallery__stage {
        min-height: 14rem;
    }

    .tm-product-gallery__nav--stage {
        min-height: 2.75rem;
        min-width: 2.75rem;
    }

    .tm-product-gallery__icon--nav {
        height: 1.625rem;
        width: 1.625rem;
    }

    .tm-product-gallery__nav--next {
        right: 0.625rem;
    }

    .tm-product-gallery__nav--previous {
        left: 0.625rem;
    }

    .tm-product-gallery__zoom-pane,
    .tm-product-gallery__zoom-window,
    .tm-product-gallery__lens {
        display: none !important;
    }

    .tm-product-gallery__dialog--fullscreen {
        padding: 4rem 1rem 3rem;
    }
}

@media (min-width: 768px) {
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large {
        padding: 4rem 1.25rem 3.75rem;
    }

    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__stage {
        background: transparent !important;
        height: calc(100dvh - 7.75rem);
        max-width: calc(100vw - 11rem);
        width: calc(100vw - 11rem);
    }

    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__stage {
        height: auto;
        max-width: calc(100vw - 11rem);
        width: calc(100vw - 11rem);
    }

    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__media,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__viewport {
        background: transparent;
        height: 100%;
        max-width: 100%;
        width: 100%;
    }

    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__photo {
        align-items: center;
        container: tm-gallery-photo / size;
        display: flex;
        height: 100%;
        justify-content: center;
        min-height: 0;
        min-width: 0;
        width: 100%;
    }

    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__image {
        height: auto;
        max-height: 100%;
        max-width: 100%;
        min-height: 0;
        min-width: 0;
        object-fit: contain;
        width: auto;
    }
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    justify-content: flex-start;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__stage {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    height: auto;
    justify-content: flex-start;
    max-height: 100%;
    max-width: 100%;
    min-height: 0;
    width: 100%;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__media,
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__viewport,
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__photo {
    max-width: 100%;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__media,
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__viewport {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    height: auto;
    min-height: 0;
    width: 100%;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__viewport {
    align-items: center;
    justify-content: center;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__photo {
    container: tm-gallery-photo / size;
    display: grid;
    flex: 1 1 0;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    height: auto;
    max-height: none;
    min-height: 0;
    min-width: 0;
    overflow: visible;
    place-items: center;
    position: relative;
    width: 100%;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__image,
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__fade-from {
    border-radius: 12px;
    grid-area: 1 / 1;
    height: auto;
    max-height: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    object-fit: contain;
    overflow: hidden;
    width: auto;
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__image {
    inset: auto;
    position: relative;
}

/* The fade layer has to sit on the stage image. The shared thumbs rule used
   to set position:relative and inset:auto, which took it off the cover. */
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__fade-from,
.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__fade-from {
    bottom: auto;
    left: 50%;
    margin: 0;
    position: absolute;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* Size the lightbox image to the fitted bitmap. Percentages do not resolve
   against this size container, so the query units carry the frame size.
   A landscape frame is height-led and a portrait frame is width-led. */
@container tm-gallery-photo (aspect-ratio > 1 / 1) {
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__image,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__fade-from,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__image,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__fade-from {
        height: 100cqh;
        max-height: 100cqh;
        max-width: 100cqw;
        width: auto;
    }
}

@container tm-gallery-photo (aspect-ratio <= 1 / 1) {
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__image,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__fade-from,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__image,
    .tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-large .tm-product-gallery__fade-from {
        height: auto;
        max-height: 100cqh;
        max-width: 100cqw;
        width: 100cqw;
    }
}

.tm-product-gallery__dialog--fullscreen.tm-product-gallery__dialog--lightbox-thumbs .tm-product-gallery__modal-title {
    align-self: stretch;
    bottom: auto;
    color: #fff;
    flex: 0 0 auto;
    left: auto;
    margin-top: 0.45rem;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 0 0.75rem 0.15rem;
    position: relative;
    right: auto;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    white-space: nowrap;
}

.tm-product-gallery--zoom-lens.tm-product-gallery--lens-circle .tm-product-gallery__lens {
    border-radius: 50%;
}

.tm-product-gallery__photo {
    position: relative;
    width: 100%;
}

.tm-product-gallery__placeholder {
    pointer-events: none;
    width: 100%;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__photo {
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    width: auto;
}

.tm-product-gallery__fade-from {
    display: block;
    height: 100%;
    inset: 0;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 100%;
    z-index: 2;
}

/* Hold the outgoing bitmap over the stage. The incoming photo stays at
   opacity 0 until the same class starts both fades. */
.tm-product-gallery__photo--crossfade:not(.tm-product-gallery__photo--crossfade-out) .tm-product-gallery__fade-from {
    opacity: 1;
}

.tm-product-gallery__photo--crossfade:not(.tm-product-gallery__photo--crossfade-out) .tm-product-gallery__image {
    opacity: 0;
}

.tm-product-gallery__photo--crossfade-out .tm-product-gallery__image,
.tm-product-gallery__fade-from--out,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop--out::before {
    transition: opacity 200ms ease;
}

.tm-product-gallery__photo--crossfade-out .tm-product-gallery__image {
    opacity: 1;
}

.tm-product-gallery__fade-from--out {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tm-product-gallery__photo--crossfade-out .tm-product-gallery__image,
    .tm-product-gallery__fade-from--out,
    .tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop--out::before {
        transition: none;
    }
}

.tm-product-gallery__hint {
    align-items: center;
    background: rgba(15, 23, 42, 0.62);
    border-radius: 999px;
    bottom: 0.75rem;
    color: #fff;
    display: inline-flex;
    font-size: 0.8125rem;
    gap: 0.4rem;
    left: 50%;
    line-height: 1.3;
    margin: 0;
    padding: 0.3rem 0.7rem 0.3rem 0.55rem;
    pointer-events: none;
    position: absolute;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 18;
}

.tm-product-gallery__hint-icon {
    display: block;
    flex: 0 0 auto;
    height: 1rem;
    width: 1rem;
}

.tm-product-gallery__zoom-caption {
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    font-size: 0.75rem;
    left: 0;
    line-height: 1.35;
    padding: 0.35rem 0.55rem;
    position: absolute;
    right: 0;
}

.tm-product-gallery__zoom-caption--top {
    top: 0;
}

.tm-product-gallery__zoom-caption--bottom {
    bottom: 0;
}

.tm-product-gallery__dialog--close-outside .tm-product-gallery__modal-backdrop {
    cursor: pointer;
    pointer-events: auto;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__stage,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__media,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__viewport,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__photo,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__modal-backdrop {
    cursor: default;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__image,
.tm-product-gallery__dialog--fullscreen .tm-product-gallery__fade-from {
    cursor: default !important;
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__fade-from {
    border-radius: 12px;
    filter: drop-shadow(0 1.5rem 3rem rgba(0, 0, 0, 0.4));
}

.tm-product-gallery__dialog--fullscreen .tm-product-gallery__image {
    touch-action: none;
}

.tm-product-gallery--thumbs-top .tm-product-gallery__dialog,
.tm-product-gallery--thumbs-left .tm-product-gallery__dialog,
.tm-product-gallery--thumbs-right .tm-product-gallery__dialog {
    display: flex;
    gap: 0.75rem;
}

.tm-product-gallery--thumbs-top .tm-product-gallery__dialog {
    flex-direction: column;
}

.tm-product-gallery--thumbs-top .tm-product-gallery__thumbs-row {
    margin-bottom: 0;
    margin-top: 0;
    order: -1;
}

.tm-product-gallery--thumbs-left .tm-product-gallery__dialog,
.tm-product-gallery--thumbs-right .tm-product-gallery__dialog {
    align-items: flex-start;
    flex-direction: row;
}

.tm-product-gallery--thumbs-right .tm-product-gallery__thumbs-row {
    order: 2;
}

.tm-product-gallery--thumbs-left .tm-product-gallery__stage,
.tm-product-gallery--thumbs-right .tm-product-gallery__stage {
    flex: 1 1 auto;
    min-width: 0;
}

.tm-product-gallery--thumbs-left .tm-product-gallery__thumbs-row,
.tm-product-gallery--thumbs-right .tm-product-gallery__thumbs-row {
    flex-direction: column;
    margin-top: 0;
    max-height: 36rem;
}

.tm-product-gallery--thumbs-left .tm-product-gallery__thumbs,
.tm-product-gallery--thumbs-right .tm-product-gallery__thumbs {
    flex-direction: column;
    max-height: 32rem;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.tm-product-gallery--thumbs-top .tm-product-gallery__dialog--fullscreen,
.tm-product-gallery--thumbs-left .tm-product-gallery__dialog--fullscreen,
.tm-product-gallery--thumbs-right .tm-product-gallery__dialog--fullscreen {
    display: grid;
}

[dir="rtl"] .tm-product-gallery__nav--previous {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .tm-product-gallery__nav--next {
    left: 1rem;
    right: auto;
}

[dir="rtl"] .tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--previous {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .tm-product-gallery__dialog--fullscreen .tm-product-gallery__nav--next {
    left: 1rem;
    right: auto;
}
