.main-popup {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 2147483647 !important;
  display: none;
  outline: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  margin: 0 !important;
  box-sizing: border-box;
  overflow: auto;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.main-popup.is-open {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  align-content: safe center;
  gap: 24px;
}

.main-popup__box {
  position: relative;
  display: inline-block;
  width: min(420px, calc(100vw - 48px));
  max-width: 92vw;
  max-height: none;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.main-popup__poster {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(650px, calc(100vh - 110px));
  object-fit: contain;
}

/* 화면 높이가 낮을 때는 하단 버튼 영역까지 화면 안에 들어오도록 축소 */
@media (max-height: 902px) {
  .main-popup__poster {
    max-height: calc(100vh - 110px);
  }
}

.main-popup__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 16px;
  box-sizing: border-box;
  border-top: 1px solid #ececec;
  background: #fff;
  color: #222;
  font-size: 13px;
}

.main-popup__today,
.main-popup__close-bottom {
  border: 0;
  padding: 10px 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.main-popup__close-bottom {
  font-weight: 700;
}

@media (max-width: 640px) {
  .main-popup {
    padding: 14px;
  }

  .main-popup__box {
    max-width: 94vw;
    max-height: none;
    border-radius: 10px;
  }

  .main-popup__poster {
    max-width: 100%;
    max-height: calc(100vh - 100px);
  }

  .main-popup__footer {
    padding: 0 14px;
  }
}

.main-popup__box[hidden] { display: none !important; }
