/* 프로모션 팝업 스타일 — 관리자 패널에서 생성한 팝업 표시 */

/* 백드롭 (CENTER 팝업용) */
.popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop, 900);
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 300ms ease;
}

.popup-backdrop.is-visible {
  opacity: 1;
}

/* CENTER 팝업 표시 시 스크롤 방지 */
body.popup-open {
  overflow: hidden;
}

/* 팝업 공통 */
.popup {
  position: fixed;
  z-index: var(--z-modal, 1000);
  background: var(--color-surface, #fff);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  font-family: var(--font-body, "Noto Sans KR", sans-serif);
  overflow: hidden;
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
}

/* CENTER 팝업 */
.popup--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: var(--radius-lg, 12px);
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.popup--center.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* TOP 배너 */
.popup--top {
  top: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  transform: translateY(-100%);
}

.popup--top.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* BOTTOM 배너 */
.popup--bottom {
  bottom: 0;
  left: 0;
  right: 0;
  border-radius: 0;
  transform: translateY(100%);
}

.popup--bottom.is-visible {
  transform: translateY(0);
  opacity: 1;
}

/* 헤더 */
.popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}

.popup__title {
  font-size: var(--text-base, 0.9375rem);
  font-weight: var(--font-semibold, 600);
  color: var(--color-text, #1f2937);
  margin: 0;
  line-height: 1.4;
}

/* 닫기 버튼 */
.popup__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  border-radius: var(--radius-sm, 4px);
  transition: background-color var(--transition-fast, 150ms ease),
              color var(--transition-fast, 150ms ease);
  flex-shrink: 0;
}

.popup__close:hover,
.popup__close:focus-visible {
  background-color: var(--color-gray-100, #f3f4f6);
  color: var(--color-text, #1f2937);
  outline: none;
}

.popup__close svg {
  width: 20px;
  height: 20px;
}

/* 본문 */
.popup__body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* 이미지 */
.popup__image {
  display: block;
  width: 100%;
  height: auto;
}

.popup__image--linked {
  cursor: pointer;
}

/* 텍스트 콘텐츠 */
.popup__text {
  padding: var(--spacing-4, 1rem);
  font-size: var(--text-sm, 0.8125rem);
  line-height: var(--leading-relaxed, 1.7);
  color: var(--color-text, #1f2937);
  white-space: pre-line;
  word-break: break-word;
}

/* 링크 버튼 */
.popup__link-wrap {
  padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);
  text-align: center;
}

.popup__link-btn {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  background-color: var(--color-primary, #F6A000);
  color: #fff;
  font-size: var(--text-sm, 0.8125rem);
  font-weight: var(--font-semibold, 600);
  text-decoration: none;
  border-radius: var(--radius-md, 8px);
  transition: background-color var(--transition-fast, 150ms ease);
}

.popup__link-btn:hover,
.popup__link-btn:focus-visible {
  background-color: var(--color-primary-dark, #e09000);
  outline: none;
}

/* 푸터 */
.popup__footer {
  display: flex;
  align-items: center;
  padding: var(--spacing-3, 0.75rem) var(--spacing-4, 1rem);
  border-top: 1px solid var(--color-border, #e5e7eb);
  flex-shrink: 0;
}

/* "오늘 하루 보지 않기" 체크박스 */
.popup__dismiss-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-2, 0.5rem);
  font-size: var(--text-xs, 0.75rem);
  color: var(--color-text-muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.popup__dismiss-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary, #F6A000);
}

/* 반응형 */
@media (max-width: 768px) {
  .popup--center {
    max-width: 95vw;
    max-height: 80vh;
  }
}
