.product-gallery-trigger {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fafcfb;
  color: var(--ink);
  cursor: zoom-in;
  overflow: hidden;
}
.product-gallery-trigger img { transition: transform .2s ease; }
.product-gallery-trigger:hover img { transform: scale(1.06); }
.gallery-count,.gallery-zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(20,37,30,.88);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
.gallery-zoom { font-size: 15px; }
.product-gallery-open { overflow: hidden; }
.product-gallery-modal[hidden] { display: none; }
.product-gallery-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gallery-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: rgba(7,16,12,.78);
  backdrop-filter: blur(7px);
}
.gallery-dialog {
  position: relative;
  width: min(1120px,calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0,0,0,.38);
}
.gallery-dialog > header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 13px 16px 13px 22px;
  border-bottom: 1px solid var(--line);
}
.gallery-dialog header div { min-width: 0; }
.gallery-dialog header small { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.gallery-dialog header h2 { overflow: hidden; margin: 2px 0 0; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.gallery-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 11px;
  background: #edf3ef;
  color: var(--ink);
  font: 400 28px/1 sans-serif;
}
.gallery-stage {
  min-height: 420px;
  display: grid;
  grid-template-columns: 68px minmax(0,1fr) 68px;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(145deg,#f8faf9,#eef3f0);
}
.gallery-stage figure {
  min-width: 0;
  height: min(72dvh,760px);
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  place-items: center;
  gap: 10px;
  margin: 0;
}
.gallery-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.gallery-stage figcaption {
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}
.gallery-arrow {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font: 300 42px/1 sans-serif;
  box-shadow: 0 8px 24px rgba(47,118,84,.28);
}
.gallery-arrow:hover { background: #235f43; transform: scale(1.04); }
.gallery-arrow[hidden] { display: none; }
@media (max-width:720px) {
  .product-gallery-modal { padding: 8px; }
  .gallery-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .gallery-dialog > header { min-height: 64px; padding: 10px 10px 10px 15px; }
  .gallery-stage { min-height: 0; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 4px; padding: 8px; }
  .gallery-stage figure { height: calc(100dvh - 112px); }
  .gallery-arrow { width: 40px; height: 48px; border-radius: 12px; font-size: 34px; }
}
@media (prefers-reduced-motion:reduce) {
  .product-gallery-trigger img { transition: none; }
}
