/* LYMP | Visualizador de imagens vinculadas ao próprio arquivo */
.lymp-image-zoom {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lymp-image-zoom.is-open { display: flex; }

.lymp-image-zoom__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .94);
    cursor: zoom-out;
}

.lymp-image-zoom__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(100%, 1500px);
    height: min(100%, 94vh);
}

.lymp-image-zoom__toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-height: 48px;
    padding: 0 0 12px;
}

.lymp-image-zoom__control,
.lymp-image-zoom__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 4px;
    background: rgba(35,35,35,.9);
    color: #fff;
    font: 600 18px/1 Arial, sans-serif;
    cursor: pointer;
}

.lymp-image-zoom__control[disabled] { opacity: .35; cursor: default; }
.lymp-image-zoom__control:hover,
.lymp-image-zoom__close:hover { background: #444; color: #fff; }
.lymp-image-zoom__close { margin-left: 8px; font-size: 28px; }

.lymp-image-zoom__viewport {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    cursor: grab;
}

.lymp-image-zoom__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .16s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

.lymp-image-zoom__image.is-zoomed { max-width: none; max-height: none; cursor: grab; }
.lymp-image-zoom__image.is-dragging { cursor: grabbing; transition: none; }

@media (max-width: 767px) {
    .lymp-image-zoom { padding: 10px; }
    .lymp-image-zoom__panel { height: 96vh; }
    .lymp-image-zoom__toolbar { min-height: 44px; padding-bottom: 8px; }
    .lymp-image-zoom__control,
    .lymp-image-zoom__close { min-width: 38px; height: 36px; padding: 0 10px; }
    .lymp-image-zoom__image { max-width: 100%; max-height: 100%; }
}

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


/* LYMP | Indicador de zoom no hover (somente desktop) */
@media (hover: hover) and (pointer: fine) {
    a.lymp-image-zoom-hover {
        position: relative;
        display: inline-block;
        overflow: hidden;
        cursor: none !important;
    }

    a.lymp-image-zoom-hover img {
        transition: filter .2s ease;
    }

    a.lymp-image-zoom-hover::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 2;
        background: rgba(0, 0, 0, .22);
        pointer-events: none;
        animation: lympZoomOverlayIn .18s ease both;
    }

    .lymp-image-zoom-cursor {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000000;
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(255,255,255,.8);
        border-radius: 50%;
        background: rgba(0,0,0,.28);
        color: #fff;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, -50%) scale(.85);
        transition: opacity .15s ease, transform .15s ease;
    }

    .lymp-image-zoom-cursor.is-visible {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .lymp-image-zoom-cursor svg {
        display: block;
        width: 23px;
        height: 23px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    @keyframes lympZoomOverlayIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (prefers-reduced-motion: reduce) {
    a.lymp-image-zoom-hover img,
    .lymp-image-zoom-cursor {
        transition: none;
    }
}


/* LYMP | Hover da galeria de produto LightSlider */
@media (hover: hover) and (pointer: fine) {
    .lSSlideOuter .lightSlider > li.lymp-image-zoom-hover {
        position: relative;
        cursor: none !important;
    }

    .lSSlideOuter .lightSlider > li.lymp-image-zoom-hover::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 20;
        background: rgba(0, 0, 0, .22);
        pointer-events: none;
        animation: lympZoomOverlayIn .18s ease both;
    }

    .lSSlideOuter .lightSlider > li.lymp-image-zoom-hover img {
        cursor: none !important;
    }
}


/* LYMP | Seletor de imagens da galeria dentro do lightbox */
.lymp-image-zoom__thumbnails {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 14px 4px 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.45) transparent;
}

.lymp-image-zoom__thumbnail {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 4px;
    background: rgba(255,255,255,.08);
    opacity: .65;
    cursor: pointer;
    transition: opacity .15s ease, border-color .15s ease, background .15s ease;
}

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

.lymp-image-zoom__thumbnail:hover,
.lymp-image-zoom__thumbnail.is-active {
    border-color: #fff;
    background: rgba(255,255,255,.2);
    opacity: 1;
}

@media (max-width: 767px) {
    .lymp-image-zoom__thumbnails {
        justify-content: flex-start;
        gap: 8px;
        padding-top: 10px;
    }
    .lymp-image-zoom__thumbnail {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
    }
}

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


/* LYMP | Correções de layout do lightbox em telas touch/mobile */
.lymp-image-zoom,
.lymp-image-zoom *,
.lymp-image-zoom *::before,
.lymp-image-zoom *::after {
    box-sizing: border-box;
}

.lymp-image-zoom {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.lymp-image-zoom__panel {
    min-width: 0;
    min-height: 0;
    max-height: 100%;
}

.lymp-image-zoom__toolbar {
    flex: 0 0 auto;
}

.lymp-image-zoom__viewport {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
}

.lymp-image-zoom__thumbnails {
    flex: 0 0 auto;
    min-width: 0;
    max-height: 82px;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
}

.lymp-image-zoom__thumbnail {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
}

.lymp-image-zoom__thumbnail img {
    max-width: 100%;
    max-height: 100%;
}

@media (max-width: 767px) {
    .lymp-image-zoom__thumbnails {
        justify-content: flex-start;
    }

    .lymp-image-zoom {
        padding: max(8px, env(safe-area-inset-top))
                 max(8px, env(safe-area-inset-right))
                 max(8px, env(safe-area-inset-bottom))
                 max(8px, env(safe-area-inset-left));
    }

    .lymp-image-zoom__panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
    }

    .lymp-image-zoom__toolbar {
        min-height: 40px;
        gap: 6px;
        padding: 0 0 6px;
    }

    .lymp-image-zoom__control,
    .lymp-image-zoom__close {
        min-width: 36px;
        height: 34px;
        padding: 0 9px;
    }

    .lymp-image-zoom__close {
        margin-left: 2px;
    }

    .lymp-image-zoom__viewport {
        width: 100%;
    }

    .lymp-image-zoom__image {
        max-width: 100%;
        max-height: 100%;
    }

    .lymp-image-zoom__thumbnails {
        width: 100%;
        max-width: 100%;
        max-height: 66px;
        gap: 7px;
        padding: 7px 0 max(2px, env(safe-area-inset-bottom));
    }

    .lymp-image-zoom__thumbnail {
        flex: 0 0 54px;
        width: 54px;
        height: 54px;
        padding: 2px;
    }
}


/* LYMP | Pan suave da imagem ampliada em dispositivos touch */
.lymp-image-zoom__image.is-zoomed {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    will-change: transform;
}

.lymp-image-zoom__image.is-dragging {
    transition: none !important;
    cursor: grabbing;
}
