.bookgal[hidden] {
  display: none;
}

.bookgal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 10px 10px;
  box-sizing: border-box;
}

.bookgal *,
.bookgal *::before,
.bookgal *::after {
  box-sizing: border-box;
}

.bookgal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(28, 43, 54, .6);
}

.bookgal__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: auto;
  height: 100%;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px 16px;
  box-shadow: 0 14px 44px rgba(28, 43, 54, .3);
}

.bookgal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: none;
  border-radius: 50%;
  background: #eef2f5;
  color: #1c2b36;
  cursor: pointer;
  z-index: 3;
}

.bookgal__close:hover {
  background: #e2e8ed;
}

.bookgal__heading {
  flex: 0 0 auto;
  margin: 0 44px 2px 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  color: #12212c;
}

.bookgal__sub {
  flex: 0 0 auto;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #1e9e57;
}

.bookgal__tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  background: #f1f5f8;
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 12px;
}

.bookgal__tab {
  flex: 1 1 0;
  appearance: none;
  border: none;
  background: transparent;
  border-radius: 9px;
  padding: 9px 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #4a5b68;
  cursor: pointer;
  white-space: nowrap;
}

.bookgal__tab.is-active {
  background: #fff;
  color: #0b7fc4;
  box-shadow: 0 1px 3px rgba(28, 43, 54, .14);
}

.bookgal__panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bookgal__panel.is-hidden {
  display: none;
}

.bookgal__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid #e4ebf0;
  border-radius: 14px;
  overflow: hidden;
}

.bookgal__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bookgal__track::-webkit-scrollbar {
  display: none;
}

.bookgal__slide {
  position: relative;
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
}

.bookgal__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.bookgal__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(38, 52, 63, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 7px 11px;
  border-radius: 999px;
}

.bookgal__badge b {
  font-weight: 700;
}

.bookgal__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #1c2b36;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(28, 43, 54, .2);
}

.bookgal__arrow:hover {
  background: #fff;
}

.bookgal__arrow--prev {
  left: 10px;
}

.bookgal__arrow--next {
  right: 10px;
}

.bookgal__info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bookgal__dots {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 0 4px;
}

.bookgal__dot {
  appearance: none;
  border: none;
  padding: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cfdae2;
  cursor: pointer;
  transition: width .18s ease, background-color .18s ease;
}

.bookgal__dot.is-active {
  width: 20px;
  background: #0b7fc4;
}

.bookgal__title {
  margin: 4px 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #12212c;
}

.bookgal__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #3d4d59;
}

.bookgal__note {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: #c0392b;
}

.bookgal__back {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  margin-top: 12px;
  appearance: none;
  background: #fff;
  border: 2px solid #38b6ff;
  border-radius: 999px;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #0b7fc4;
  cursor: pointer;
}

.bookgal__back:hover {
  background: #f2f9fe;
}

body.bookgal-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  .bookgal {
    padding: 150px 28px 28px;
  }

  .bookgal__dialog {
    aspect-ratio: 16 / 9;
    max-width: 1040px;
    padding: 24px 28px 22px;
    border-radius: 22px;
  }

  .bookgal__close {
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
  }

  .bookgal__heading {
    font-size: 24px;
  }

  .bookgal__sub {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .bookgal__tabs {
    max-width: 460px;
    margin-bottom: 16px;
  }

  .bookgal__tab {
    font-size: 15px;
    padding: 10px 6px;
  }

  .bookgal__panel {
    flex-direction: row;
    gap: 26px;
  }

  .bookgal__stage {
    flex: 1 1 58%;
    min-width: 0;
  }

  .bookgal__info {
    flex: 1 1 42%;
    justify-content: flex-start;
    padding-top: 2px;
  }

  .bookgal__dots {
    justify-content: flex-start;
    padding: 0 0 14px;
  }

  .bookgal__title {
    margin: 0 0 8px;
    font-size: 20px;
  }

  .bookgal__desc {
    font-size: 15px;
  }

  .bookgal__note {
    margin-top: 10px;
    font-size: 14px;
  }

  .bookgal__back {
    max-width: 300px;
    margin: 18px auto 0;
  }

  .bookgal__arrow {
    width: 40px;
    height: 40px;
    opacity: 0;
    transition: opacity .15s ease;
  }

  .bookgal__stage:hover .bookgal__arrow,
  .bookgal__arrow:focus-visible {
    opacity: 1;
  }
}
