.page-hero-media.pm-gallery {
  display: block;
  place-items: normal;
  width: 100%;
  min-width: 0;
  aspect-ratio: auto;
  padding: 16px;
  border-radius: 8px;
  overflow: visible;
  background: var(--color-surface-strong, #e5eef7);
}
.pm-gallery [hidden] { display: none !important; }
.pm-stage-wrap { position: relative; width: 100%; }
.pm-stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  background: #fff;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}
.pm-image-clip {
  position: absolute;
  display: block;
  inset: 20px;
  overflow: hidden;
}
.pm-gallery .pm-image-clip img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.pm-zoom-view {
  display: block;
  position: absolute;
  inset: 0;
  background-color: #fff;
  background-repeat: no-repeat;
  opacity: 0;
  pointer-events: none;
}
.pm-stage.is-zooming .pm-zoom-view { opacity: 1; }
.pm-enlarge, .pm-counter {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  display: grid;
  place-items: center;
  min-height: 34px;
  color: #003d78;
  background: rgba(255,255,255,.94);
  border: 1px solid #d5e1ed;
  border-radius: 4px;
  pointer-events: none;
}
.pm-enlarge { right: 12px; width: 34px; }
.pm-counter { left: 12px; padding: 0 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.pm-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: var(--pm-icon) center / contain no-repeat;
  -webkit-mask: var(--pm-icon) center / contain no-repeat;
}
.pm-icon-chevron-left { --pm-icon: url('data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Cpath%20d%3D%22m15%2018-6-6%206-6%22%20%2F%3E%0A%3C%2Fsvg%3E%0A'); }
.pm-icon-chevron-right { --pm-icon: url('data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Cpath%20d%3D%22m9%2018%206-6-6-6%22%20%2F%3E%0A%3C%2Fsvg%3E%0A'); }
.pm-icon-zoom-in { --pm-icon: url('data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2221%22%20x2%3D%2216.65%22%20y1%3D%2221%22%20y2%3D%2216.65%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2211%22%20x2%3D%2211%22%20y1%3D%228%22%20y2%3D%2214%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%228%22%20x2%3D%2214%22%20y1%3D%2211%22%20y2%3D%2211%22%20%2F%3E%0A%3C%2Fsvg%3E%0A'); }
.pm-icon-zoom-out { --pm-icon: url('data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%2221%22%20x2%3D%2216.65%22%20y1%3D%2221%22%20y2%3D%2216.65%22%20%2F%3E%0A%20%20%3Cline%20x1%3D%228%22%20x2%3D%2214%22%20y1%3D%2211%22%20y2%3D%2211%22%20%2F%3E%0A%3C%2Fsvg%3E%0A'); }
.pm-icon-x { --pm-icon: url('data:image/svg+xml,%3Csvg%0A%20%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0A%20%20width%3D%2224%22%0A%20%20height%3D%2224%22%0A%20%20viewBox%3D%220%200%2024%2024%22%0A%20%20fill%3D%22none%22%0A%20%20stroke%3D%22currentColor%22%0A%20%20stroke-width%3D%222%22%0A%20%20stroke-linecap%3D%22round%22%0A%20%20stroke-linejoin%3D%22round%22%0A%3E%0A%20%20%3Cpath%20d%3D%22M18%206%206%2018%22%20%2F%3E%0A%20%20%3Cpath%20d%3D%22m6%206%2012%2012%22%20%2F%3E%0A%3C%2Fsvg%3E%0A'); }
.pm-controls { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 10px; align-items: center; margin-top: 12px; }
.pm-thumbnails { display: flex; min-width: 0; gap: 10px; overflow-x: auto; scrollbar-width: thin; padding: 3px; }
.pm-thumb {
  display: grid;
  place-items: center;
  flex: 0 0 68px;
  width: 68px;
  height: 64px;
  padding: 5px;
  border: 1px solid #cbdbea;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.pm-thumb:hover { border-color: #004f9a; }
.pm-thumb[aria-pressed='true'] { border: 2px solid #004f9a; padding: 4px; box-shadow: 0 0 0 2px rgba(0,79,154,.1); }
.pm-thumb-clip { display: block; width: 100%; max-height: 100%; overflow: hidden; }
.pm-gallery .pm-thumb img { display: block; width: 100%; height: auto; min-height: 0; padding: 0; object-fit: contain; border-radius: 0; }
.pm-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid #cbdbea;
  border-radius: 4px;
  background: #fff;
  color: #004f9a;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.pm-icon-button:hover { background: #dcecfb; border-color: #004f9a; }
.pm-gallery :is(button, a):focus-visible { outline: 3px solid #004f9a; outline-offset: 3px; }
.pm-error { position: absolute; inset: 0; z-index: 3; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 20px; text-align: center; background: #fff; color: #354757; }
.pm-error button { padding: 8px 20px; border: 1px solid #004f9a; border-radius: 4px; background: #fff; color: #004f9a; cursor: pointer; }
.pm-error p, .pm-image-note { margin: 0; }
.pm-gallery .pm-image-note { padding-top: 10px; font-size: 13px; line-height: 1.5; color: #355573; }
.pm-stage[aria-busy='true']::after {
  content: '';
  position: absolute;
  left: calc(50% - 14px);
  top: calc(50% - 14px);
  width: 28px;
  height: 28px;
  border: 2px solid #d5e1ed;
  border-top-color: #004f9a;
  border-radius: 50%;
  animation: pm-loading .8s linear infinite;
}
@keyframes pm-loading { to { transform: rotate(360deg); } }
body.has-product-viewer { overflow: hidden; }
.pm-gallery .pm-dialog {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: min(1280px, calc(100% - 48px));
  height: min(900px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  padding: 0;
  margin: auto;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: #193d60;
  box-shadow: 0 20px 80px rgba(0,0,0,.28);
}
.pm-dialog::backdrop { background: rgba(13,30,48,.82); }
.pm-dialog-toolbar { display: flex; justify-content: space-between; align-items: center; height: 64px; padding: 12px 20px; border-bottom: 1px solid #dde7f1; box-sizing: border-box; }
.pm-dialog-toolbar > div { display: flex; gap: 10px; }
.pm-dialog-toolbar > span { font-size: 14px; font-variant-numeric: tabular-nums; }
.pm-dialog-stage { position: absolute; inset: 64px 0 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.pm-dialog-canvas { position: relative; width: 100%; height: 100%; }
.pm-dialog-stage.is-enlarged .pm-dialog-canvas { width: 200%; height: 200%; }
.pm-dialog-nav { position: absolute; inset: 50% 20px auto; display: flex; justify-content: space-between; pointer-events: none; }
.pm-dialog-nav button { pointer-events: auto; width: 44px; height: 44px; box-shadow: 0 2px 12px #0001; }
.pm-dialog-error { position: absolute; top: 48%; left: 10%; width: 80%; margin: 0; text-align: center; }
@media (max-width: 600px) {
  .page-hero-media.pm-gallery { padding: 10px; }
  .pm-controls { gap: 5px; grid-template-columns: 36px minmax(0,1fr) 36px; }
  .pm-controls .pm-icon-button { width: 36px; min-width: 36px; }
  .pm-thumbnails { gap: 7px; }
  .pm-thumb { flex-basis: 58px; width: 58px; height: 56px; }
  .pm-gallery .pm-dialog { width: 100%; height: 100dvh; border-radius: 0; }
  .pm-dialog-toolbar { padding: 10px 14px; }
  .pm-dialog-nav { left: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-gallery *, .pm-gallery *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
