body.product-gallery-is-open {
  overflow: hidden;
}

[data-product-gallery-fullscreen] {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

[data-product-gallery-fullscreen][hidden] {
  display: none !important;
}

.product-gallery-fullscreen {
  opacity: 0;
  transition: opacity 180ms ease;
}

.product-gallery-fullscreen.is-open {
  opacity: 1;
}

.product-gallery-fullscreen__backdrop {
  position: absolute;
  inset: 0;
  /*background:*/
  /*  radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 35%),*/
  /*  rgba(5, 10, 20, 0.88);*/
  background: #00000066;
  backdrop-filter: blur(14px);
}

.product-gallery-fullscreen__dialog {
  position: relative;
  z-index: 1;
  width: min(1240px, 100%);
  max-height: min(100vh - 36px, 980px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  /*background: rgba(12, 17, 27, 0.72);*/
  background: #ffffff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateY(18px) scale(0.985);
  transition: transform 180ms ease;
  outline: none;
}

.product-gallery-fullscreen.is-open .product-gallery-fullscreen__dialog {
  transform: translateY(0) scale(1);
}

.product-gallery-fullscreen__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-right: 48px;
}

.product-gallery-fullscreen__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  color: #221f1f;
}

.product-gallery-fullscreen__counter {
  margin: 0;
  flex: 0 0 auto;
  font-size: 14px;
  letter-spacing: 0.08em;
  /*color: rgba(255, 255, 255, 0.7);*/
  color: #8B8080;
}

.product-gallery-fullscreen__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  /*background: rgba(255, 255, 255, 0.1);*/
  color: #221f1f;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.product-gallery-fullscreen__close:hover,
.product-gallery-fullscreen__close:focus-visible {
  /*background: rgba(255, 255, 255, 0.16);*/
  color: #8B8080;
}

.product-gallery-fullscreen__stage {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  min-height: 0;
}

.product-gallery-fullscreen__viewport {
  position: relative;
  min-height: 0;
  height: min(68vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.product-gallery-fullscreen__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.product-gallery-fullscreen__media--video {
  border: 0;
}

.product-gallery-fullscreen__nav {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.product-gallery-fullscreen__nav img {
  /*filter: brightness(0) invert(1);*/
}

.product-gallery-fullscreen__nav--next img {
  transform: rotate(180deg);
}

.product-gallery-fullscreen__nav:hover:not(:disabled),
.product-gallery-fullscreen__nav:focus-visible:not(:disabled) {
  /*opacity: 0.7;*/
  filter: invert(60%) sepia(87%) saturate(1476%) hue-rotate(349deg) brightness(101%) contrast(97%);
}

.product-gallery-fullscreen__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.product-gallery-fullscreen__thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(72px, 92px);
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.32) transparent;
}

.product-gallery-fullscreen__thumb {
  position: relative;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.7;
  transition: transform 150ms ease, opacity 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.product-gallery-fullscreen__thumb:hover,
.product-gallery-fullscreen__thumb:focus-visible {
  opacity: 1;
}

.product-gallery-fullscreen__thumb.is-active {
  border-color: #f96332;
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(255, 184, 77, 0.12);
}

.product-gallery-fullscreen__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-gallery-fullscreen__thumb-play {
  position: absolute;
  inset: auto 10px 10px auto;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.product-gallery-fullscreen__thumb-play::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-35%, -50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
}

@media (max-width: 991px) {
  [data-product-gallery-fullscreen] {
    padding: 12px;
  }

  .product-gallery-fullscreen__dialog {
    padding: 16px;
    border-radius: 8px;
    gap: 14px;
  }

  .product-gallery-fullscreen__head {
    padding-right: 44px;
  }

  .product-gallery-fullscreen__stage {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .product-gallery-fullscreen__viewport {
    height: min(60vh, 560px);
    border-radius: 8px;
  }

  .product-gallery-fullscreen__nav {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  .product-gallery-fullscreen__dialog {
    max-height: calc(100vh - 24px);
    padding: 14px;
    gap: 12px;
  }

  .product-gallery-fullscreen__head {
    flex-wrap: wrap;
    padding-right: 46px;
  }

  .product-gallery-fullscreen__viewport {
    height: min(50vh, 430px);
  }

  .product-gallery-fullscreen__thumbs {
    grid-auto-columns: 68px;
    gap: 8px;
  }
}
