.product-gallery { min-width:0; width:100%; }
.gallery-stage { position:relative; border:1px solid #e6e6e6; border-radius:8px; padding:20px; background:#fff; }
.gallery-slides { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:thin; }
.gallery-slide { flex:0 0 100%; min-width:0; scroll-snap-align:start; }
.gallery-slide img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:contain; }
.gallery-slide[hidden],.gallery-arrow[hidden],.gallery-enlarge[hidden] { display:none; }
.gallery-enhanced .gallery-slides { display:block; overflow:visible; }
.gallery-enhanced .gallery-stage { touch-action:pan-y; }
.gallery-arrow { position:absolute; top:50%; translate:0 -50%; width:44px; height:44px; border:1px solid #ddd; border-radius:50%; background:#fffffff2; font-size:20px; color:#222; }
.gallery-prev { left:8px; }.gallery-next { right:8px; }
.gallery-arrow:hover { border-color:#ff6b00; background:#fff5ec; }
.gallery-counter { display:block; text-align:center; font-size:12px; color:#666; margin-top:10px; }
.gallery-enlarge { display:block; width:100%; min-height:40px; margin-top:8px; border:0; border-radius:4px; background:#f8f8f8; color:#a43e00; font:inherit; font-size:12px; }
.gallery-thumbnails { display:flex; gap:8px; overflow-x:auto; padding:12px 2px 4px; }
.gallery-thumbnails a { flex:0 0 66px; border:1px solid #ddd; border-radius:5px; padding:4px; display:block; }
.gallery-thumbnails a[aria-current] { border:2px solid #ff6b00; padding:3px; }
.gallery-thumbnails img { width:56px; height:56px; object-fit:contain; }
.gallery-dialog { padding:16px; border:1px solid #ddd; border-radius:8px; width:min(960px,calc(100% - 32px)); max-height:calc(100dvh - 32px); background:white; }
.gallery-dialog::backdrop { background:#000a; }
.gallery-dialog-toolbar,.gallery-dialog-navigation { display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:13px; }
.gallery-dialog button { min-height:44px; border:1px solid #ddd; border-radius:5px; background:#fff; color:#222; padding:8px 14px; font:inherit; }
.gallery-dialog>img { display:block; width:100%; height:min(70dvh,760px); object-fit:contain; margin:12px 0; }
.gallery-stage:focus-visible,.gallery-thumbnails a:focus-visible,.gallery-dialog button:focus-visible { outline:3px solid #ff6b00; outline-offset:2px; }
.admin-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:20px 0; }
.admin-gallery-item { min-width:0; padding:12px; border:1px solid #e6e6e6; border-radius:6px; background:#fff; }
.admin-gallery-item>img { width:100%; height:120px; object-fit:contain; margin-bottom:12px; }
.admin-gallery-item:has(input[name="cover_image_id"]:checked) { border-color:#ff6b00; }
.admin-gallery-item:has(input[name="remove_images[]"]:checked) { background:#fff2f0; }
.admin-gallery-order { display:flex; align-items:center; gap:6px; margin:8px 0; }
.admin-gallery-order>span { flex:1; color:#666; font-size:11px; }
.admin-gallery-order button { min-width:34px; height:34px; border:1px solid #ddd; border-radius:4px; background:#fff; font:inherit; }
.admin-gallery-order button:disabled { opacity:.4; cursor:default; }
@media(max-width:900px) { .admin-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:700px) { .gallery-stage { padding:12px; } .gallery-dialog { padding:12px; } .gallery-dialog>img { height:65dvh; } .product-gallery { max-width:440px; justify-self:center; } }
@media(max-width:420px) { .admin-gallery { gap:8px; } .admin-gallery-item { padding:8px; } .admin-gallery-item>img { height:100px; } .admin-gallery-order>span { font-size:10px; } }
