/* Catalog: product photo gallery (store/product.php) and availability notes.
 * Loaded by the product page; uses tokens from app.css. */

.gallery { display: grid; gap: 10px; }
.gallery__main { position: relative; }
.gallery__open { display: grid; place-items: center; width: 100%; height: 100%; cursor: zoom-in; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.gallery__open:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; border-radius: inherit; }
.gallery__open img { max-height: 100%; width: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .15s; }
.gallery__open.is-loading img { opacity: .4; }
.gallery__zoom-hint { position: absolute; right: 12px; bottom: 12px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 92%); box-shadow: var(--shadow-sm); color: var(--text-muted); pointer-events: none; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: rgb(255 255 255 / 94%); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.gallery__nav:hover { border-color: var(--border-strong); }
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__count { position: absolute; left: 12px; bottom: 12px; font-size: .78rem; font-weight: 650; padding: 3px 9px; border-radius: var(--r-pill); background: rgb(255 255 255 / 92%); color: var(--text-muted); }

.gallery__thumbs { list-style: none; margin: 0; padding: 2px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; }
.gallery__thumb { display: grid; place-items: center; width: 68px; height: 68px; flex-shrink: 0; padding: 4px; background: #fff; border: 2px solid var(--border); border-radius: var(--r-sm); scroll-snap-align: start; cursor: pointer; }
.gallery__thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery__thumb:hover { border-color: var(--border-strong); }
.gallery__thumb.is-active { border-color: var(--brand); }
.gallery__thumb:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

dialog.gallery-zoom { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; background: #fff; display: none; }
dialog.gallery-zoom[open] { display: grid; grid-template-rows: 1fr auto; }
.gallery-zoom__viewer { border: 0; border-radius: 0; --zoom-h: calc(100dvh - 60px); --zoom-h-sm: calc(100dvh - 60px); }
.gallery-zoom__bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.gallery-zoom__bar [data-gallery-close] { margin-left: auto; }

@media (max-width: 860px) {
  .gallery__thumb { width: 60px; height: 60px; }
}
@media (hover: none) {
  .gallery__nav { display: none; }
}

/* Small availability note under prices (product cards, parts lists). */
.avail-note { font-size: .8rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.avail-note--in { color: var(--success); }
.avail-note--out { color: var(--warning); }
