.shop-picker-card {
    position: relative;
    min-width: 0;
}

.shop-picker-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    color: #344054;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.shop-picker-zoom:hover,
.shop-picker-zoom:focus-visible {
    background: #fff;
    outline: 2px solid var(--tenant-primary-color);
}

.shop-picker-preview {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    background: var(--shop-image-viewer-backdrop);
    color: #fff;
}

.shop-picker-preview[hidden] {
    display: none;
}

.shop-picker-preview-header {
    display: flex;
    justify-content: flex-end;
    padding: 12px;
}

.shop-picker-preview-stage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    flex: 1;
    padding: 12px;
}

.shop-picker-preview-image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 10rem);
    min-height: 0;
    object-fit: contain;
}

.shop-picker-preview-nav {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #344054;
}

.shop-picker-preview-nav:disabled {
    visibility: hidden;
}

.shop-picker-preview-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 12px 16px 20px;
}

.shop-photo-filename,
.glightbox-container .shop-photo-filename {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 12px 0 0 !important;
    padding: 0 12px !important;
    background: transparent;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 12px !important;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
    max-height: 6rem;
    overflow-y: auto;
    user-select: text;
}

.shop-photo-filename[hidden] {
    display: none;
}

.shop-photo-filename:focus-visible {
    outline: 2px solid var(--tenant-primary-color, var(--bs-primary));
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .shop-picker-preview-stage { gap: 4px; padding: 4px; }
}

.shop-picker-preview-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    max-width: calc(100% - 104px);
    margin: 0;
}
#modalBody { flex-direction: column !important; align-items: center; }
@media (max-width: 576px) {
    .shop-picker-preview-figure { max-width: calc(100% - 88px); }
}

/* Keep separate captions at the rendered image width, even for long filenames. */
.shop-captioned-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 0;
}
.shop-captioned-image .shop-photo-filename,
.shop-picker-preview-figure .shop-photo-filename {
    width: 0;
    min-width: 100%;
}

#modalBody .shop-captioned-image > [photo-product] { max-width: 100%; }

/* Shared presentation for gallery, download, magnifier and picker previews. */
/* Download previews use native image slides so touch swipe and pinch zoom work. */
.glightbox-container.download-image-viewer.shop-image-viewer .goverlay {
    background: #111;
}

.download-image-viewer .download-viewer-slide {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: #fff;
    padding: 8px 48px;
    box-sizing: border-box;
}
.download-image-viewer .download-viewer-actions {
    display: flex;
    align-items: center;
    justify-content: center;
}
.download-image-viewer .gallery-lightbox-fav-btn.download-viewer-heart:hover { transform: none; }

.download-image-viewer .download-viewer-position {
    color: #fff;
    font-size: 14px;
}

.download-image-viewer .download-viewer-heart {
    position: static;
    width: 44px;
    height: 44px;
    font-size: 22px;
}

.download-image-viewer .shop-photo-filename {
    color: #ccc;
    margin: 0;
}

@media (max-width: 767px) {
    .glightbox-container.download-image-viewer.shop-image-viewer .gprev,
    .glightbox-container.download-image-viewer.shop-image-viewer .gnext {
        top: auto;
        bottom: max(12px, env(safe-area-inset-bottom));
        transform: none;
        width: 44px;
        height: 44px;
        display: flex;
    }
}

:root {
    --shop-image-viewer-backdrop: rgba(0, 0, 0, 0.92);
}

.glightbox-container.shop-image-viewer .goverlay,
.modal.shop-image-viewer {
    background: var(--shop-image-viewer-backdrop);
}

.glightbox-container.shop-image-viewer .gslide-media,
.glightbox-container.shop-image-viewer .gslide-inline,
.glightbox-container.shop-image-viewer .ginlined-content,
.glightbox-container.shop-image-viewer .gslide-description {
    background: transparent;
    box-shadow: none;
}

.glightbox-container.shop-image-viewer .ginlined-content,
.glightbox-container.shop-image-viewer .gdesc-inner {
    padding: 0;
}

.glightbox-container.shop-image-viewer .gslide-description,
.glightbox-mobile .glightbox-container.shop-image-viewer .gslide-description {
    background: transparent;
    position: relative;
    padding: 0;
    max-height: none;
    /* The vendor's 100% flex basis otherwise pushes mobile images above the viewport. */
    flex: 0 0 auto;
}

.glightbox-container.shop-image-viewer .gslide-desc {
    color: inherit;
}

.glightbox-mobile .shop-image-viewer .gslide-desc:after {
    display: none;
}

.glightbox-container.shop-image-viewer .gslide-image img,
.shop-image-viewer .download-viewer-image {
    max-height: calc(100dvh - 10rem) !important;
}

.glightbox-container.shop-image-viewer .gslide-image img {
    /* Allow portrait photos to fit short viewports without cropping. */
    min-width: 0;
    object-fit: contain;
}

.modal.shop-image-viewer .modal-dialog {
    width: 100%;
    max-width: none !important;
    min-height: 100%;
    margin: 0;
}

.modal.shop-image-viewer .modal-content {
    min-height: 100dvh;
    padding: 12px !important;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
}

.modal.shop-image-viewer .modal-header {
    justify-content: flex-end;
}

.modal.shop-image-viewer .modal-header h2 {
    /* Retain the accessible dialog title without crowding the image. */
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.modal.shop-image-viewer .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.shop-image-viewer .modal-body img {
    max-width: 100%;
    max-height: calc(100dvh - 10rem) !important;
    object-fit: contain;
}

.shop-image-viewer .btn-close,
.shop-picker-preview .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.glightbox-container.shop-image-viewer .gprev,
.glightbox-container.shop-image-viewer .gnext {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
}

.glightbox-container.shop-image-viewer .gprev {
    left: clamp(12px, 4vw, 48px);
    right: auto;
}

.glightbox-container.shop-image-viewer .gnext {
    right: clamp(12px, 4vw, 48px);
    left: auto;
}

/* Photo-first layout: fixed chrome stays outside the swipeable image. */
.download-viewer-designed .download-viewer-header {
    position: absolute;
    inset: env(safe-area-inset-top, 0px) 64px auto 20px;
    height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    z-index: 99999;
}
.download-viewer-heading { min-width: 0; }
.download-viewer-heading strong { display: block; font-size: 23px; font-weight: 600; line-height: 1.2; }
.download-viewer-heading small { display: block; font-size: 13px; color: #bcbcbc; margin-top: 3px; }
.download-viewer-info, .download-viewer-sheet-close {
    border: 0; background: transparent; color: #ddd; min-width: 44px; min-height: 44px;
    font: inherit; font-size: 24px; cursor: pointer;
}
.glightbox-container.download-viewer-designed .gslide-inner-content {
    box-sizing: border-box;
    height: 100dvh;
    padding: calc(76px + env(safe-area-inset-top, 0px)) 0 calc(166px + env(safe-area-inset-bottom, 0px));
}
.glightbox-container.download-viewer-designed .ginner-container { height: 100%; }
.download-viewer-designed .shop-product-viewer-content { display: flex; align-items: center; justify-content: center; height: 100%; background: transparent; }
.download-viewer-designed .shop-product-viewer-content {
    width: 100%;
    container-type: size;
    /* Let GLightbox receive gestures on its inline surface, including over nested mockups. */
    pointer-events: none;
}
.glightbox-container.shop-image-viewer .gslide-inline:has(.shop-product-viewer-content) {
    width: max(1px, calc(100dvw - 32px)) !important;
    height: max(1px, calc(100dvh - 270px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))) !important;
    overflow: hidden;
}
.glightbox-container.shop-image-viewer .ginlined-content:has(.shop-product-viewer-content) {
    width: 100%; height: 100%; overflow: hidden;
}
.shop-product-viewer-content > .photo-product-container > div:hover {
    transform: none;
}
.shop-product-viewer-content .print-crop-preview > svg {
    width: 100%; height: 100%; max-height: 100%;
}
.glightbox-container.download-viewer-designed .gslide-image img {
    max-height: calc(100dvh - 250px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100%;
    object-fit: contain;
}
.glightbox-container.download-viewer-designed.shop-image-viewer .gslide-description {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 0;
    width: 100% !important;
    max-width: none !important;
}
.download-viewer-designed .download-viewer-slide { padding: 0 64px; gap: 12px; max-width: 100%; }
.download-viewer-designed .download-viewer-position { order: 0; line-height: 44px; font-size: 15px; }
.download-viewer-designed .download-viewer-actions { order: 1; }
.download-viewer-designed .shop-photo-filename {
    order: 2; font-size: 12px; line-height: 18px; max-width: 100%;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.download-viewer-designed .gallery-fav-btn.download-viewer-heart {
    width: auto; min-width: 144px; height: 44px; padding: 0 20px; gap: 10px;
    border-radius: 24px; border: 1px solid #555;
    background: #242424; box-shadow: none; transform: none;
}
.glightbox-container.download-image-viewer .gallery-fav-btn.download-viewer-heart {
    color: #ccc;
}
/* Red is reserved for photos that have actually been saved as favourites. */
.glightbox-container.download-image-viewer .gallery-fav-btn.download-viewer-heart[aria-pressed="true"] {
    color: #e74c3c;
    border-color: rgba(231,76,60,.6);
    background: rgba(231,76,60,.12);
}
.download-viewer-designed .download-viewer-heart::after {
    content: attr(data-label-save); color: #fff; font-size: 15px; font-weight: 400;
}
.download-viewer-designed .download-viewer-heart[aria-pressed="true"]::after { content: attr(data-label-saved); }
.glightbox-container.download-viewer-designed.shop-image-viewer .gprev,
.glightbox-container.download-viewer-designed.shop-image-viewer .gnext {
    display: flex; top: auto; bottom: calc(114px + env(safe-area-inset-bottom, 0px));
    transform: none; width: 44px; height: 44px; border-radius: 50%; background: #242424;
}
.glightbox-container.download-viewer-designed.shop-image-viewer .gclose {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #242424;
    opacity: 1;
}
.download-viewer-sheet {
    position: fixed; inset: auto 0 0; margin: 0 auto; box-sizing: border-box;
    width: 100%; max-width: 540px; max-height: 85dvh; overflow-y: auto;
    border: 1px solid #393939; border-radius: 24px 24px 0 0;
    padding: 22px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    background: #202020; color: #fff; font-family: inherit;
}
.download-viewer-sheet::backdrop { background: rgba(0,0,0,.55); }
.download-viewer-sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 4px; background: #666; margin: -8px auto 12px; }
.download-viewer-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.download-viewer-sheet-header h2 { font-size: 22px; font-weight: 600; color: #fff; margin: 0; }
.download-viewer-info-rows { margin: 16px 0 24px; }
.download-viewer-info-rows > div { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid #3b3b3b; font-size: 14px; }
.download-viewer-info-rows dt { color: #ccc; font-weight: 400; }
.download-viewer-info-rows dd { margin: 0; text-align: right; overflow-wrap: anywhere; min-width: 0; max-width: 65%; }
.download-viewer-copy { border: 1px solid #555; border-radius: 12px; background: #292929; color: #fff; font: inherit; padding: 12px 16px; min-height: 44px; width: 100%; cursor: pointer; }
.download-viewer-copy-status { color: #ccc; font-size: 13px; min-height: 20px; margin: 10px 0 0; }
.download-viewer-designed button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Package choices reuse the viewer, with a separate selection action beside the heart. */
.package-image-viewer .download-viewer-actions { gap: 12px; }
.package-image-viewer .gallery-fav-btn.download-viewer-heart {
    min-width: 44px;
    width: 44px;
    padding: 0;
}
.package-image-viewer .download-viewer-heart::after { display: none; }
.package-image-viewer .shop-primary-action {
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 12px;
    border-color: var(--tenant-primary-color, var(--bs-primary));
    background: var(--tenant-primary-color, var(--bs-primary));
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
}

/* Short landscape viewports use side rails instead of reserving vertical chrome. */
@media (orientation: landscape) and (max-height: 500px) {
    .glightbox-container.download-viewer-designed {
        --viewer-rail: clamp(110px, 18vw, 160px);
    }
    .glightbox-container.download-viewer-designed .gslide-inner-content {
        width: 100vw !important;
        max-width: none !important;
        padding: max(8px, env(safe-area-inset-top)) calc(var(--viewer-rail) + env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) calc(var(--viewer-rail) + env(safe-area-inset-left));
    }
    .glightbox-container.download-viewer-designed .ginner-container {
        width: 100% !important;
        max-width: none !important;
    }
    .glightbox-container.download-viewer-designed .gslide-image img {
        max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
        max-width: 100%;
    }
    .download-viewer-designed .download-viewer-header {
        left: max(12px, env(safe-area-inset-left));
        right: auto;
        top: max(12px, env(safe-area-inset-top));
        width: calc(var(--viewer-rail) - 24px);
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .download-viewer-designed .download-viewer-heading strong { font-size: 20px; }
    .download-viewer-designed .download-viewer-heading small { overflow-wrap: anywhere; }
    .glightbox-container.download-viewer-designed.shop-image-viewer .gslide-description {
        position: fixed;
        left: auto;
        right: env(safe-area-inset-right);
        top: 72px;
        bottom: 64px;
        width: var(--viewer-rail) !important;
        display: flex;
        align-items: center;
    }
    .download-viewer-designed .download-viewer-slide { padding: 0 8px; gap: 8px; }
    .download-viewer-designed .gallery-fav-btn.download-viewer-heart { min-width: 0; padding: 0 10px; gap: 6px; }
    .download-viewer-designed .download-viewer-heart::after { font-size: 13px; }
    .download-viewer-designed .shop-photo-filename { white-space: normal; overflow-wrap: anywhere; font-size: 11px; }
    .glightbox-container.download-viewer-designed.shop-image-viewer .gprev,
    .glightbox-container.download-viewer-designed.shop-image-viewer .gnext {
        bottom: max(12px, env(safe-area-inset-bottom));
    }
}
/* Keep the caption below the artwork so the entire stage remains available. */
body.shop-ui .product-preview-label {
    display: block;
    width: max-content;
    max-width: 100%;
    min-height: 40px;
    margin: 4px auto 0;
    padding: 5px 12px 0;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--tenant-primary-color, var(--bs-primary)) 22%, transparent);
    background: transparent;
    color: color-mix(in srgb, var(--tenant-primary-color, var(--bs-primary)) 75%, #222);
    text-align: center;
    pointer-events: none;
    animation: product-sign-appear 180ms ease-out;
}
body.shop-ui .product-preview-label-title {
    display: block;
    font-family: 'Caveat', cursive;
    font-size: clamp(18px, 1.5vw, 21px);
    font-weight: 600;
    line-height: 1.05;
    overflow-wrap: anywhere;
}
body.shop-ui .product-preview-label-detail {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
@keyframes product-sign-appear { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    body.shop-ui .product-preview-label { animation: none; }
}
body.shop-ui :is(#Individual-carousel, #Group-carousel) .square-container > .print-crop-preview > svg {
    width: 100%;
    height: 100%;
    max-height: 100%;
    min-height: 0;
}
/* A quiet edge vignette keeps the photo area white and the focus in the center. */
body.shop-ui :is(#einzelprodukte, #gruppenfotos) .individual-preview-column {
    background: radial-gradient(ellipse at center, #fff 48%, #fafafa 78%, #f0f1f2 100%);
}
body.shop-ui :is(#Individual-carousel, #Group-carousel) .square-container {
    background: transparent;
}@media (min-width: 992px) {
    /* Paint on the outer card so its padding cannot leave a white rim. */
    body.shop-ui :is(#einzelprodukte, #gruppenfotos) > .card-product.individual-product-layout {
        background: radial-gradient(ellipse at center, #fff 48%, #fafafa 78%, #f0f1f2 100%) left center / 50% 100% no-repeat, #fff;
        background-clip: padding-box;
    }
    body.shop-ui :is(#einzelprodukte, #gruppenfotos) .individual-preview-column {
        background: transparent;
    }
}
