/* Gallery layout and controls adapted from the public Mirabell gallery. */
.product-media.gallery { container-type:inline-size; min-width:0; border:0; border-radius:0; overflow:visible; }
.product-media .gallery-stage { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:stretch; position:relative; }
.product-media .product-photo-link { position:relative; display:block; min-width:0; height:min(760px,130cqw); aspect-ratio:auto; border:0; border-radius:9px; overflow:hidden; padding:0; background:#fff; cursor:zoom-in; touch-action:pan-y pinch-zoom; user-select:none; }
.product-media .product-photo-link > img { display:block; width:100%; height:100%; object-fit:contain; max-height:none; pointer-events:none; -webkit-user-drag:none; }
.product-media .product-zoom-label { display:none; }
.gallery-arrow { display:grid; place-items:center; align-self:stretch; min-width:0; width:100%; padding:0; border:0; border-radius:8px; background:transparent; color:#fff; touch-action:pan-y pinch-zoom; cursor:pointer; }
.gallery-arrow-icon { display:grid; place-items:center; width:40px; height:40px; border-radius:50%; pointer-events:none; }
.gallery-arrow svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.gallery-zoom-button { position:absolute; z-index:2; top:12px; right:56px; display:grid; place-items:center; width:38px; height:38px; padding:0; border-radius:50%; cursor:zoom-in; }
.gallery-zoom-button svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:2; }
.gallery-arrow-icon,.gallery-zoom-button { border:1px solid var(--blue-dark); background:var(--blue-dark); color:#fff; box-shadow:inset 0 2px 4px #ffffff24,0 2px 6px #0000001a; transition:filter .15s ease,transform .15s ease; }
.gallery-arrow:hover { background:#29292905; }
.gallery-arrow:hover .gallery-arrow-icon,.gallery-zoom-button:hover { filter:brightness(1.18); }
.gallery-arrow:active .gallery-arrow-icon,.gallery-zoom-button:active { transform:scale(.94); }
.gallery-arrow:focus-visible,.gallery-zoom-button:focus-visible { outline:3px solid var(--blue); outline-offset:-3px; }
.product-gallery { display:grid; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:calc((100% - 32px)/5); gap:8px; margin:25px 5px 0; overflow-x:auto; scrollbar-width:none; scroll-snap-type:x proximity; overscroll-behavior-x:contain; }
.product-gallery::-webkit-scrollbar { display:none; }
.product-gallery button { display:block; padding:0; border:0; background:#f5f5f5; aspect-ratio:1; border-radius:10px; overflow:hidden; position:relative; scroll-snap-align:start; cursor:pointer; }
.product-gallery img { display:block; width:100%; height:100%; object-fit:contain; background:#fff; transition:transform .2s; }
.product-gallery button:hover img { transform:scale(1.05); }
.product-gallery button[aria-pressed="true"] { outline:2px solid var(--blue-dark); outline-offset:-2px; }
.product-gallery button:focus-visible { outline:3px solid var(--blue); outline-offset:-3px; }
.product-gallery button span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.gallery-toolbar { display:flex; align-items:center; gap:14px; min-height:28px; margin:12px 2px 18px; }
.gallery-progress { flex:1; min-width:0; height:3px; background:#f4f4f4; overflow:hidden; }
.gallery-progress span { display:block; height:3px; background:var(--blue-dark); transition:transform .25s; }
.gallery-position { min-width:35px; text-align:center; font-size:12px; font-variant-numeric:tabular-nums; color:#6b6256; }
.product-media.gallery > figcaption { border:0; padding:0 5px; font-size:13px; background:transparent; }
.gallery-outgoing-image { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:contain; pointer-events:none; user-select:none; }
.product-image-dialog.gallery-lightbox { width:min(94vw,1050px); height:94dvh; max-width:94vw; max-height:94dvh; padding:40px; border-radius:18px; overflow:hidden; }
.gallery-lightbox #product-image-title { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.gallery-lightbox .zoom-image-holder { position:relative; width:100%; height:calc(100% - 42px); overflow:hidden; touch-action:pan-y pinch-zoom; user-select:none; }
.gallery-lightbox .zoom-image-holder img { display:block; width:100%; height:100%; max-height:none; object-fit:contain; pointer-events:none; -webkit-user-drag:none; }
.gallery-lightbox .zoom-caption { margin:8px 0 0; text-align:center; font-size:14px; line-height:1.3; }
.gallery-lightbox .lightbox-prev,.gallery-lightbox .lightbox-next { position:absolute; top:48%; border:0; background:var(--blue-dark); color:#fff; width:42px; height:56px; border-radius:8px; font-size:40px; line-height:1; z-index:1; cursor:pointer; }
.gallery-lightbox .lightbox-prev { left:12px; }
.gallery-lightbox .lightbox-next { right:12px; }
.product-description { margin-top:22px; color:var(--ink); font-size:16px; line-height:1.65; }
@media(max-width:700px) {
 .product-media .gallery-stage { grid-template-columns:36px minmax(0,1fr) 36px; }
 .product-media .product-photo-link { height:100cqw; }
 .gallery-arrow-icon { width:32px; height:32px; }
 .gallery-zoom-button { top:0; right:36px; width:36px; height:36px; }
 .product-gallery { margin:16px 0 0; }
 .gallery-toolbar { margin:8px 0 10px; gap:12px; }
 .product-image-dialog.gallery-lightbox { padding:40px 24px; }
}
@media(prefers-reduced-motion:reduce) { .product-gallery img,.gallery-progress span,.gallery-arrow-icon,.gallery-zoom-button { transition:none; } }

/* Keep the main photo, thumbnails and caption together within the viewport. */
.product-media.gallery { --gallery-thumb-size:clamp(44px,calc((100cqw - 42px)/5),min(120px,18dvh)); }
.product-media.gallery .product-photo-link { height:min(760px,130cqw,var(--gallery-image-height,max(64px,calc(100dvh - var(--gallery-thumb-size) - 180px)))); }
.product-media.gallery .product-gallery { grid-auto-columns:var(--gallery-thumb-size); margin-top:16px; }
@media(min-width:751px) { .product-media.gallery { position:sticky; top:16px; } }
@media(max-width:700px) { .product-media.gallery .product-photo-link { height:min(100cqw,var(--gallery-image-height,max(64px,calc(100dvh - var(--gallery-thumb-size) - 180px)))); } }

@media(max-width:700px) {
 .product-image-dialog.gallery-lightbox.gallery-compact-mobile { height:var(--mobile-popup-height); max-height:94dvh; padding:20px 24px; }
 .gallery-compact-mobile .zoom-image-holder { display:flex; align-items:center; justify-content:center; height:calc(100% - var(--mobile-caption-space)); }
 .gallery-compact-mobile .zoom-image-holder img { width:var(--mobile-picture-width); height:var(--mobile-picture-height); max-width:none; max-height:none; flex:none; }
}

/* Reserve a close-control row above the photo, including compact mobile mode. */
.product-image-dialog.gallery-lightbox,
.product-image-dialog.gallery-lightbox.gallery-compact-mobile {
  padding-top:calc(64px + env(safe-area-inset-top,0px));
}
.product-image-dialog.gallery-lightbox .modal-close {
  position:absolute; z-index:10;
  top:calc(10px + env(safe-area-inset-top,0px));
  right:calc(10px + env(safe-area-inset-right,0px));
  display:grid; place-items:center;
  width:44px; height:44px; min-width:44px; min-height:44px; padding:0;
  border:1px solid var(--blue-dark); border-radius:50%;
  background:var(--blue-dark); color:#fff; font:30px/1 Arial,sans-serif;
  box-shadow:0 2px 8px #16345724; cursor:pointer; pointer-events:auto; touch-action:manipulation;
}
.product-image-dialog.gallery-lightbox .modal-close:focus-visible { outline:3px solid var(--blue); outline-offset:3px; }
