.class-detail-gallery__open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.class-detail-gallery__open img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.class-detail-gallery__more-wrap {
  margin: 4px 0 18px;
  text-align: center;
}

.class-detail-gallery__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid #d9468c;
  border-radius: 999px;
  background: #fff;
  color: #b8326f;
  font-weight: 600;
  cursor: pointer;
}

.class-detail-gallery__more:hover,
.class-detail-gallery__more:focus {
  background: #d9468c;
  color: #fff;
  outline: none;
}

body.class-gallery-open {
  overflow: hidden;
}

.class-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.class-gallery-modal[hidden] {
  display: none !important;
}

.class-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 16, 0.78);
}

.class-gallery-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(1120px, 100%);
  height: min(80vh, 740px);
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.class-gallery-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #1c1917;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.class-gallery-modal__thumbs {
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  background: #faf7f8;
  border-right: 1px solid rgba(217, 70, 140, 0.16);
}

.class-gallery-modal__thumb {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.class-gallery-modal__thumb.is-active {
  border-color: #d9468c;
}

.class-gallery-modal__thumb img {
  display: block;
  width: 100%;
  height: 84px;
  object-fit: cover;
}

.class-gallery-modal__stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 64px 16px;
  background: #161316;
}

.class-gallery-modal__stage img {
  max-width: 100%;
  max-height: calc(100% - 48px);
  object-fit: contain;
}

.class-gallery-modal__caption {
  margin: 12px 0 0;
  min-height: 1.2em;
  color: #fff;
  text-align: center;
}

.class-gallery-modal__count {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.class-gallery-modal__nav {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.class-gallery-modal__nav:hover,
.class-gallery-modal__nav:focus {
  background: rgba(217, 70, 140, 0.9);
  outline: none;
}

.class-gallery-modal__nav--prev {
  left: 12px;
}

.class-gallery-modal__nav--next {
  right: 12px;
}

@media (max-width: 767px) {
  .class-gallery-modal {
    padding: 8px;
  }

  .class-gallery-modal__dialog {
    flex-direction: column;
    height: min(94vh, 860px);
  }

  .class-gallery-modal__stage {
    order: 1;
    padding: 44px 48px 8px;
  }

  .class-gallery-modal__thumbs {
    order: 2;
    flex: 0 0 96px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-top: 1px solid rgba(217, 70, 140, 0.16);
  }

  .class-gallery-modal__thumb {
    width: 84px;
    flex: 0 0 84px;
  }
}
