.product-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  padding: 24px 16px;
}

.product-gallery-modal.is-open {
  display: flex;
}

.product-gallery-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.product-gallery-modal__arrow {
  position: absolute;
  top: 50%;
  width: 10vw;
  height: 80vh;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.product-gallery-modal__arrow--prev {
  left: 0;
}

.product-gallery-modal__arrow--next {
  right: 0;
}

.product-gallery-modal__shell {
  /* width: min(96vw, 1180px); */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.product-gallery-modal__stage {
  width: 100%;
  /*height: min(82vh, 760px); */
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-gallery-modal [data-gallery-image="true"] {
  float: none;
  max-width: 100vw;
  max-height: 86vh;
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .product-gallery-modal [data-gallery-image="true"] {
    max-width: 82.3vw;
    max-height: 84vh;
  }
}

.product-gallery-modal__thumbs {
  position: absolute;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.product-gallery-modal__thumb-btn {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border: 2px solid transparent;
  padding: 0;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.product-gallery-modal__thumb-btn.is-active {
  border-color: #e11d2e;
}

.product-gallery-modal__thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.16s ease, opacity 0.16s ease;
}

.product-gallery-modal__thumb-btn.is-active .product-gallery-modal__thumb-image {
  filter: brightness(0.68);
}

.product-gallery-modal__counter {
  color: #fff;
  font: 500 12px/1.2 Inter, Arial, sans-serif;
}

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

.product-page-main-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Mobile PDP: fill the square lightbox frame (ProductPage.css sets aspect-ratio:1). */
@media screen and (max-width: 479px) {
  .catalog__light-box-link.new .product-page-main-image,
  .catalog__light-box-link.new-product .product-page-main-image {
    height: 100%;
    object-fit: cover;
  }
}

.product-page-main-image--zoomable {
  cursor: zoom-in;
}

.product-page-gallery-thumb-item {
  cursor: pointer;
}

.product-page-gallery-thumb {
  background-image: none !important;
  position: relative;
  overflow: hidden;
}

.product-page-gallery-thumb__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .product-gallery-modal__stage {
    width: 75vw;
    height: 75vw;
  }

  .product-gallery-modal [data-gallery-image="true"] {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 479px) {
  .product-gallery-modal__stage {
    width: 92vw;
    height: 92vw;
  }
}
