@charset "utf-8";

/* =========================================
   컨테이너 (모달 카드 + 페이드 인)
========================================= */
.xe_popup_border,
.xe_popup_borderless{
  position: fixed !important;
  z-index: 100001; /* overlay(100000) 위 */
  margin: 0; padding: 0; border: 0; background: transparent;
  box-sizing: border-box;
  max-width: 100vw; /* 뷰포트보다 커지지 않게 */
  overflow: visible; /* 내부 그림자/플로팅 요소 안 잘림 */

  /* 등장 애니메이션 */
  visibility: hidden; opacity: 0;
  transform: translate3d(0,8px,0);
  transition: opacity .18s ease, transform .18s ease;
}
.xe_popup_border.ready,
.xe_popup_borderless.ready{
  visibility: visible; opacity: 1; transform: translate3d(0,0,0);
}

/* =========================================
   카드 본문 (유리 느낌) + 스크롤
========================================= */
.xe_popup_border .popupbody,
.xe_popup_borderless .popupbody{
  position: relative; display: block;
  margin: 0; padding: 0; box-sizing: border-box;

  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.22), 0 2px 10px rgba(0,0,0,.08);

  max-width: 100%;
  overflow-x: hidden;            /* 가로 스크롤 금지 */
  overflow-y: auto;              /* 세로 스크롤 */
  -webkit-overflow-scrolling: touch;

  /* 상/하단 크롬(닫기/CTA) 여백 */
  padding-top: var(--xe-top-gap, 0);
  /* padding-bottom: var(--xe-btm-gap, 0); */
}
@media (prefers-color-scheme: dark){
  .xe_popup_border .popupbody,
  .xe_popup_borderless .popupbody{
    background: rgba(22,22,24,.9);
    color: #eaeaea;
    box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 2px 10px rgba(0,0,0,.25);
  }
}
.xe_popup_border .popupbody,
.xe_popup_borderless .popupbody{
  border-radius: 16px;
  overflow: hidden;        /* 둥근 모서리 밖 내용/배경 잘림 */
  /* 이미 있는 속성들과 공존 가능 (y 스크롤 필요하면 auto로 두어도 둥근 모서리 클립은 유지됨) */
}


/* (선택) 헤더/푸터 */
.xe_popup_border .popupheader,
.xe_popup_borderless .popupheader{
  padding: 14px 18px; font-weight: 700; font-size: 16px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.xe_popup_border .popupfooter,
.xe_popup_borderless .popupfooter{
  padding: 12px 18px; border-top: 1px solid rgba(0,0,0,.06);
}

/* =========================================
   오버레이(닫기 패드) – 팝업 안에서 배치용
========================================= */
.xe_popup_border .popupcloser,
.xe_popup_borderless .popupcloser{
  position: absolute; inset: 0;
  z-index: 3; pointer-events: none; background: transparent;
}

/* 상단 플로팅 X 버튼(FAB) */
.xe-close-fab{
  position: absolute; top: 8px; right: 8px;
  width: 36px; height: 36px; border: 0; border-radius: 9999px;
  background: rgba(0,0,0,.35); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.xe-close-fab::before{ content: "✕"; font-size: 18px; line-height: 1; }
.xe-close-fab:hover{ background: rgba(0,0,0,.5); }

/* =========================================
   미디어 기본
========================================= */
.xe_popup_border .popupbody img,
.xe_popup_borderless .popupbody img,
.xe_popup_border .popupbody video,
.xe_popup_borderless .popupbody video{ max-width:100%; height:auto; display:block; }
.xe_popup_border .popupbody iframe,
.xe_popup_borderless .popupbody iframe{ width:100%; display:block; }
.xe_popup_border .ratio-16x9,
.xe_popup_borderless .ratio-16x9{ position:relative; width:100%; padding-top:56.25%; overflow:hidden; background:#000; }
.xe_popup_border .ratio-16x9 > iframe,
.xe_popup_borderless .ratio-16x9 > iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; display:block; }

/* 넓은 표 가로 스크롤 */
.xe_popup_border .popupbody .table-wrap,
.xe_popup_borderless .popupbody .table-wrap{ overflow-x: auto; }

/* =========================================
   모달 오버레이(배경) + 스크롤 잠금
========================================= */
.xe_popup_overlay{
  position: fixed; inset: 0; z-index: 100000;
  background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .18s ease;
}
.xe_popup_overlay.ready{ opacity: 1; }
html.modal-lock, body.modal-lock{ overflow: hidden !important; width: 100%; }

/* =========================================
   슬라이더
========================================= */
.xe-slider{ position: relative; width: 100%; overflow: hidden; }
.xe-slider-track{ display:flex; transition: transform .3s ease; will-change: transform; }
.xe-slide{ flex:0 0 100%; max-width:100%; }

/* 화살표 */
.xe-slider-prev,.xe-slider-next{
  position:absolute; top:50%; transform:translateY(-50%);
  width:36px; height:36px; border-radius:9999px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.35); color:#fff; border:0; cursor:pointer; z-index:4;
}
.xe-slider-prev{ left:10px; } .xe-slider-next{ right:10px; }
.xe-slider-prev:hover,.xe-slider-next:hover{ background: rgba(0,0,0,.5); }
.xe-slider-prev:focus-visible,.xe-slider-next:focus-visible{ outline:2px solid rgba(255,255,255,.9); outline-offset:2px; }
/* 아이콘 (갈매기) */
.xe-slider-prev .xe-icon,.xe-slider-next .xe-icon{ width:12px; height:12px; display:block; transform: translate(var(--icon-tx,0), var(--icon-ty,0)); }
.xe-slider-prev .xe-icon::before,.xe-slider-next .xe-icon::before{
  content:""; display:block; width:100%; height:100%;
  border-top:2px solid currentColor; border-left:2px solid currentColor;
}
.xe-slider-prev  .xe-icon::before{ transform: rotate(-45deg); }
.xe-slider-next  .xe-icon::before{ transform: rotate(135deg); }
.xe-slider-prev  { --icon-tx: 2px;  --icon-ty: 0; }
.xe-slider-next  { --icon-tx:-2px;  --icon-ty: 0; }

/* 도트/페이지/카운터 */
.xe-slider-dots{
  position:absolute; bottom:10px; left:0; right:0;
  display:flex; justify-content:center; gap:6px; pointer-events:auto;
  display: none; /* 기본 숨김 (필요시 JS에서 활성화) */
}
.xe-slider-dots .xe-dot{
  width:8px; height:8px; border-radius:50%; border:0; cursor:pointer;
  background: rgba(255,255,255,.6);
}
.xe-slider-dots .xe-dot.active{ background:#fff; }
.xe-slider-pages{
  position:absolute; bottom:10px; left:50%; transform:translateX(-50%);
  display:flex; gap:6px; z-index:3; pointer-events:auto;
}
.xe-slider-pages .xe-page{
  min-width:24px; height:24px; padding:0 6px; border:0; border-radius:9999px;
  background: rgba(0,0,0,.35); color:#fff; font-size:12px; line-height:24px; text-align:center; cursor:pointer;
  backdrop-filter: blur(2px);
}
.xe-slider-pages .xe-page.active,
.xe-slider-pages .xe-page:hover{ background: rgba(0,0,0,.55); }
.xe-slider-counter{
  position:absolute; top:10px; left:12px; padding:2px 8px; border-radius:10px;
  background: rgba(0,0,0,.35); color:#fff; font-size:12px; line-height:20px; z-index:3; pointer-events:none;
}

/* =========================================
   하단 CTA (sticky) – 버튼 수에 따라 1/2/3열
========================================= */
.xe-cta-row{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.xe-cta-row.one{   grid-template-columns: 1fr; }
.xe-cta-row.two{   grid-template-columns: 1fr 1fr; }
.xe-cta-row.three{ grid-template-columns: 1fr 1fr 1fr; }

.xe-cta-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  font-size: 1.1em;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: linear-gradient(180deg, #fafafa 0%, #f3f3f3 100%);
  color: #222;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  cursor: pointer;
  transition:
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease,
    color 0.25s ease;
}

/* ───────── Hover (Neutral 강조) ───────── */
.xe-cta-btn:hover {
  background: linear-gradient(180deg, #f2f2f2 0%, #e6e6e6 100%); /* ✅ 살짝 어두운 회색 */
  border-color: rgba(0, 0, 0, 0.541);
  color: #111;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(0, 0, 0, 0.03) inset;
}

/* 클릭 시 눌림 */
.xe-cta-btn:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #f0f0f0 0%, #e2e2e2 100%);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.15);
}

/* 포커스 접근성 */
.xe-cta-btn:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.3);
  outline-offset: 3px;
}


/* days==0일 때 왼쪽 칸 자리 채움이 필요하면 사용 */
.xe-cta-spacer{ display:block; }

/* =========================================
   전역 변수 (초기값)
========================================= */
:root{
  --xe-top-gap: 44px;  /* 상단 닫기 FAB 공간 */
  --xe-btm-gap: 36px;  /* 하단 CTA 예상 기본값 (JS에서 실제 높이로 업데이트) */
}

/* 레거시 최소 호환 */
.xe_popup_border p{ margin: 0; padding: 0; }

/* 1) fitbox를 '세로' 플렉스로: 콘텐츠 위, CTA 아래 */
.xe_popup_border .popupbody.xe-fitbox,
.xe_popup_borderless .popupbody.xe-fitbox{
  display: flex;
  flex-direction: column;     /* ← row → column */
  align-items: stretch;       /* 가로는 꽉 채우기 */
  justify-content: flex-start;/* 세로는 위에서부터 쌓기 */
  min-height: 0;               /* ← 중요 */
}

/* 2) 슬라이더가 콘텐츠 영역을 차지하도록 (CTA를 아래로 밀어냄) */
.xe_popup_border .popupbody.xe-fitbox .xe-slider,
.xe_popup_borderless .popupbody.xe-fitbox .xe-slider{
  flex: 1 1 auto;   /* 남는 높이를 차지 */
  min-height: 0;    /* flex 컨테이너 내부 스크롤 계산용 */
  width: 100%;
  height: auto;     /* 높이는 컨테이너에 맞춰 유동 */
  min-height: 0;               /* ← 중요 */
}

/* 3) 슬라이드 안 이미지는 중앙에 contain */
.xe_popup_border .popupbody.xe-fitbox .xe-slide,
.xe_popup_borderless .popupbody.xe-fitbox .xe-slide{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.xe_popup_border .popupbody.xe-fitbox .xe-slide img,
.xe_popup_borderless .popupbody.xe-fitbox .xe-slide img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* 4) 단일 이미지인 경우(슬라이더가 아닌 바로 <img> 자식인 케이스)도 위 규칙과 동일하게 중앙 contain */
.xe_popup_border .popupbody.xe-fitbox > img,
.xe_popup_borderless .popupbody.xe-fitbox > img{
  flex: 1 1 auto;   /* 콘텐츠로서 공간을 차지 */
  align-self: center;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}



/* 버튼 개수에 맞춘 그리드 헬퍼(이미 있으시면 그대로 사용) */
.xe-cta-row.one   { grid-template-columns: 1fr; }
.xe-cta-row.two   { grid-template-columns: 1fr 1fr; }
.xe-cta-row.three { grid-template-columns: 1fr 1fr 1fr; }


/* 본문을 컬럼 플렉스 컨테이너로: 미디어와 CTA를 세로 분리 */
.xe_popup_border .popupbody,
.xe_popup_borderless .popupbody{
  display: flex;
  flex-direction: column;
  min-height: 0;             /* ← flex 자식이 줄어들 수 있게 (아주 중요) */
}

/* 미디어 영역(슬라이더/이미지)에 공통 적용될 컨테이너 */
.xe-media {
  flex: 0 0 auto;            /* 고정 높이로 잡힐 영역 */
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 슬라이더/이미지 자체는 컨테이너 안에서 contain */
.xe-media .xe-slider,
.xe-media > img{
  width: 100%;
  height: 100%;
  object-fit: contain;        /* crop 없이 전체 보이기 */
}

/* CTA는 본문 맨 아래에 남기되, 자체 높이만큼만 공간 사용 */
.xe-cta-row{
  flex: 0 0 auto;
}


/* 닫기 레이어가 슬라이더 등보다 항상 위로 오게 */
.xe_popup_border .popupcloser,
.xe_popup_borderless .popupcloser{
  z-index: 6;              /* 슬라이더(4)보다 높게 */
  pointer-events: none;    /* 기본은 클릭 통과 (의도 유지) */
}

/* 닫기 패드/버튼만 클릭 가능 + 맨 위로 올림 */
.xe-closepad,
.xe-close-fab{
  pointer-events: auto;    /* ← 이것 없으면 클릭 안 잡힘 */
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 7;              /* closer(6)보다 한 단계 더 위 */
}

/* 혹시 화살표를 커스텀하셨다면 여전히 닫기가 위에 오도록 확인용(선택) */
.xe-slider-prev,
.xe-slider-next{
  z-index: 4;
}


/* CTA 그리드 하단 모서리 라운드 (popupbody가 overflow:visible일 때) */
.xe-cta-row.one .xe-cta-btn:first-child{
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.xe-cta-row.two .xe-cta-btn:first-child{
  border-bottom-left-radius: 16px;
}
.xe-cta-row.two .xe-cta-btn:last-child{
  border-bottom-right-radius: 16px;
}

.xe-cta-row.three .xe-cta-btn:first-child{
  border-bottom-left-radius: 16px;
}
.xe-cta-row.three .xe-cta-btn:last-child{
  border-bottom-right-radius: 16px;
}

/* 버튼 사이 경계 자연스럽게: 가운데 버튼(2/3열)은 하단 라운드 제거 */
.xe-cta-row.two .xe-cta-btn:not(:first-child):not(:last-child),
.xe-cta-row.three .xe-cta-btn:not(:first-child):not(:last-child){
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* hover 그림자가 라운드 밖으로 자연스럽게 보이도록 */
.xe-cta-row { position: relative; z-index: 1; }
