.ms-product-lightbox[hidden] {
  display: none !important;
}

.ms-product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-columns: minmax(52px, 1fr) minmax(0, 1200px) minmax(52px, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 34px 20px 18px;
  background: rgba(7, 16, 30, 0.94);
  backdrop-filter: blur(5px);
}

.ms-product-lightbox-open {
  overflow: hidden;
}

.ms-product-lightbox__figure {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  text-align: center;
}

.ms-product-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 120px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.45);
}

.ms-product-lightbox__caption {
  margin-top: 10px;
  color: #fff;
  font: 500 15px/1.35 Arial, sans-serif;
}

.ms-product-lightbox__close,
.ms-product-lightbox__arrow {
  appearance: none;
  border: 0;
  color: #fff;
  background: rgba(20, 109, 182, 0.94);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.38);
}

.ms-product-lightbox__close:hover,
.ms-product-lightbox__close:focus-visible,
.ms-product-lightbox__arrow:hover,
.ms-product-lightbox__arrow:focus-visible {
  background: #c50707;
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.ms-product-lightbox__close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font: 400 36px/42px Arial, sans-serif;
}

.ms-product-lightbox__arrow {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font: 700 42px/46px Arial, sans-serif;
}

.ms-product-lightbox__arrow--prev {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.ms-product-lightbox__arrow--next {
  grid-column: 3;
  grid-row: 1;
  justify-self: start;
}

.ms-product-lightbox__counter {
  grid-column: 2;
  grid-row: 2;
  justify-self: center;
  min-width: 72px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font: 600 14px/1 Arial, sans-serif;
  text-align: center;
}

@media (max-width: 767px) {
  .ms-product-lightbox {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 4px;
    padding: 64px 8px 16px;
  }

  .ms-product-lightbox__image {
    max-height: calc(100vh - 150px);
  }

  .ms-product-lightbox__arrow {
    width: 42px;
    height: 42px;
    font-size: 34px;
    line-height: 38px;
  }

  .ms-product-lightbox__caption {
    font-size: 13px;
  }
}
