.gallery { padding:0 0 80px; min-height:var(--main-min-h); }
.gallery-intro { display:flex; align-items:center; justify-content:center; text-align:center; margin:0 auto; padding:clamp(20px, 2.75vw, 31px) 0; }
.gallery-intro p, .gallery-empty { margin:0; color:var(--muted); font-size:15px; }
.gallery-empty { text-align:center; }
.gallery-grid { display:grid; grid-template-columns:repeat(4, minmax(0, 1fr)); gap:16px; }
.gallery-item { display:block; overflow:hidden; aspect-ratio:3/4; border:1px solid var(--soft); border-radius:12px; background:#f5f3f1; }
.gallery-item img { width:100%; height:100%; display:block; object-fit:cover; transition:transform .35s ease; }
.gallery-item:hover img { transform:scale(1.035); }
.gallery-item:focus-visible { outline:3px solid #787982; outline-offset:3px; }
/* В просмотрщике убираем фокус-обводку (перекрывает глобальный button:focus-visible). */
.gallery-viewer:focus,
.gallery-viewer:focus-visible,
.gallery-viewer :focus,
.gallery-viewer :focus-visible {
  outline: none;
}
/* И синюю тап-подсветку, и выделение/перетаскивание фото. */
.gallery-viewer,
.gallery-viewer * {
  -webkit-tap-highlight-color: transparent;
}
.gallery-viewer img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.gallery-viewer { width:100%; max-width:none; height:100%; max-height:none; padding:0; border:0; background:transparent; color:#fff; }
.gallery-viewer::backdrop { background:rgba(25, 25, 28, .92); }
.gallery-viewer-inner { height:100%; display:grid; grid-template-columns:48px minmax(0, 1fr) 48px; grid-template-rows:minmax(0, 1fr) auto; align-items:center; gap:12px; padding:60px 24px 24px; position:relative; }
.gallery-full { display:block; max-width:100%; max-height:100%; margin:auto; object-fit:contain; }
.gallery-viewer button, .gallery-shop-link { border:0; color:#fff; background:rgba(255,255,255,.12); border-radius:50%; width:44px; height:44px; cursor:pointer; display:flex; align-items:center; justify-content:center; text-decoration:none; }
.gallery-viewer button { padding:0; }
.gallery-viewer button svg { display:block; }
.gallery-viewer button:hover, .gallery-shop-link:hover { background:rgba(255,255,255,.23); }
.gallery-tools { position:absolute; top:16px; right:24px; display:flex; flex-direction:column; gap:8px; }
.gallery-shop-link { font:700 12px/1 "Segoe UI","Helvetica Neue",sans-serif; letter-spacing:-.02em; }
.gallery-shop-link:hover { filter:brightness(0.88); }
.gallery-counter { grid-column:2; text-align:center; font-size:13px; color:#dedee1; }
@media (max-width:760px) {
  .gallery { padding:0 0 56px; }
  .gallery-intro { padding:20px 0; }
  .gallery-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
  .gallery-item { border-radius:9px; }
  .gallery-viewer-inner { grid-template-columns:36px minmax(0, 1fr) 36px; gap:4px; padding:58px 8px 20px; }
  .gallery-viewer button, .gallery-shop-link { width:36px; height:36px; }
  .gallery-tools { right:12px; }
  .gallery-shop-link { font-size:10px; }
}
@media (prefers-reduced-motion:reduce) { .gallery-item img { transition:none; } }
