/* Lens on the photo: the area being magnified stays clear, the rest of the photo fades. */
.wsdz-lens-box {
    position: absolute;
    z-index: 3;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
}

.wsdz-lens-box.is-on {
    opacity: 1;
}

.wsdz-lens {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid rgba(23, 59, 52, .28);
    box-shadow: 0 0 0 200vmax rgba(255, 255, 255, .55);
}

/* Magnified window: beside the photo on wide screens, over it on narrow ones. */
.wsdz-pane {
    position: fixed;
    z-index: 900;
    box-sizing: border-box;
    overflow: hidden;
    background: #fff;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease, visibility 0s linear .2s;
}

.wsdz-pane.is-on {
    visibility: visible;
    opacity: 1;
    transition: opacity .2s ease;
}

.wsdz-pane--inner {
    position: absolute;
    z-index: 3;
}

.wsdz-pane--beside {
    border: 1px solid #d7e4de;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(14, 45, 40, .18);
}

.wsdz-pane-image {
    display: block;
    max-width: none;
    max-height: none;
    will-change: transform;
}

/* "Hover to zoom" pill */
.wsdz-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 9px;
    border-radius: 99px;
    background: rgba(23, 33, 31, .72);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

.wsdz-hint-icon {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.fotorama__stage__frame.fotorama__active .fotorama__img {
    cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
    .wsdz-lens-box,
    .wsdz-pane,
    .wsdz-pane.is-on {
        transition: none;
    }
}

.wsdz-trigger {
    margin: 12px 0 0;
    min-height: 44px;
    padding: 9px 16px;
    border: 1px solid #b6d1c8;
    border-radius: 8px;
    background: #f1f8f5;
    color: #174a40;
    font-weight: 600;
}

.wsdz-trigger:hover {
    border-color: #087a70;
    background: #e4f2ec;
    color: #133b33;
}

.wsdz-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(1100px, calc(100% - 32px));
    height: min(880px, calc(100dvh - 32px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr) auto;
    border: 1px solid #c5d9d1;
    border-radius: 16px;
    background: #f1f6f3;
    color: #173b34;
    box-shadow: 0 24px 80px #0e2d2866;
}

.wsdz-dialog[open] {
    display: grid;
}

.wsdz-dialog::backdrop {
    background: #102722b5;
}

html:has(.wsdz-dialog[open]) {
    overflow: hidden;
}

.wsdz-bar,
.wsdz-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff;
}

.wsdz-bar {
    border-bottom: 1px solid #d7e4de;
}

.wsdz-footer {
    border-top: 1px solid #d7e4de;
}

.wsdz-counter {
    margin-inline-end: auto;
    font-size: 13px;
    font-weight: 600;
}

.wsdz-control,
.wsdz-thumbnail {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    border: 1px solid #c5d8d0;
    border-radius: 8px;
    background: #fff;
    color: #173b34;
    font: inherit;
    font-size: 20px;
    line-height: 1;
}

.wsdz-fit {
    font-size: 13px;
}

.wsdz-control:hover:not(:disabled),
.wsdz-thumbnail:hover {
    border-color: #087a70;
    background: #edf7f2;
    color: #173b34;
}

.wsdz-control:disabled {
    opacity: .45;
}

.wsdz-dialog :focus-visible,
.wsdz-trigger:focus-visible {
    outline: 3px solid #11786d;
    outline-offset: -3px;
}

.wsdz-viewport {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    touch-action: pan-y pinch-zoom;
}

.wsdz-viewport.wsdz-magnified {
    cursor: grab;
    touch-action: none;
}

.wsdz-viewport.wsdz-magnified:active {
    cursor: grabbing;
}

.wsdz-canvas {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: max-content;
    height: max-content;
    min-width: 100%;
    min-height: 100%;
    padding: 24px;
    user-select: none;
}

.wsdz-photo {
    display: block;
    max-width: none;
    max-height: none;
    object-fit: contain;
}

.wsdz-thumbnails {
    display: flex;
    align-items: center;
    justify-content: safe center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 3px;
    overflow-x: auto;
}

.wsdz-thumbnail {
    width: 56px;
    height: 56px;
    overflow: hidden;
    padding: 3px;
    font-size: 13px;
}

.wsdz-thumbnail[aria-pressed="true"] {
    border: 2px solid #087a70;
    background: #e1f3e9;
}

.wsdz-thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wsdz-image-status {
    max-width: 250px;
    text-align: center;
}

.wsdz-trigger[hidden],
.wsdz-hint[hidden],
.wsdz-dialog [hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    .wsdz-dialog {
        width: calc(100% - 12px);
        height: calc(100dvh - 12px);
        border-radius: 12px;
    }

    .wsdz-bar,
    .wsdz-footer {
        gap: 6px;
        padding: 8px;
    }

    .wsdz-thumbnail {
        width: 46px;
        height: 46px;
    }
}
