/* Standalone, scoped enhancement. Source of build/css/vmshop-gallery-v1.css. */
.vmg {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 86px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.vmg .vmg-stage {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}
.vmg .vmg-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  border: 0;
  background: #fff;
  cursor: zoom-in;
  box-sizing: border-box;
}
.vmg .vmg-primary img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.vmg-inline,
.vmg-modal__rail {
  display: flex;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 4px;
  box-sizing: border-box;
  align-items: center;
}
.vmg-thumb {
  flex: 0 0 auto;
  display: block;
  width: 72px;
  height: 72px;
  padding: 4px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
}
.vmg-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.vmg-thumb.is-active {
  border-color: #c8231d;
}
.vmg-thumb:focus-visible,
.vmg-primary:focus-visible,
.vmg-modal button:focus-visible {
  outline: 3px solid #64b5ff;
  outline-offset: 2px;
}
.vmg-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: #141619;
  color: #fff;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: Arial, sans-serif;
  box-sizing: border-box;
}
.vmg-modal * {
  box-sizing: border-box;
}
.vmg-modal__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 5px max(8px, env(safe-area-inset-right)) 5px
    max(8px, env(safe-area-inset-left));
  min-width: 0;
  background: #141619;
}
.vmg-modal button {
  appearance: none;
  color: #fff;
  font: inherit;
  border: 0;
  cursor: pointer;
  background: #ffffff16;
}
.vmg-modal button[disabled] {
  opacity: 0.3;
  cursor: default;
}
.vmg-modal__toolbar button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
}
.vmg-modal button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.vmg-modal__counter {
  margin-right: auto;
  padding: 0 12px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #c2c7cd;
  white-space: nowrap;
}
.vmg-modal__layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 94px;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  min-height: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.vmg-modal__stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.vmg-modal__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: none !important;
  max-height: none !important;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: center;
  will-change: transform;
}
.vmg-modal__stage.is-zoomed .vmg-modal__photo {
  cursor: grab;
}
.vmg-modal__stage.is-dragging .vmg-modal__photo {
  cursor: grabbing;
}
.vmg-modal__arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 64px;
  border-radius: 10px;
  background: #14161966 !important;
}
.vmg-modal__prev {
  left: 8px;
}
.vmg-modal__next {
  right: 8px;
}
.vmg-modal__rail {
  padding: 6px 10px;
  scrollbar-color: #727981 #20252b;
}
.vmg-modal .vmg-thumb {
  width: 78px;
  height: 78px;
  border: 2px solid transparent;
  background: #f7f8fa;
}
.vmg-modal .vmg-thumb.is-active {
  border-color: #e9433c;
}
.vmg-modal__notice {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 7px 12px;
  border-radius: 6px;
  background: #252b32d9;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}
.vmg-modal__notice:empty {
  display: none;
}
.vmg-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (min-width: 1000px) and (min-aspect-ratio: 6/5) {
  .vmg {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .vmg .vmg-stage {
    grid-column: 2;
    grid-row: 1;
  }
  .vmg-inline {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 84px;
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: center;
  }
  .vmg-modal__layout {
    grid-template-columns: 108px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    padding-bottom: 0;
  }
  .vmg-modal__stage {
    grid-column: 2;
    grid-row: 1;
  }
  .vmg-modal__rail {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    padding: 8px 10px;
  }
}
@media (max-width: 600px) {
  .vmg-modal__layout {
    grid-template-rows: minmax(0, 1fr) 78px;
  }
  .vmg-modal .vmg-thumb {
    width: 62px;
    height: 62px;
  }
  .vmg-modal__rail {
    padding: 4px 8px;
  }
  .vmg-modal__toolbar {
    gap: 2px;
  }
  .vmg-modal__counter {
    padding: 0 5px;
  }
  .vmg-modal__arrow {
    width: 34px;
  }
  .vmg-modal__prev {
    left: 2px;
  }
  .vmg-modal__next {
    right: 2px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vmg-modal * {
    scroll-behavior: auto !important;
  }
}
