.product-gallery {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 45%;
  max-width: 490px;
  min-width: 0;
  flex-shrink: 0;
  padding-left: 68px;
}

.product-gallery--single { padding-left: 0; }

.product-gallery button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.product-gallery button:focus-visible {
  outline: 3px solid #e69e44;
  outline-offset: -3px;
}

.product-gallery__thumb-nav {
  position: absolute;
  inset: 0 auto 0 0;
  width: 56px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

.product-gallery__thumbs::-webkit-scrollbar { display: none; }

.product-gallery .product-gallery__scroll-up,
.product-gallery .product-gallery__scroll-down {
  height: 28px;
  flex-shrink: 0;
  border-radius: 6px;
  color: #747e84;
  font-size: 24px;
  line-height: 28px;
}

.product-gallery__scroll-up:hover,
.product-gallery__scroll-down:hover { background: #f2f3f7; }
.product-gallery .product-gallery__thumb-nav button:disabled { color: #bcc3c8; cursor: default; }

.product-gallery__thumb-nav[hidden],
.product-gallery__viewer button[hidden] {
  display: none;
}

.product-gallery .product-gallery__thumb {
  flex-shrink: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
}

.product-gallery__thumb[aria-pressed="true"] {
  border-color: #e69e44;
}

.product-gallery__main {
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  box-shadow: 0 0 20px 1px rgba(0, 0, 0, 0.1);
}

.product-gallery__open,
.product-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
}

.product-gallery img {
  height: auto;
  object-fit: contain;
}

.product-gallery .product-gallery__open {
  cursor: zoom-in;
}

.product-gallery__viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 48px 60px;
  border: 0;
  background: #fff;
}

.product-gallery__viewer::backdrop {
  background: rgba(0, 0, 0, 0.8);
}

.product-gallery .product-gallery__full-image {
  width: 100%;
  height: 100%;
}

.product-gallery__viewer button {
  position: absolute;
  width: 44px;
  height: 44px;
  color: #222;
  font-size: 40px;
  line-height: 1;
}

.product-gallery__close { top: 8px; right: 8px; }
.product-gallery__prev { top: calc(50% - 22px); left: 8px; }
.product-gallery__next { top: calc(50% - 22px); right: 8px; }
.product-gallery__counter { position: absolute; bottom: 12px; left: 0; width: 100%; text-align: center; }
.product-gallery-open { overflow: hidden; }

@media (max-width: 768px) {
  .product-gallery { width: 100%; max-width: 490px; margin: 0 auto 20px; }
  .product-gallery:not(.product-gallery--single) { padding-left: 56px; }
  .product-gallery__thumb-nav { width: 44px; }
  .product-gallery__viewer { padding: 48px 44px; }
}
