/* =========================================
   MODAL.CSS — 팝업 / 라이트박스 / 오버레이
   ========================================= */

/* ── 오버레이 배경 ───────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-base),
    visibility var(--transition-base);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── 모달 박스 ───────────────────────────── */
.modal {
  position: relative;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition-base);
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

/* 크기 변형 */
.modal--sm {
  max-width: 400px;
}
.modal--lg {
  max-width: 860px;
}
.modal--full {
  max-width: 95vw;
  max-height: 95vh;
}

/* ── 모달 헤더 ───────────────────────────── */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--color-border);
}

.modal__title {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
}

.modal__close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  transition:
    background var(--transition-fast),
    color var(--transition-fast);
  flex-shrink: 0;
}

.modal__close:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

/* ── 모달 본문 ───────────────────────────── */
.modal__body {
  padding: var(--sp-6);
}

/* ── 모달 푸터 ───────────────────────────── */
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── 라이트박스 (이미지 팝업) ────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-base),
    visibility var(--transition-base);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: block;
}

.lightbox__caption {
  position: absolute;
  bottom: -36px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
}

.lightbox__close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
}

/* 이전 / 다음 버튼 */
.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox__prev {
  left: 20px;
}
.lightbox__next {
  right: 20px;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ── 레거시 라이트박스 (#lightbox / .lb-*) ── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}

#lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
}

.lb-content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.lb-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
  display: block;
}

.lb-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.lb-prev,
.lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 10px 16px;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.2s;
}

.lb-prev {
  left: -64px;
}

.lb-next {
  right: -64px;
}

.lb-prev:hover,
.lb-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 600px) {
  .lb-prev {
    left: -40px;
  }

  .lb-next {
    right: -40px;
  }
}

/* ── body 스크롤 잠금 ────────────────────── */
body.modal-open {
  overflow: hidden;
}

/* ── 반응형 ──────────────────────────────── */
@media screen and (max-width: 768px) {
  .modal {
    max-width: 100%;
    margin: 0 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    transform: translateY(100%);
  }

  .modal-overlay.is-open .modal {
    transform: translateY(0);
  }

  .modal__body {
    padding: var(--sp-4);
  }
  .modal__header,
  .modal__footer {
    padding: var(--sp-3) var(--sp-4);
  }

  .lightbox__prev {
    left: 8px;
  }
  .lightbox__next {
    right: 8px;
  }
}

/* ========================================= */
/*   입장 이벤트 팝업 (.ev-*)                */
/* ========================================= */
.ev-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ev-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ev-popup {
  width: min(360px, 92vw);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.88) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.ev-overlay.active .ev-popup {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* 헤더 */
.ev-header {
  background: #C8102E;
  padding: 28px 24px 24px;
  color: #fff;
  position: relative;
}

.ev-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.ev-brand-name {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.95;
}

.ev-brand-sub {
  font-size: 20px;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.ev-headline {
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.ev-headline-en {
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-top: 6px;
  text-transform: uppercase;
}

/* 바디 */
.ev-body {
  background: #fff;
  padding: 24px 24px 20px;
}

.ev-benefit-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #999;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.ev-benefit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.ev-benefit-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f9f9f9;
  border-radius: 10px;
  padding: 12px 14px;
}

.ev-benefit-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.ev-icon-coffee { background: #fff3e0; }
.ev-icon-gift   { background: #fce4ec; }

.ev-benefit-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ev-benefit-when {
  font-size: 15px;
  color: #C8102E;
  font-weight: 600;
  /* letter-spacing: 0.04em; */
}

.ev-benefit-text {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
}

/* CTA */
.ev-cta {
  display: block;
  width: 70%;
  margin: 0 auto;
  background: #C8102E;
  color: #fff;
  text-align: center;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.2s;
}

.ev-cta:hover {
  background: #a50d25;
}

/* 푸터 */
.ev-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #1a1a1a;
}

.ev-no-today {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.ev-no-today input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #C8102E;
  cursor: pointer;
}

.ev-close-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.ev-close-btn:hover {
  color: #fff;
}
