/* Catalogue navigation and product photographs. Uses existing brand colours. */
[hidden] { display: none !important; }
body.photo-viewer-open { overflow: hidden; }
.nav { margin-left: auto; }
.site-search-link { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .45rem .8rem; color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.site-search-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.site-search-link svg { width: 18px; height: 18px; }
.product-detail > *, .product-detail__media { min-width: 0; }
.product-gallery__figure { margin: 0; }
.product-gallery__open { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: #fff; border-radius: var(--radius); overflow: hidden; }
.product-gallery__open:hover { text-decoration: none; }
.product-gallery__open img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.product-detail__media .product-gallery img { margin: 0; }
.product-gallery__enlarge { position: absolute; right: .65rem; bottom: .65rem; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 4px; padding: .25rem .6rem; color: var(--ink); font-size: .75rem; box-shadow: var(--shadow); }
.product-gallery__caption { margin: .65rem 0; font-size: .78rem; line-height: 1.5; color: var(--muted); }
.product-gallery__caption:empty { display: none; }
.product-gallery__thumbs { display: flex; gap: .6rem; overflow-x: auto; padding: .2rem .1rem .5rem; margin-top: .8rem; }
.product-gallery__thumb { position: relative; flex: 0 0 76px; width: 76px; height: 76px; padding: 4px; border: 2px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.product-gallery__thumb[aria-pressed="true"] { border-color: var(--accent); }
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 3px; }
.product-gallery__thumb span { position: absolute; right: 2px; bottom: 1px; min-width: 16px; border-radius: 3px; background: rgba(255,255,255,.94); color: var(--ink); font-size: .65rem; line-height: 1.3; }
.product-gallery__status { margin: .5rem 0 1rem; font-size: .75rem; color: var(--muted); }
.product-gallery__fallback { margin: 1rem 0; }
.product-gallery__fallback summary { cursor: pointer; font-weight: 600; }
.product-gallery__fallback figure { margin: 1rem 0; }
.product-gallery__fallback figcaption { font-size: .8rem; color: var(--muted); }
.product-gallery a:focus-visible, .product-gallery button:focus-visible, .site-search-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.photo-dialog { width: min(1000px,94vw); max-width: 94vw; max-height: 92vh; padding: 1rem; border: 0; border-radius: 10px; color: var(--text); box-shadow: 0 12px 60px rgba(0,0,0,.3); }
.photo-dialog:not([open]) { display: none; }
.photo-dialog[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: .75rem; }
.photo-dialog::backdrop { background: rgba(21,23,25,.78); }
.photo-dialog__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.photo-dialog__header p { margin: 0; color: var(--ink); font-weight: 600; font-size: .9rem; }
.photo-dialog button { min-height: 44px; padding: .4rem .75rem; background: #fff; border: 1px solid var(--line-2); border-radius: 5px; color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; }
.photo-dialog button:hover { border-color: var(--accent); color: var(--accent); }
.photo-dialog .photo-dialog__close { flex-shrink: 0; }
.product-detail__media .photo-dialog img { width: 100%; height: 100%; max-height: calc(90vh - 160px); min-height: 100px; object-fit: contain; margin: 0; background: #fff; }
.photo-dialog__footer { display: flex; align-items: center; justify-content: center; gap: .8rem; }
.photo-dialog__footer p { flex: 1; margin: 0; text-align: center; font-size: .75rem; line-height: 1.4; color: var(--muted); }
.photo-dialog__footer button { flex-shrink: 0; }
.product-store-link { margin: .85rem 0 0; font-size: .85rem; }
#catalog-all-search, #catalog-search { scroll-margin-top: 110px; }
@media (max-width: 860px) {
  .site-header__inner { gap: .75rem; }
  .site-search-link { margin-left: auto; }
}
@media (max-width: 560px) {
  .site-search-link { padding: .4rem .6rem; }
  .site-header__inner { gap: .5rem; }
  .brand__logo { height: 42px; }
  .product-detail__media { padding: .85rem; }
  .product-gallery__open { aspect-ratio: 4 / 3; }
  .product-gallery__thumb { flex-basis: 64px; width: 64px; height: 64px; }
  .product-detail__actions .btn { white-space: normal; flex: 1 1 150px; padding: .75rem 1rem; }
  .photo-dialog { padding: .7rem; }
  .photo-dialog__header { gap: .4rem; }
  .photo-dialog__header p { font-size: .78rem; }
  .photo-dialog__footer { gap: .35rem; }
  .photo-dialog__footer button { font-size: .75rem; padding: .3rem .4rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print { .site-search-link, .photo-dialog, .product-gallery__thumbs, .product-gallery__enlarge { display: none !important; } }
/* Keep category search anchors clear of the sticky header. */
