/* Explicitly bounded cells keep portrait images from expanding the square stage. */
.lb-product-page .lb-product-gallery { min-width:0; }
.lb-product-page .lb-product-gallery__stage { display:block; min-height:0; aspect-ratio:1; isolation:isolate; }
.lb-product-gallery__track { position:absolute; inset:0; display:flex; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; scrollbar-width:none; overscroll-behavior-x:contain; touch-action:pan-x pan-y pinch-zoom; }
.lb-product-gallery__track::-webkit-scrollbar { display:none; }
.lb-product-page .lb-product-gallery__slide { display:flex; flex:0 0 100%; width:100%; height:100%; min-width:0; min-height:0; margin:0; padding:16px; scroll-snap-align:start; scroll-snap-stop:always; }
.lb-product-gallery__open { display:flex; width:100%; height:100%; min-height:0; align-items:center; justify-content:center; cursor:zoom-in; }
.lb-product-page .lb-product-gallery__slide img { display:block; width:100% !important; height:100% !important; max-width:100%; max-height:100%; object-fit:contain; user-select:none; -webkit-user-drag:none; }
.lb-product-gallery__track.is-dragging { scroll-snap-type:none; cursor:grabbing; }
.lb-product-gallery__track.is-dragging * { cursor:grabbing; }
.lb-product-page .lb-product-gallery__thumbs { flex-direction:row; max-height:none; justify-content:flex-start; overflow-x:auto; padding:4px 2px 8px; scroll-padding:4px; scrollbar-width:thin; scrollbar-color:#c9b5de transparent; touch-action:pan-x pan-y pinch-zoom; }
.lb-product-page .lb-product-gallery__thumb { flex:0 0 64px; width:64px; height:64px; min-height:64px; padding:4px; border:2px solid transparent; border-radius:12px; background:#fff; opacity:.7; }
.lb-product-page .lb-product-gallery__thumb img { object-fit:contain; }
.lb-product-page .lb-product-gallery__thumb[aria-current="true"] { border-color:var(--lb-rose,#6d3bc2); background:var(--lb-rose-soft,#f3effd); opacity:1; }
.lb-gallery-expand { position:absolute; top:10px; left:10px; z-index:3; display:grid; width:44px; height:44px; place-items:center; padding:10px; border:1px solid #e9e2f2; border-radius:50%; background:rgba(255,255,255,.94); color:#483959; cursor:zoom-in; box-shadow:0 3px 12px #30203b0d; }
.lb-gallery-expand svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.lb-product-page .lb-gallery-navigation { inset:auto 10px 10px; justify-content:flex-start; gap:7px; }
.lb-product-page .lb-gallery-navigation button { width:44px; height:44px; }
.lb-gallery-navigation button:disabled { opacity:.35; cursor:default; transform:none; }
.lb-product-page .lb-gallery-count { z-index:2; bottom:16px; left:12px; pointer-events:none; }
.lb-product-gallery :focus-visible, .lb-gallery-dialog :focus-visible { outline:3px solid #9768d2; outline-offset:-3px; }
html:has(.lb-gallery-dialog[open]) { overflow:hidden; }
/* A viewport-sized native dialog supplies focus containment and Escape handling. */
dialog.lb-gallery-dialog { position:fixed; inset:0; width:100%; max-width:100%; height:100%; height:100dvh; max-height:100%; margin:0; padding:0; overflow:hidden; border:0; border-radius:0; background:#faf9fc; color:#332a40; box-sizing:border-box; }
dialog.lb-gallery-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr) auto; }
.lb-gallery-dialog::backdrop { background:#18111ee6; }
.lb-gallery-dialog .lb-gallery-dialog__toolbar { z-index:2; display:flex; min-height:72px; align-items:center; justify-content:space-between; gap:10px; padding:calc(10px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); border-bottom:1px solid #e9e2f2; background:#fff; direction:rtl; }
.lb-gallery-dialog button { display:inline-grid; min-width:44px; height:44px; place-items:center; padding:0 10px; border:1px solid #e9e2f2; border-radius:12px; background:#fff; color:#483959; font:inherit; font-size:22px; line-height:1; cursor:pointer; }
.lb-gallery-dialog button:disabled { opacity:.35; cursor:default; }
.lb-gallery-dialog .lb-gallery-dialog__zoom { display:flex; gap:5px; direction:ltr; }
.lb-gallery-dialog [data-lb-zoom-reset] { min-width:72px; font-size:13px; font-variant-numeric:tabular-nums; }
.lb-gallery-dialog [data-lb-dialog-close] { font-size:28px; }
.lb-gallery-dialog__count { min-width:55px; font-size:13px; }
.lb-gallery-dialog > .lb-gallery-dialog__viewport { position:relative; display:flex; min-width:0; min-height:0; align-items:center; justify-content:center; overflow:hidden; margin:0; touch-action:none; cursor:zoom-in; user-select:none; }
.lb-gallery-dialog [data-lb-dialog-image] { display:block; width:auto; height:auto; max-width:100%; max-height:100%; object-fit:contain; transform-origin:center; flex:none; -webkit-user-drag:none; }
.lb-gallery-dialog__viewport.is-zoomed { cursor:grab; }
.lb-gallery-dialog__viewport.is-zoomed:active { cursor:grabbing; }
.lb-gallery-dialog__viewport[aria-busy="true"]::after { position:absolute; inset:50% auto auto 50%; width:28px; height:28px; margin:-14px; border:3px solid #e9e2f2; border-top-color:#6d3bc2; border-radius:50%; animation:lb-gallery-spin .8s linear infinite; content:""; pointer-events:none; }
.lb-gallery-dialog .lb-gallery-dialog__footer { z-index:2; display:flex; min-height:76px; align-items:center; justify-content:space-between; gap:12px; padding:12px max(16px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); border-top:1px solid #e9e2f2; background:#fff; direction:rtl; }
.lb-gallery-dialog__footer > span { font-size:12px; line-height:1.8; color:#756983; }
.lb-gallery-dialog__footer > div { display:flex; flex:none; gap:8px; }
.lb-gallery-dialog__error { position:absolute; margin:16px; padding:16px; border-radius:12px; background:#fff; text-align:center; direction:rtl; }
.lb-gallery-dialog__error[hidden] { display:none; }
@keyframes lb-gallery-spin { to { transform:rotate(360deg); } }
@media (max-width:720px) {
	.lb-product-page .lb-product-gallery { display:flex; flex-direction:column; gap:8px; }
	.lb-product-page .lb-product-gallery__slide { padding:12px; }
	.lb-product-page .lb-gallery-navigation { display:none; }
	.lb-product-page .lb-product-gallery__thumb { flex-basis:58px; width:58px; height:58px; min-height:58px; }
	.lb-gallery-dialog .lb-gallery-dialog__toolbar { gap:6px; padding-right:10px; padding-left:10px; }
	.lb-gallery-dialog .lb-gallery-dialog__footer { flex-direction:column-reverse; gap:8px; padding-top:10px; }
	.lb-gallery-dialog__footer > span { font-size:11px; text-align:center; }
}
@media (prefers-reduced-motion:reduce) {
	.lb-product-gallery *, .lb-gallery-dialog * { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}
