/* Product media: fixed preview frames; original images stay intact in the viewer. */
html:has(body[data-view=store] .product-gallery-dialog[open]),body[data-view=store]:has(.product-gallery-dialog[open]){overflow:hidden}
body[data-view=store] .product-gallery-main{display:block;position:relative;width:100%;height:100%;aspect-ratio:4/5;min-width:0}
body[data-view=store] .storefront-product-page .product-gallery-main.is-gallery-image img{object-fit:contain}
.product-gallery-zoom{position:absolute;right:10px;bottom:10px;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#fff;color:#171717;box-shadow:0 2px 12px #0002;pointer-events:none}
.product-gallery-zoom .icon{width:18px;height:18px}
body[data-view=store] .product-gallery-thumbs{display:flex;gap:9px;max-width:300px;margin:14px auto 0;overflow-x:auto;padding:3px;scrollbar-width:thin;overscroll-behavior-x:contain}
body[data-view=store] .product-gallery-thumbs>:is(button,a){flex:0 0 58px;padding:3px;border:2px solid transparent;border-radius:12px;background:var(--soft);cursor:pointer}
body[data-view=store] .product-gallery-thumbs>button[aria-pressed=true]{border-color:var(--primary)}
body[data-view=store] .product-gallery-thumbs img{display:block;width:100%;height:66px;object-fit:contain;border-radius:7px}
body[data-view=store] .product-gallery-section{min-width:0;margin-top:30px;padding:26px 28px;border:1px solid var(--line);border-radius:22px;background:var(--card);box-shadow:0 8px 24px #00000005}
body[data-view=store] .product-gallery-section h2{margin:0 0 20px;font-size:22px;letter-spacing:-.5px}
body[data-view=store] .product-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;min-width:0}
body[data-view=store] .product-gallery-tile{position:relative;display:block;min-width:0;aspect-ratio:16/9;border:1px solid var(--line);border-radius:16px;background:var(--soft);overflow:hidden}
body[data-view=store] .product-gallery-tile img{display:block;width:100%;height:100%;object-fit:contain}
body[data-view=store] :is(.product-gallery-tile,.product-gallery-main,.product-gallery-thumbs>button):focus-visible{outline:3px solid var(--primary);outline-offset:3px}
body[data-view=store] .product-gallery-dialog{width:min(1100px,calc(100% - 28px));max-width:none;max-height:calc(100dvh - 28px);padding:0;border:1px solid var(--line);border-radius:24px;background:var(--card);color:var(--text);overflow:auto;overscroll-behavior:contain;animation:product-gallery-in .16s ease-out}
body[data-view=store] .product-gallery-dialog::backdrop{background:#000c;backdrop-filter:none}
body[data-view=store] .product-gallery-dialog .dialog-content{padding:20px;overflow:visible}
.gallery-lightbox-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}
.gallery-lightbox-head h2{margin:0;font-size:18px;line-height:1.4;overflow-wrap:anywhere}
.gallery-lightbox-head button{flex-shrink:0}
.gallery-lightbox-figure{margin:0;min-width:0}
.gallery-lightbox-figure>img{display:block;width:100%;height:min(63dvh,670px);object-fit:contain;border-radius:14px;background:var(--soft)}
.gallery-lightbox-figure figcaption{margin-top:10px;color:var(--muted);font-size:13px;line-height:1.5;text-align:center;overflow-wrap:anywhere}
.gallery-lightbox-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}
.gallery-lightbox-controls>span{font-size:13px;color:var(--muted);margin-inline:auto;white-space:nowrap}
.gallery-lightbox-controls>button{min-height:44px;font-size:13px;gap:8px}
.gallery-lightbox-controls>button:disabled{opacity:.4;cursor:default;box-shadow:none;transform:none}
body[data-view=admin] .gallery-editor h3{margin:0 0 7px;font-size:20px}
body[data-view=admin] .gallery-editor>p{font-size:13px;color:var(--editor-muted);line-height:1.6;margin:0 0 20px}
body[data-view=admin] .gallery-editor-list{display:grid;gap:12px;margin:20px 0}
body[data-view=admin] .gallery-editor-row{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;align-items:center;padding:14px;border:1px solid var(--editor-line);border-radius:16px;background:var(--soft)}
body[data-view=admin] .gallery-editor-row>img{display:block;width:96px;height:60px;object-fit:contain;border-radius:10px;background:var(--card)}
body[data-view=admin] .gallery-editor-row>.field{margin:0;min-width:0;font-size:12px}
body[data-view=admin] .gallery-editor-actions{display:flex;gap:6px;grid-column:2;justify-content:flex-end}
body[data-view=admin] .gallery-editor-actions [data-gallery-move] .icon{transform:rotate(90deg)}
body[data-view=admin] .gallery-editor-empty{padding:22px;border:1px dashed var(--editor-line);border-radius:16px;color:var(--editor-muted);font-size:13px;line-height:1.7}
body[data-view=admin] .gallery-editor-upload{position:relative;cursor:pointer;overflow:hidden}
body[data-view=admin] .gallery-editor-upload input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
body[data-view=admin] .gallery-editor-upload:focus-within{outline:2px solid var(--primary);outline-offset:3px}
body[data-view=admin] .gallery-editor-help{display:block;margin:12px 0;color:var(--editor-muted);font-size:12px;line-height:1.7}
body[data-view=admin] .gallery-editor-status:empty{display:none}
@media(max-width:800px){body[data-view=store] .product-gallery-section{padding:20px 16px;margin-top:24px;border-radius:18px}body[data-view=store] .product-gallery-section h2{font-size:20px}body[data-view=store] .product-gallery-grid{display:flex;overflow-x:auto;gap:14px;padding:3px 3px 12px;overscroll-behavior-x:contain;scrollbar-width:thin}body[data-view=store] .product-gallery-tile{flex:0 0 86%}body[data-view=store] .product-gallery-thumbs{max-width:300px}body[data-view=store] .product-gallery-dialog .dialog-content{padding:14px}.gallery-lightbox-head h2{font-size:15px}.gallery-lightbox-controls>button span{display:none}.gallery-lightbox-figure>img{height:auto;max-height:calc(100dvh - 190px)}.gallery-lightbox-figure figcaption{font-size:12px}}
@media(max-width:400px){body[data-view=admin] .gallery-editor-row{grid-template-columns:64px minmax(0,1fr);padding:10px;gap:10px}body[data-view=admin] .gallery-editor-row>img{width:64px;height:48px}}
@keyframes product-gallery-in{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){body[data-view=store] .product-gallery-dialog{animation:none}}
