/* popup-overlay.css – 프론트 팝업 오버레이 */

/* ── 팝업 오버레이 (backdrop) ── */
.imj-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.imj-popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}
.imj-popup-overlay.is-hiding {
  opacity: 0;
}

/* ── 공통 팝업 래퍼 ── */
.imj-popup-wrap {
  position: relative;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(.92) translateY(16px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  border-radius: 14px;
  box-shadow: 0 12px 50px rgba(0,0,0,.3);
}
.imj-popup-overlay.is-visible .imj-popup-wrap {
  transform: scale(1) translateY(0);
}

/* ── display_type variants ── */
/* center (default) */
.imj-popup-wrap--center {
  max-width: 480px;
  width: 92vw;
}

/* fullscreen */
.imj-popup-wrap--fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 0;
}

/* bottom_sheet */
.imj-popup-overlay--bottom_sheet {
  align-items: flex-end;
  justify-content: center;
}
.imj-popup-wrap--bottom_sheet {
  width: 100vw;
  max-width: 560px;
  border-radius: 18px 18px 0 0;
  max-height: 85vh;
  transform: translateY(100%);
}
.imj-popup-overlay--bottom_sheet.is-visible .imj-popup-wrap--bottom_sheet {
  transform: translateY(0);
}

/* top_banner */
.imj-popup-overlay--top_banner {
  align-items: flex-start;
  background: transparent;
  pointer-events: none;
}
.imj-popup-wrap--top_banner {
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  pointer-events: all;
  transform: translateY(-100%);
}
.imj-popup-overlay--top_banner.is-visible .imj-popup-wrap--top_banner {
  transform: translateY(0);
}

/* ── 닫기 버튼 ── */
.imj-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  color: #fff;
  border: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background .2s, transform .2s;
  line-height: 1;
  padding: 0;
}
.imj-popup-close:hover {
  background: rgba(0,0,0,.7);
  transform: scale(1.08);
}
.imj-popup-close--text {
  width: auto;
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
}

/* ── 팝업 본문 ── */
.imj-popup-body {
  overflow: hidden;
}
.imj-popup-body img {
  display: block;
  width: 100%;
  height: auto;
}
.imj-popup-body a {
  display: block;
  text-decoration: none;
}
.imj-popup-html-content {
  padding: 20px;
  line-height: 1.65;
  font-size: 15px;
  color: #333;
  word-break: keep-all;
}

/* ── 하단 바: 오늘 하루 안 보기 ── */
.imj-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.95);
}
.imj-popup-today-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 4px 0;
}
.imj-popup-today-close:hover {
  color: #333;
}
.imj-popup-today-close input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2d8b4e;
}
.imj-popup-footer-close {
  font-size: 13px;
  color: #999;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 4px 8px;
}
.imj-popup-footer-close:hover {
  color: #333;
}

/* ── 복수 팝업 네비게이션 ── */
.imj-popup-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}
.imj-popup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0,0,0,.2);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.imj-popup-dot.is-active {
  background: #2d8b4e;
  transform: scale(1.3);
}
.imj-popup-counter {
  font-size: 11px;
  color: rgba(255,255,255,.85);
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(0,0,0,.4);
  padding: 2px 10px;
  border-radius: 12px;
  z-index: 10;
}

/* ── 모바일 최적화 ── */
@media (max-width: 576px) {
  .imj-popup-wrap--center {
    width: 94vw;
    max-width: 94vw;
  }
  .imj-popup-close {
    top: 8px;
    right: 8px;
  }
  .imj-popup-html-content {
    padding: 16px;
    font-size: 14px;
  }
}

/* ── 접근성: prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .imj-popup-overlay,
  .imj-popup-wrap {
    transition: none !important;
  }
}
