.pvb-product-gallery {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 0 2em;
}

.pvb-product-gallery .pvb-gallery-view {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 16px;
  background: #fafafa;
}

.pvb-product-gallery .pvb-gallery-main,
.pvb-product-gallery .pvb-gallery-main img {
  display: block;
  width: 100%;
}

.pvb-product-gallery .pvb-gallery-main,
.pvb-product-gallery .pvb-gallery-dialog {
  touch-action: pan-y pinch-zoom;
}

.pvb-product-gallery .pvb-gallery-main img {
  height: auto;
  margin: 0;
  border: 0;
}

.pvb-product-gallery .pvb-gallery-main:focus-visible {
  outline: 2px solid #254acd;
  outline-offset: -2px;
}

.pvb-product-gallery [data-pvb-open] {
  cursor: zoom-in;
}

@media (hover: hover) and (pointer: fine) {
  .pvb-product-gallery .pvb-gallery-main:hover img {
    transform: scale(1.6);
  }
}

.pvb-product-gallery .pvb-gallery-expand {
  appearance: none;
  position: absolute;
  inset-block-start: .5em;
  inset-inline-end: .5em;
  z-index: 2;
  display: block;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 2em;
  line-height: 1;
}

.pvb-product-gallery .pvb-gallery-expand::before,
.pvb-product-gallery .pvb-gallery-expand::after {
  position: absolute;
  display: block;
  box-sizing: content-box;
  content: "";
}

.pvb-product-gallery .pvb-gallery-expand::before {
  top: 9px;
  left: 9px;
  width: 10px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.pvb-product-gallery .pvb-gallery-expand::after {
  top: 19px;
  left: 22px;
  width: 2px;
  height: 8px;
  border-radius: 6px;
  background: currentColor;
  transform: rotate(-45deg);
}

.pvb-product-gallery .pvb-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0 0 16px;
  list-style: none;
}

.pvb-product-gallery .pvb-gallery-thumbs:not(:has(button:nth-of-type(2), li:nth-child(2))) {
  display: none;
}

.pvb-product-gallery .pvb-gallery-thumbs button {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.pvb-product-gallery .pvb-gallery-thumbs img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  opacity: .5;
}

.pvb-product-gallery .pvb-gallery-thumbs button:is(:hover, [aria-pressed="true"], :focus-visible) img {
  opacity: 1;
}

.pvb-product-gallery .pvb-gallery-dialog:not([open]) {
  display: none;
}

.pvb-product-gallery .pvb-gallery-dialog[open] {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 44px 48px 48px;
  overflow: hidden;
  border: 0;
  background: #000;
  color: #fff;
}

.pvb-product-gallery .pvb-gallery-dialog::backdrop {
  background: #000;
}

html:has(.pvb-gallery-dialog[open]) {
  overflow: hidden;
}

.pvb-product-gallery .pvb-gallery-lightbox-img {
  display: block;
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: calc(100dvh - 92px);
  width: auto;
  height: auto;
  margin: 0;
  object-fit: contain;
}

.pvb-product-gallery .pvb-gallery-lightbox-img.is-zoomed {
  transform: scale(1.6);
}

.pvb-product-gallery .pvb-gallery-count,
.pvb-product-gallery .pvb-gallery-caption,
.pvb-product-gallery .pvb-gallery-dialog button {
  position: absolute;
  z-index: 2;
  color: #fff;
}

.pvb-product-gallery .pvb-gallery-count {
  inset-block-start: 0;
  inset-inline-start: 10px;
  font-size: 13px;
  line-height: 44px;
  opacity: .85;
}

.pvb-product-gallery .pvb-gallery-caption {
  inset-block-end: 0;
  inset-inline: 0;
  box-sizing: border-box;
  min-height: 44px;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px 10px;
  background: rgb(0 0 0 / 50%);
  font-size: 13px;
  line-height: 20px;
}

.pvb-product-gallery .pvb-gallery-caption:empty {
  display: none;
}

.pvb-product-gallery .pvb-gallery-dialog button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgb(0 0 0 / 50%);
  font: 400 25px/1 system-ui, sans-serif;
  opacity: .85;
  cursor: pointer;
}

.pvb-product-gallery .pvb-gallery-dialog button:is(:hover, :focus-visible) {
  background: rgb(0 0 0 / 75%);
  color: #fff;
  opacity: 1;
}

.pvb-product-gallery .pvb-gallery-dialog [data-pvb-close] {
  inset-block-start: 0;
  inset-inline-end: 0;
}

.pvb-product-gallery .pvb-gallery-dialog [data-pvb-zoom] {
  inset-block-start: 0;
  inset-inline-end: 44px;
}

.pvb-product-gallery .pvb-gallery-dialog [data-pvb-step] {
  inset-block-start: calc(50% - 22px);
}

.pvb-product-gallery .pvb-gallery-dialog [data-pvb-step="-1"] {
  inset-inline-start: 0;
}

.pvb-product-gallery .pvb-gallery-dialog [data-pvb-step="1"] {
  inset-inline-end: 0;
}

.pvb-product-gallery:dir(rtl) .pvb-gallery-dialog [data-pvb-step] {
  transform: scaleX(-1);
}

.pvb-product-gallery:has(.pvb-gallery-thumbs button:only-of-type):not(:has(.pvb-gallery-thumbs button:nth-of-type(2), .pvb-gallery-thumbs li:nth-child(2))) .pvb-gallery-dialog [data-pvb-step] {
  display: none;
}

@media (max-width: 767px) {
  .pvb-product-gallery .pvb-gallery-dialog[open] {
    padding-inline: 8px;
  }

  .pvb-product-gallery .pvb-gallery-dialog [data-pvb-step] {
    background: rgb(0 0 0 / 25%);
  }
}

.pvb-product-gallery .pvb-gallery-main {
  position: relative;
}

.pvb-product-gallery .pvb-gallery-outgoing {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
