/* SHARNIR PRODUCT GALLERY — 20260913-1. Pair with product-gallery.js.
 * Scoped to the gallery: existing header, purchase controls and cards keep their styles.
 */
.sharnir-product-gallery,
.sharnir-gallery-dialog {
  --gallery-green: #164b3b;
  --gallery-orange: #f96900;
  --gallery-line: #cbd8d1;
  box-sizing: border-box;
  color: var(--gallery-green);
  font-family: inherit;
}
.sharnir-product-gallery { min-width: 0; align-self: start; width: 100%; }
.sharnir-product-gallery *, .sharnir-gallery-dialog * { box-sizing: border-box; }
.sharnir-product-gallery [hidden], .sharnir-gallery-dialog [hidden],
.skf-photos[data-gallery-moved][hidden] { display: none !important; }
.sharnir-gallery__frame {
  position: relative;
  height: clamp(240px, 33vw, 420px);
  background: #fff;
  border: 1px solid var(--gallery-line);
}
.sharnir-gallery__open, .sharnir-gallery__image-host {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px 48px 40px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--gallery-green);
  font: inherit;
  touch-action: pan-y pinch-zoom;
}
.sharnir-gallery__open { cursor: zoom-in; }
.sharnir-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
}
.sharnir-gallery__zoom-label {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 3px 6px;
  background: #fff;
  color: var(--gallery-green);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.sharnir-gallery__control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gallery-green);
  border-radius: 0;
  background: #fff;
  color: var(--gallery-green);
  font-family: inherit;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.sharnir-gallery__previous, .sharnir-gallery__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.sharnir-gallery__previous { left: 8px; }
.sharnir-gallery__next { right: 8px; }
.sharnir-gallery__count {
  margin: 9px 0;
  color: #53665c;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
.sharnir-gallery__thumbs {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 100%;
  padding: 3px 3px 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gallery-green) #e9efeb;
}
.sharnir-gallery__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 74px;
  width: 74px;
  height: 68px;
  margin: 0;
  padding: 5px;
  border: 2px solid var(--gallery-line);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}
.sharnir-gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
.sharnir-gallery__thumb[aria-pressed="true"] { border-color: var(--gallery-orange); }
.sharnir-product-gallery button:focus-visible,
.sharnir-gallery-dialog button:focus-visible { outline: 3px solid var(--gallery-orange); outline-offset: 2px; }
.sharnir-gallery__open:focus-visible { outline-offset: -3px !important; }
.sharnir-gallery__error { margin: 0; font-size: 14px; line-height: 1.5; text-align: center; }
html.sharnir-gallery-open { overflow: hidden; }
.sharnir-gallery-dialog {
  position: fixed;
  inset: 0;
  width: min(1100px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  overflow: auto;
}
.sharnir-gallery-dialog::backdrop { background: rgb(4 24 18 / 88%); }
.sharnir-gallery-dialog__panel { padding: 16px; }
.sharnir-gallery-dialog__toolbar { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sharnir-gallery-dialog__title { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.sharnir-gallery-dialog .sharnir-gallery__frame { height: clamp(140px, calc(100dvh - 248px), 720px); border: 0; }
.sharnir-gallery-dialog .sharnir-gallery__image-host { padding-top: 8px; padding-bottom: 8px; }
.sharnir-gallery-dialog .sharnir-gallery__thumbs { width: max-content; margin-inline: auto; }
@media (hover: hover) {
  .sharnir-gallery__control:hover { background: var(--gallery-green); color: #fff; }
  .sharnir-gallery__thumb:hover { border-color: var(--gallery-green); }
  .sharnir-gallery__thumb[aria-pressed="true"]:hover { border-color: var(--gallery-orange); }
}
@media (max-width: 760px) {
  .sharnir-gallery__frame { height: clamp(240px, 75vw, 360px); }
  .sharnir-gallery__thumb { flex-basis: 64px; width: 64px; height: 60px; }
  .sharnir-gallery__thumbs { gap: 6px; }
  .sharnir-gallery-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .sharnir-gallery-dialog__panel { padding: 10px; }
  .sharnir-gallery-dialog .sharnir-gallery__frame { height: clamp(120px, calc(100dvh - 230px), 680px); }
}
@media (prefers-reduced-motion: reduce) {
  .sharnir-gallery__control { transition: none; }
}
