.envex-main-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.55);
}

.envex-main-popup-overlay[hidden] {
  display: none;
}

body.envex-main-popup-open {
  overflow: hidden;
}

/* 같은 표시순서 팝업을 나란히 표시 */
.envex-main-popup-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px;
  box-sizing: border-box;
  overflow: auto;
}

.envex-main-popup-overlay.is-multi .envex-main-popup--in-stage {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  flex: 0 1 auto;
}

.envex-main-popup {
  position: absolute;
  box-sizing: border-box;
  padding: 20px 20px 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
}

.envex-main-popup--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.envex-main-popup--center-top {
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
}

.envex-main-popup--top {
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.envex-main-popup--bottom {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

.envex-main-popup--left {
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
}

.envex-main-popup--right {
  top: 50%;
  right: 24px;
  transform: translateY(-50%);
}

.envex-main-popup__title {
  margin: 0 0 10px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #555;
}

.envex-main-popup__body {
  position: relative;
  line-height: 0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
}

.envex-main-popup__image-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.envex-main-popup__image-link {
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
}

.envex-main-popup__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  outline: none;
}

.envex-main-popup__image-link,
.envex-main-popup__image-link:focus,
.envex-main-popup__image-link:active {
  border: 0;
  outline: none;
  text-decoration: none;
}

.envex-main-popup__hotspot {
  position: absolute;
  display: block;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: none;
}

.envex-main-popup__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  background: #fff;
  border-top: 1px solid #e8e8e8;
}

.envex-main-popup__hide-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.envex-main-popup__hide-check {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
}

.envex-main-popup__confirm {
  flex-shrink: 0;
  min-width: 72px;
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: #1d6fd8;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.envex-main-popup__confirm:hover {
  background: #175eb8;
}

@media (max-width: 640px) {
  .envex-main-popup-overlay.is-multi .envex-main-popup--in-stage {
    left: auto !important;
    right: auto !important;
    width: min(100%, 360px) !important;
    max-width: calc(100vw - 32px);
    transform: none !important;
  }

  .envex-main-popup:not(.envex-main-popup--in-stage) {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none;
    padding: 16px 16px 12px;
  }

  .envex-main-popup--center:not(.envex-main-popup--in-stage),
  .envex-main-popup--center-top:not(.envex-main-popup--in-stage) {
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
  }

  .envex-main-popup--top:not(.envex-main-popup--in-stage) {
    top: 16px !important;
    transform: none !important;
  }

  .envex-main-popup--bottom:not(.envex-main-popup--in-stage) {
    bottom: 16px !important;
    top: auto !important;
    transform: none !important;
  }

  .envex-main-popup--left:not(.envex-main-popup--in-stage),
  .envex-main-popup--right:not(.envex-main-popup--in-stage) {
    top: 50% !important;
    transform: translateY(-50%) !important;
  }

  .envex-main-popup__body {
    width: 100% !important;
    height: auto !important;
  }

  .envex-main-popup__image {
    height: auto;
    object-fit: contain;
  }
}
