.block-product-gallery--narrow .block-product-gallery__frame {
  max-width: 760px;
  margin-inline: auto;
}

.shop-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.shop-gallery:has(> .shop-gallery__thumbs[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.shop-gallery__stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--ib-radius);
  background: var(--ib-bg-soft);
}

.shop-gallery__track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}

.shop-gallery__track::-webkit-scrollbar {
  display: none;
}

.shop-gallery__slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  aspect-ratio: 1 / 1;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.shop-gallery--portrait .shop-gallery__slide {
  aspect-ratio: 4 / 5;
}

.shop-gallery--landscape .shop-gallery__slide {
  aspect-ratio: 4 / 3;
}

.shop-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.shop-gallery[data-zoom] .shop-gallery__image {
  cursor: zoom-in;
}

.shop-gallery__slide--blank {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-gallery__blank {
  width: 64px;
  height: 64px;
  color: var(--ib-line);
}

.shop-gallery__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 3px;
  background: var(--ib-accent);
  color: var(--ib-accent-contrast);
  font-family: var(--ib-font-display);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.shop-gallery__lists {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.shop-gallery__lists .shop-list-actions {
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.shop-gallery__lists .shop-list-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border: 0;
  background: rgba(255, 255, 255, .6);
  color: #0f1115;
  box-shadow: 0 0 2px rgba(15, 23, 42, .3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.shop-gallery__lists .shop-list-btn:hover,
.shop-gallery__lists .shop-list-btn:focus-visible,
.shop-gallery__lists .shop-list-btn.is-active {
  background: #fff;
  color: #0f1115;
}

.shop-gallery__lists .shop-list-btn--wishlist.is-active {
  color: var(--ib-danger-solid, #c0392b);
}

.shop-gallery__lists .shop-list-btn--compare.is-active {
  color: var(--ib-accent);
}

.shop-gallery__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: 1px solid var(--ib-line);
  border-radius: 50%;
  background: var(--ib-bg);
  color: var(--ib-fg);
  box-shadow: var(--ib-shadow-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--ib-motion) var(--ib-ease), border-color var(--ib-motion) var(--ib-ease), color var(--ib-motion) var(--ib-ease);
}

.shop-gallery__nav[hidden] {
  display: none;
}

.shop-gallery__nav::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.shop-gallery__nav--prev {
  left: 14px;
}

.shop-gallery__nav--prev::before {
  margin-left: 4px;
  transform: rotate(-135deg);
}

.shop-gallery__nav--next {
  right: 14px;
}

.shop-gallery__nav--next::before {
  margin-right: 4px;
  transform: rotate(45deg);
}

.shop-gallery__stage:hover .shop-gallery__nav,
.shop-gallery__nav:focus-visible {
  opacity: 1;
}

.shop-gallery__nav:hover {
  border-color: var(--ib-accent);
  color: var(--ib-accent);
}

.shop-gallery__nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.shop-gallery__thumbs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  contain: size;
  scrollbar-width: none;
}

.shop-gallery__thumbs::-webkit-scrollbar {
  display: none;
}

.shop-gallery__thumbs[hidden] {
  display: none;
}

.shop-gallery__thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--ib-line);
  border-radius: var(--ib-radius);
  background: var(--ib-bg-soft);
  cursor: pointer;
  opacity: .72;
  transition: opacity var(--ib-motion) var(--ib-ease), border-color var(--ib-motion) var(--ib-ease);
}

.shop-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-gallery__thumb:hover,
.shop-gallery__thumb.is-active {
  opacity: 1;
}

.shop-gallery__thumb.is-active {
  border-color: var(--ib-accent);
  box-shadow: inset 0 0 0 1px var(--ib-accent);
}

.shop-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 12, 16, .94);
  color: #fff;
}

.shop-lightbox::backdrop {
  background: rgba(10, 12, 16, .94);
}

.shop-lightbox[open] {
  animation: shop-lightbox-in .3s ease both;
}

.shop-lightbox[open]::backdrop {
  animation: shop-lightbox-in .3s ease both;
}

.shop-lightbox.is-closing {
  animation: shop-lightbox-out .25s ease both;
}

.shop-lightbox.is-closing::backdrop {
  animation: shop-lightbox-out .25s ease both;
}

@keyframes shop-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shop-lightbox-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.shop-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 72px;
}

.shop-lightbox__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}

.shop-lightbox__button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}

.shop-lightbox__button:hover {
  background: rgba(255, 255, 255, .16);
}

.shop-lightbox__button[hidden] {
  display: none;
}

.shop-lightbox__close {
  top: 16px;
  right: 16px;
}

.shop-lightbox__prev {
  top: 50%;
  left: 16px;
  margin-top: -24px;
}

.shop-lightbox__next {
  top: 50%;
  right: 16px;
  margin-top: -24px;
}

.shop-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 14px;
  color: rgba(255, 255, 255, .72);
}

body.shop-lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .shop-gallery__nav {
    display: none;
  }

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

  .shop-gallery__thumbs {
    gap: 6px;
  }

  .shop-gallery__lists {
    top: 10px;
    right: 10px;
  }

  .shop-gallery__lists .shop-list-btn {
    width: 36px;
    height: 36px;
  }

  .shop-gallery__thumb {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .shop-lightbox__stage {
    padding: 64px 12px;
  }

  .shop-lightbox__prev,
  .shop-lightbox__next {
    top: auto;
    bottom: 12px;
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-lightbox[open],
  .shop-lightbox[open]::backdrop,
  .shop-lightbox.is-closing,
  .shop-lightbox.is-closing::backdrop {
    animation: none;
  }
}
