/* wnm_image_zoom - frontend. Loaded on the product detail page only. */

.wnm-iz-gallery img[data-wnm-iz],
.wnm-iz-modal img[data-wnm-iz] {
    transform-origin: 50% 50%;
    transition: transform .18s ease-out;
    will-change: transform;
}

/* Following the pointer or dragged by hand: no easing - the image moves WITH the
   hand; easing there lags behind and, with a moving measurement, shakes. */
img.wnm-iz-live[data-wnm-iz] {
    transition: none !important;
}

.wnm-iz-gallery img.wnm-iz-zoomed,
.wnm-iz-modal img.wnm-iz-zoomed {
    cursor: grab;
    position: relative;
    z-index: 2;
    touch-action: none;
}

.wnm-iz-gallery img.wnm-iz-zoomed:active,
.wnm-iz-modal img.wnm-iz-zoomed:active {
    cursor: grabbing;
}

/* In fullscreen the gesture belongs to the zoom, not to the page. */
.wnm-iz-wrapper.fullscreen .wnm-iz-gallery img[data-wnm-iz] {
    cursor: zoom-in;
    touch-action: none;
}

.wnm-iz-wrapper.fullscreen .wnm-iz-gallery img.wnm-iz-zoomed {
    cursor: grab;
}

/* Clip the zoomed image to its slide. */
.wnm-iz-wrapper.fullscreen .wnm-iz-gallery .inner,
.wnm-iz-modal .inner {
    overflow: hidden;
}

/* Vertical scrolling of the modal list stays with the browser at scale 1. */
.wnm-iz-modal img[data-wnm-iz] {
    touch-action: pan-y;
}

/* Zoom buttons: fullscreen only. */
.wnm-iz-tools {
    display: none;
}

/* One frosted capsule: readout, then the controls. Translucent so the product
   stays visible behind it; a solid fallback where backdrop-filter is missing. */
.wnm-iz-wrapper.fullscreen .wnm-iz-tools {
    display: flex;
    align-items: center;
    gap: .125rem;
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 5;
    padding: .3125rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(22, 24, 29, .08);
    box-shadow: 0 8px 24px rgba(22, 24, 29, .16), 0 1px 2px rgba(22, 24, 29, .08);
    color: #16181d;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .wnm-iz-wrapper.fullscreen .wnm-iz-tools {
        background: rgba(255, 255, 255, .72);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
        backdrop-filter: saturate(1.6) blur(14px);
    }
}

.wnm-iz-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: 600 .8125rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .15s ease, transform .12s ease;
}

.wnm-iz-btn--text {
    width: auto;
    min-width: 2.5rem;
    padding: 0 .625rem;
    letter-spacing: .02em;
}

.wnm-iz-btn:hover {
    background: rgba(22, 24, 29, .08);
}

.wnm-iz-btn:active {
    transform: scale(.92);
    background: rgba(22, 24, 29, .14);
}

.wnm-iz-btn:focus-visible {
    outline: 2px solid #0b6bcb;
    outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
    .wnm-iz-btn {
        transition: none;
    }

    .wnm-iz-btn:active {
        transform: none;
    }
}

/* Loading hint while the zoom size is on its way. The small image stays visible. */
.wnm-iz-loading {
    position: relative;
}

.wnm-iz-loading::after {
    content: "";
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(0, 0, 0, .2);
    border-top-color: rgba(0, 0, 0, .65);
    border-radius: 50%;
    animation: wnm-iz-spin .8s linear infinite;
    z-index: 3;
    pointer-events: none;
}

@keyframes wnm-iz-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Hover lens. */
.wnm-iz-lens {
    display: none;
    position: absolute;
    z-index: 4;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    background-color: #fff;
    background-repeat: no-repeat;
    pointer-events: none;
}

/* The lens belongs to the page view. However fullscreen was entered (a click, a
   key, NOVA's own code), it must not survive into it. */
.wnm-iz-wrapper.fullscreen .wnm-iz-lens {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .wnm-iz-gallery img[data-wnm-iz],
    .wnm-iz-modal img[data-wnm-iz] {
        transition: none;
    }

    .wnm-iz-loading::after {
        animation: none;
    }
}

/* ---- 0.1.2 ------------------------------------------------------------- */

/* Screen-reader status line. */
.wnm-iz-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Zoom cursor on the page view (desktop); fullscreen sets its own. */
@media (hover: hover) and (min-width: 992px) {
    .wnm-iz-hint-cursor img[data-wnm-iz] {
        cursor: zoom-in;
    }
}

/* One-time hint badge. */
.wnm-iz-hint-host {
    position: relative;
}

.wnm-iz-hint-badge {
    position: absolute;
    left: 50%;
    bottom: .75rem;
    transform: translateX(-50%);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .75rem .375rem .625rem;
    border-radius: 999px;
    background: rgba(22, 24, 29, .72);
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 6px 18px rgba(22, 24, 29, .22);
    color: #fff;
    font: 500 .8125rem/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    white-space: nowrap;
    pointer-events: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: wnm-iz-rise .35s ease-out both;
}

/* A magnifier before the text, drawn in CSS (no markup change). */
.wnm-iz-hint-badge::before {
    content: "";
    width: .875rem;
    height: .875rem;
    flex: none;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M12.7 12.7 17 17'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='5.5'/%3E%3Cpath d='M12.7 12.7 17 17'/%3E%3C/svg%3E") center / contain no-repeat;
}

@keyframes wnm-iz-rise {
    from {
        opacity: 0;
        transform: translate(-50%, 6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wnm-iz-hint-badge {
        animation: none;
    }
}

.wnm-iz-wrapper.fullscreen .wnm-iz-hint-badge {
    display: none;
}

/* Hover hint in the opened fullscreen: mouse and trackpad only - a touch screen
   has no hover, and there the double tap is announced by the zoom itself. */
.wnm-iz-dbl {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .wnm-iz-dbl {
        display: block;
        /* Next to the cursor: left/top are set from the pointer (viewport px). */
        position: fixed;
        left: 0;
        top: 0;
        /* Above NOVA's fullscreen (#image_wrapper.fullscreen: z-index 10000,
           _productdetails.scss:62) - on <body> the hint competes with it. */
        z-index: 10010;
        padding: .3125rem .625rem;
        border-radius: 8px;
        background: rgba(22, 24, 29, .8);
        border: 1px solid rgba(255, 255, 255, .12);
        box-shadow: 0 6px 18px rgba(22, 24, 29, .24);
        color: #fff;
        font: 500 .75rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
        white-space: nowrap;
        pointer-events: none;
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
        opacity: 0;
        translate: 0 4px;
        transition: opacity .18s ease, translate .18s ease;
    }

    .wnm-iz-dbl.is-on {
        opacity: 1;
        translate: 0 0;
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
    .wnm-iz-dbl {
        transition: none;
    }
}

/* Zoom readout, first in the capsule: steady-width digits so it does not jitter
   while the wheel turns; stronger once zoomed. */
.wnm-iz-level {
    min-width: 3.25rem;
    padding: 0 .5rem 0 .625rem;
    color: rgba(22, 24, 29, .62);
    font: 600 .8125rem/2.5rem system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
    text-align: center;
    border-right: 1px solid rgba(22, 24, 29, .1);
    margin-right: .125rem;
    transition: color .15s ease;
}

.wnm-iz-tools.is-zoomed .wnm-iz-level {
    color: #16181d;
}

/* ---- thumbnails that respond ---------------------------------------------------
   NOVA's preview strip under the product image (#gallery_preview): a little
   larger under the mouse, a short give on click or tap, the shown one slightly
   raised. The SLIDE is scaled, never the image: NOVA centres every thumbnail with
   transform: translate(-50%, -50%) on the img (components/_figures.scss, 5.7.0),
   and a scale there replaces it - 0.2.7 did that and pushed each image to the
   bottom right of its square. The list gets 4px above and below so a grown slide
   is not cut by Slick's overflow. Nothing moves with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    .wnm-iz-motion #gallery_preview .slick-list {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .wnm-iz-motion #gallery_preview .slick-slide {
        position: relative;
        transition: transform .22s cubic-bezier(.2, .8, .3, 1), filter .22s ease;
    }

    .wnm-iz-motion #gallery_preview .slick-slide.slick-current {
        transform: scale(1.03);
        z-index: 1;
    }

    .wnm-iz-motion #gallery_preview .slick-slide:not(.slick-current) {
        filter: saturate(.9) brightness(.97);
    }

    .wnm-iz-motion #gallery_preview .slick-slide:active {
        transform: scale(.96);
        transition-duration: .08s;
    }
}

@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    .wnm-iz-motion #gallery_preview .slick-slide:hover {
        transform: scale(1.06);
        filter: none;
        z-index: 2;
        cursor: pointer;
    }
}

/* ---- mobile viewer ------------------------------------------------------- */

html.wnm-iz-lock,
html.wnm-iz-lock body {
    overflow: hidden !important;
}

.wnm-iz-viewer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: #0b0c0e;
    color: #fff;
    font: 500 .9375rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* The bar floats over the image on a soft gradient, so the image keeps the
   whole screen; notches and rounded corners are respected. */
.wnm-iz-viewer-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .625rem .75rem 1.5rem;
    padding-top: max(.625rem, env(safe-area-inset-top));
    padding-left: max(.75rem, env(safe-area-inset-left));
    padding-right: max(.75rem, env(safe-area-inset-right));
    background: linear-gradient(to bottom, rgba(11, 12, 14, .72), rgba(11, 12, 14, 0));
    pointer-events: none;
}

.wnm-iz-viewer-bar > * {
    pointer-events: auto;
}

.wnm-iz-viewer-count,
.wnm-iz-viewer-level {
    padding: .375rem .75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    font-size: .8125rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wnm-iz-viewer-count {
    margin-right: auto;
}

.wnm-iz-viewer-level {
    color: rgba(255, 255, 255, .8);
}

.wnm-iz-viewer-close,
.wnm-iz-viewer-zoom,
.wnm-iz-viewer-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* 48px: comfortably above the 44px touch minimum, also on zoomed screens. */
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}

.wnm-iz-viewer-close:active,
.wnm-iz-viewer-zoom:active,
.wnm-iz-viewer-nav:active {
    transform: scale(.92);
    background: rgba(255, 255, 255, .22);
}

.wnm-iz-viewer-close:focus-visible,
.wnm-iz-viewer-zoom:focus-visible,
.wnm-iz-viewer-nav:focus-visible {
    outline: 2px solid #6fb8f0;
    outline-offset: 2px;
}

/* The zoom buttons sit between counter and level; a little smaller than close so
   the bar still fits a 320 px phone. */
.wnm-iz-viewer-zoom {
    width: 2.75rem;
    height: 2.75rem;
}

.wnm-iz-viewer-bar .wnm-iz-viewer-count {
    margin-right: auto;
}

/* Thumbnail strip, above the home indicator: where am I, and a jump to any image. */
.wnm-iz-viewer-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    justify-content: safe center;
    gap: .375rem;
    padding: 1.25rem .75rem max(.75rem, env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
    background: linear-gradient(to top, rgba(11, 12, 14, .72), rgba(11, 12, 14, 0));
}

.wnm-iz-viewer-thumbs::-webkit-scrollbar {
    display: none;
}

.wnm-iz-viewer-thumb {
    flex: 0 0 auto;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
    opacity: .6;
    cursor: pointer;
    transition: opacity .2s ease, border-color .2s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
}

.wnm-iz-viewer-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.wnm-iz-viewer-thumb.is-on {
    opacity: 1;
    border-color: #fff;
}

.wnm-iz-viewer-thumb:active {
    transform: scale(.94);
}

.wnm-iz-viewer-thumb:focus-visible {
    outline: 2px solid #6fb8f0;
    outline-offset: 2px;
}

/* Pull down to close: the images follow the finger, the backdrop fades. */
.wnm-iz-viewer.is-pulling .wnm-iz-track {
    transform: translateY(var(--wnm-iz-pull, 0));
}

.wnm-iz-viewer.is-pulling {
    background: rgba(11, 12, 14, var(--wnm-iz-pull-fade, 1));
}

.wnm-iz-viewer.is-pulling .wnm-iz-viewer-bar,
.wnm-iz-viewer.is-pulling .wnm-iz-viewer-thumbs {
    opacity: 0;
}

.wnm-iz-viewer.is-springing .wnm-iz-track {
    transition: transform .2s ease-out;
}

/* First-visit gesture tip (NOVA's image window and the viewer): above both,
   above the home indicator, two lines that never break mid-phrase. */
.wnm-iz-tip {
    position: fixed;
    left: 50%;
    bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 5rem));
    z-index: 100001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .125rem;
    width: max-content;
    max-width: calc(100% - 2rem);
    transform: translateX(-50%);
    padding: .5625rem 1rem;
    border-radius: 14px;
    background: rgba(22, 24, 29, .78);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #fff;
    font: 500 .8125rem/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    pointer-events: none;
    animation: wnm-iz-tip-in .3s ease-out both;
    transition: opacity .3s ease;
}

.wnm-iz-tip span {
    white-space: nowrap;
}

.wnm-iz-tip.is-gone {
    opacity: 0;
}

@keyframes wnm-iz-tip-in {
    from {
        opacity: 0;
        transform: translate(-50%, 8px);
    }
}

.wnm-iz-track {
    flex: 1 1 auto;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.wnm-iz-track::-webkit-scrollbar {
    display: none;
}

/* While an image is zoomed the finger pans the image, not the strip. */
.wnm-iz-track.wnm-iz-track-locked {
    overflow-x: hidden;
}

.wnm-iz-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.wnm-iz-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: 50% 50%;
    transition: transform .18s ease-out;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-drag: none;
}

.wnm-iz-slide img.wnm-iz-zoomed {
    touch-action: none;
}

.wnm-iz-viewer-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    margin-top: -1.5rem;
}

.wnm-iz-viewer-prev {
    left: max(.5rem, env(safe-area-inset-left));
}

.wnm-iz-viewer-next {
    right: max(.5rem, env(safe-area-inset-right));
}

@media (hover: none) {
    .wnm-iz-viewer-nav {
        display: none; /* swipe instead; keyboard and pointer users keep the buttons */
    }
}

@media (prefers-reduced-motion: reduce) {
    .wnm-iz-slide img {
        transition: none;
    }

    .wnm-iz-track {
        scroll-behavior: auto;
    }

    .wnm-iz-viewer-close,
    .wnm-iz-viewer-nav,
    .wnm-iz-viewer-thumb,
    .wnm-iz-viewer.is-springing .wnm-iz-track {
        transition: none;
    }

    .wnm-iz-viewer-close:active,
    .wnm-iz-viewer-nav:active {
        transform: none;
    }

    .wnm-iz-tip {
        animation: none;
    }
}
