.wp-block-woocommerce-product-image-gallery,
.elantique-product-media {
  --wc-product-gallery-background-color: var(--wp--preset--color--surface);
}

.woocommerce-product-gallery__image,
.wc-block-product-gallery-large-image,
.elantique-product-media__panel,
.elantique-product-media--placeholder {
  background: var(--wp--preset--color--surface);
}

.woocommerce-product-gallery__image img,
.wc-block-product-gallery-large-image img,
.elantique-product-media__panel img,
.elantique-product-media__panel video,
.elantique-product-media--placeholder img {
  height: auto;
  max-height: min(72vh, 820px);
  object-fit: contain;
  width: 100%;
}

.elantique-product-media {
  min-width: 0;
  position: relative;
}

.elantique-product-media__stage {
  display: grid;
  gap: 1rem;
}

.elantique-product-media.has-enhanced .elantique-product-media__stage {
  display: block;
}

.elantique-product-media__panel {
  align-items: center;
  display: flex;
  justify-content: center;
  margin: 0;
  min-height: clamp(340px, 52vw, 760px);
  overflow: hidden;
  position: relative;
}

.elantique-product-media.has-enhanced .elantique-product-media__panel:not(.is-active) {
  display: none;
}

.elantique-product-media__zoom {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: zoom-in;
  display: flex;
  height: 100%;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 100%;
}

.elantique-product-media__panel video {
  background: #1d1d1d;
  max-height: min(72vh, 820px);
}

.elantique-product-media:not(.has-enhanced) .elantique-product-media__thumbs {
  display: none;
}

.elantique-product-media__thumbs {
  display: grid;
  gap: 0.65rem;
  grid-auto-columns: 82px;
  grid-auto-flow: column;
  justify-content: start;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.45rem;
  scrollbar-width: thin;
}

.elantique-product-media__thumb {
  align-items: center;
  appearance: none;
  aspect-ratio: 1;
  background: var(--wp--preset--color--surface);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 3px;
  position: relative;
  transition: border-color var(--elantique-transition), opacity var(--elantique-transition);
}

.elantique-product-media__thumb:hover {
  border-color: rgb(95 89 67 / 48%);
}

.elantique-product-media__thumb.is-active {
  border-color: var(--wp--preset--color--olive);
}

.elantique-product-media__thumb img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.elantique-product-media__thumb.is-video img {
  opacity: 0.62;
}

.elantique-product-media__play {
  align-items: center;
  background: rgb(35 35 35 / 80%);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 0.66rem;
  height: 30px;
  justify-content: center;
  left: 50%;
  padding-left: 2px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
}

.elantique-product-media__dialog {
  background: #181818;
  border: 0;
  height: 100dvh;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: clamp(3rem, 6vw, 5rem);
  width: 100vw;
}

.elantique-product-media__dialog::backdrop {
  background: rgb(0 0 0 / 88%);
}

.elantique-product-media__dialog img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.elantique-product-media__dialog-close {
  align-items: center;
  appearance: none;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 48%);
  color: #fff;
  cursor: pointer;
  display: flex;
  font-size: 1.7rem;
  height: 44px;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 44px;
}

@media (max-width: 781px) {
  .elantique-product-media__panel {
    min-height: clamp(320px, 105vw, 620px);
  }

  .elantique-product-media__thumbs {
    grid-auto-columns: 70px;
  }

  .elantique-product-media__dialog {
    padding: 3.5rem 0.75rem 1rem;
  }
}
