/* Product gallery (G1) — partials/product-gallery.blade.php + js/product-gallery.js. Self-hosted, no build step. */

/* the stage keeps its 1:1 box (Bootstrap .ratio) so switching photos never shifts the layout */
.pg-stage { overflow: hidden; }
.pg-zoom { display: block; position: absolute; inset: 0; cursor: zoom-in; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.pg-zoom img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; transform-origin: 50% 50%; }
.pg-zoom:focus-visible { outline: 3px solid var(--bs-primary, #0d6efd); outline-offset: -3px; }

/* desktop magnifier: the photo scales under the pointer (js sets --pg-x/--pg-y) */
.pg-zoom.pg-zooming img { transform: scale(2); transform-origin: var(--pg-x, 50%) var(--pg-y, 50%); transition: transform-origin 0s; }
@media (prefers-reduced-motion: no-preference) {
    .pg-zoom img { transition: transform .15s ease-out; }
}

.pg-thumbs { margin: 0; padding: 0; }
.pg-thumb { display: block; width: 80px; height: 80px; padding: 0; flex: 0 0 auto; cursor: pointer; opacity: .75; border-radius: .25rem; }
.pg-thumb img { width: 100%; height: 100%; display: block; }
.pg-thumb:hover { opacity: 1; }
.pg-thumb[aria-current="true"] { opacity: 1; border-color: var(--bs-primary, #0d6efd) !important; box-shadow: 0 0 0 1px var(--bs-primary, #0d6efd); }
.pg-thumb:focus-visible { outline: 3px solid var(--bs-primary, #0d6efd); outline-offset: 2px; opacity: 1; }

/* lightbox (native <dialog>: focus trap, Esc and inert background come from the browser) */
.pg-lb { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
    border: 0; background: rgba(12, 12, 14, .94); color: #fff; overflow: hidden; }
.pg-lb:not([open]) { display: none; }
.pg-lb::backdrop { background: rgba(0, 0, 0, .9); }
.pg-lb-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
    padding: .5rem .75rem; background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); }
.pg-lb-count { font-variant-numeric: tabular-nums; font-size: .95rem; }
.pg-lb-tools { display: flex; gap: .25rem; }
.pg-lb-btn { appearance: none; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 2.75rem; height: 2.75rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.pg-lb-btn:hover { background: rgba(255, 255, 255, .25); }
.pg-lb-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pg-lb-btn[disabled] { opacity: .35; cursor: default; }
.pg-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; }
.pg-lb-prev { left: .75rem; }
.pg-lb-next { right: .75rem; }
.pg-lb-view { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: zoom-in; outline: 0; }
.pg-lb-view.pg-zoomed { cursor: grab; }
.pg-lb-view.pg-dragging { cursor: grabbing; }
.pg-lb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 50%; will-change: transform;
    user-select: none; -webkit-user-drag: none; }
html.pg-lb-open { overflow: hidden; }
@media (max-width: 575.98px) {
    .pg-lb-nav { top: auto; bottom: 1rem; transform: none; }
    .pg-thumb { width: 64px; height: 64px; }
}
