body.asr-photo-gallery-open {
  overflow: hidden;
}

.asr-photo-gallery[hidden] {
  display: none !important;
}

.asr-photo-gallery {
  align-items: stretch;
  background: rgba(8, 15, 29, 0.9);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  inset: 0;
  padding: 18px 24px 16px;
  position: fixed;
  z-index: 30000;
}

.asr-photo-gallery__toolbar {
  align-items: center;
  color: #fff;
  display: flex;
  flex: 0 0 44px;
  gap: 14px;
  justify-content: center;
  position: relative;
}

.asr-photo-gallery__toolbar strong {
  font-size: 17px;
  font-weight: 600;
}

.asr-photo-gallery__counter {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: #e7edf6;
  font-size: 13px;
  line-height: 26px;
  min-width: 52px;
  padding: 0 10px;
  text-align: center;
}

.asr-photo-gallery button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  cursor: pointer;
}

.asr-photo-gallery__close {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  font-size: 30px;
  height: 40px;
  line-height: 36px;
  position: absolute;
  right: 0;
  top: 1px;
  width: 40px;
}

.asr-photo-gallery__close:hover,
.asr-photo-gallery__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.asr-photo-gallery__stage {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  position: relative;
}

.asr-photo-gallery__rotation-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 8px 0 4px;
}

.asr-photo-gallery__rotate {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  color: #fff;
  padding: 6px 12px;
}

.asr-photo-gallery__orientation-hint {
  color: #ced9e6;
  font-size: 12px;
  line-height: 1.5;
  margin: 4px auto 8px;
  max-width: 900px;
  text-align: center;
}

.asr-photo-gallery img,
.asr-register-item-card img,
.sample-list-photo,
.order-add-page .asr-order-sample-photos img,
.photo-frame img {
  image-orientation: from-image;
}

.asr-photo-gallery__image {
  border-radius: 6px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  display: block;
  max-height: calc(100vh - 246px);
  max-width: calc(100vw - 190px);
  object-fit: contain;
}

.asr-photo-gallery__image.is-quarter-turn {
  max-width: calc(100vh - 246px);
  max-height: calc(100vw - 190px);
}

.asr-photo-gallery__nav {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-size: 46px;
  height: 52px;
  justify-content: center;
  line-height: 48px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
}

.asr-photo-gallery__nav:disabled {
  cursor: default;
  opacity: 0.22;
}

.asr-photo-gallery__nav.is-previous {
  left: 4px;
}

.asr-photo-gallery__nav.is-next {
  right: 4px;
}

.asr-photo-gallery__thumbs {
  display: flex;
  flex: 0 0 66px;
  gap: 9px;
  justify-content: center;
  overflow-x: auto;
  padding-top: 10px;
}

.asr-photo-gallery__thumbs button {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 7px;
  box-sizing: border-box;
  flex: 0 0 58px;
  height: 58px;
  opacity: 0.62;
  overflow: hidden;
  padding: 2px;
}

.asr-photo-gallery__thumbs button.is-active {
  border-color: #409eff;
  opacity: 1;
}

.asr-photo-gallery__thumbs img {
  border-radius: 4px;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.sample-list-photo,
.order-add-page .asr-order-sample-photos img,
.photo-frame img {
  cursor: zoom-in;
}

@media (max-width: 720px) {
  .asr-photo-gallery {
    padding: 10px 10px 12px;
  }

  .asr-photo-gallery__image {
    max-height: calc(100vh - 260px);
    max-width: calc(100vw - 72px);
  }

  .asr-photo-gallery__image.is-quarter-turn {
    max-width: calc(100vh - 260px);
    max-height: calc(100vw - 72px);
  }

  .asr-photo-gallery__nav {
    height: 42px;
    width: 42px;
  }
}
