/* ==========================================================================
   치료 전후 상세 팝업 (.review-modal) — 치료후기 페이지 · 메인 BA 공통 (review-modal.js)
   ========================================================================== */
.review-modal {position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4rem; padding: 2rem;}
.review-modal[hidden] {display: none;}
.review-modal__backdrop {position: absolute; inset: 0; background: rgba(0, 0, 0, 0.75);}

.review-modal__dialog {position: relative; z-index: 1; width: min(84rem, 92vw); border-radius: 1.2rem;}
/* 각도 버튼이 dialog 밖으로 나와야 해서 모서리 클리핑은 이 래퍼에만 */
.review-modal__content {border-radius: 1rem; overflow: hidden;}
.review-modal__header {position: relative; display: flex; align-items: center; justify-content: center; height: 5.6rem; background: var(--color-primary);}
.review-modal__header::before {content: ""; position: absolute; bottom: -35%; left: 50%; transform: translateX(-50%); width: 65%; height: 85%; background: radial-gradient(ellipse at center, rgba(80, 190, 190, 0.8) 0%, rgba(80, 190, 190, 0.25) 45%, transparent 75%); pointer-events: none;}
/* 시술명이 길어도 한 줄 — 넘치면 말줄임(좌우 padding은 닫기 버튼 자리) */
.review-modal__title {width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 2rem; font-weight: 600; color: var(--white); padding: 0 5.6rem; text-align: center;}
/* 닫기 X — 상담신청 시술 선택 팝업(.procedure-modal__close)과 같은 얇은 svg 아이콘 */
.review-modal__close {position: absolute; top: 50%; right: 2rem; transform: translateY(-50%); width: 1.8rem; height: 1.8rem; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--white); cursor: pointer;}
.review-modal__close svg {width: 100%; height: 100%;}

.review-modal__body {position: relative;}
.review-modal__compare {display: flex;}
.review-modal__half {position: relative; flex: 1; aspect-ratio: 3 / 4; overflow: hidden; background: var(--color-bg-soft);}
.review-modal__half::after {content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); pointer-events: none;}
.review-modal__img {width: 100%; height: 100%; object-fit: cover; display: block;}
.review-modal__badge {position: absolute; z-index: 2; left: 50%; bottom: 4rem; transform: translateX(-50%); font-size: 2.5rem; font-weight: 700; color: var(--white);}

/* 촬영 각도 토글 — dialog 오른쪽 바깥 모서리에 겹쳐서 세로로 배치 */
.review-modal__angle-toggle {position: absolute; top: 50%; right: -8.5rem; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; gap: 1.2rem;}
.review-modal__angle-btn {width: 7rem; height: 7rem; padding: 0; border-radius: 0.5rem; background: rgba(255,255,255,.1); -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); border: 1px solid var(--white); color: var(--white); font-size: 1.6rem; box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.15); transition: background-color 0.2s ease, color 0.2s ease;}
.review-modal__angle-btn[aria-pressed="true"] {background: var(--color-primary); color: var(--white); border-color: var(--color-primary);}

.review-modal__nav {position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 2.4rem;}
/* nav 줄 안의 Swiper 화살표/점: 위치 기본값만 해제 */
.review-modal__arrow.swiper-button-prev,
.review-modal__arrow.swiper-button-next {
  position: relative; top: auto; left: auto; right: auto; margin: 0;
  width: auto; height: auto; color: var(--white); border: none;
}
.review-modal__arrow svg {width: 1.4rem; height: 2.4rem;}
.review-modal__dots.swiper-pagination {
  position: relative; top: auto; left: auto; right: auto; bottom: auto; width: auto;
  display: flex; align-items: center;
  --swiper-pagination-bullet-size: 0.8rem;
  --swiper-pagination-bullet-horizontal-gap: 0.4rem;
  --swiper-pagination-bullet-inactive-color: #fff;
  --swiper-pagination-bullet-inactive-opacity: 0.4;
  --swiper-pagination-color: #fff;
}

@media (max-width: 640px) {
  /* 헤더 바(5.6rem) 위로 겹치지 않게 이미지 영역 상단으로 내려서 가로로 배치 */
  .review-modal__angle-toggle {top: 6.8rem; right: 1.2rem; left: auto; transform: none; flex-direction: row;}
  .review-modal__angle-btn {width: 4.6rem; height: 3rem; font-size: 1.2rem;}
}

@media (max-width: 1024px) {
  /* 전후 사진 팝업(1024 이하): 각도 버튼을 화살표 줄 아래로, 길면 딤 영역 스크롤 */
  .review-modal {justify-content: flex-start; gap: 3.4rem; padding: 3.2rem 4rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.4) transparent;}
  .review-modal__backdrop {position: fixed;}
  .review-modal__dialog {flex: none; margin-top: auto;}
  /* 아래 padding 은 각도 버튼(dialog 밖으로 내려옴) 자리 — 그 자리에서 클릭을 가로채지 않게 nav 빈 곳은 통과 */
  .review-modal__nav {flex: none; margin-bottom: auto; padding-bottom: 13.2rem; pointer-events: none;}
  .review-modal__nav > * {pointer-events: auto;}
  /* top = 팝업~nav 간격(3.4) + nav 높이(화살표 2.4) + nav~버튼 간격(4.2) */
  .review-modal__angle-toggle {top: calc(100% + 10rem); left: 50%; right: auto; transform: translateX(-50%); flex-direction: row; gap: 1.6rem;}
  .review-modal__angle-btn {width: 9rem; height: 9rem; font-size: 2.6rem;}
}

@media (max-width: 768px) {
  /* 치료 전후 상세 팝업 — 모바일 시안: 양옆 딤 4rem 전체 폭, 버튼 배치는 1024 이하 규칙과 같고 크기만 축소 */
  .review-modal {gap: clamp(1.7rem, 4.43vw, 3.4rem); padding: clamp(1.6rem, 4.17vw, 3.2rem) clamp(2rem, 5.21vw, 4rem);}
  .review-modal__dialog {width: 100%;}
  .review-modal__content{border-radius: 0.5rem;}
  .review-modal__header {height: clamp(3.6rem, 9.38vw, 7.2rem);}
  /* 좌우 여백 = 닫기 버튼 자리(오른쪽 2.8 + 버튼 2.2 + 여유) — 1rem이면 긴 시술명 말줄임이 X 밑으로 들어간다 */
  .review-modal__title {padding: 0 clamp(2.8rem, 7.29vw, 5.6rem); font-size: clamp(1.3rem, 3.39vw, 2.6rem); font-weight: 600;}
  .review-modal__close {right: clamp(1.4rem, 3.65vw, 2.8rem); width: clamp(1.1rem, 2.86vw, 2.2rem); height: clamp(1.1rem, 2.86vw, 2.2rem);}
  .review-modal__half {aspect-ratio: 344 / 448;}
  .review-modal__badge {bottom: clamp(1.4rem, 3.65vw, 2.8rem); font-size: clamp(1.2rem, 3.13vw, 2.4rem);}
  .review-modal__nav {gap: clamp(1.4rem, 3.65vw, 2.8rem); padding-bottom: clamp(6.6rem, 17.19vw, 13.2rem);}
  .review-modal__arrow svg {width: clamp(0.8rem, 1.82vw, 1.4rem); height: clamp(1.2rem, 3.13vw, 2.4rem);}
  .review-modal__dots.swiper-pagination {--swiper-pagination-bullet-size: clamp(0.6rem, 1.43vw, 1.1rem); --swiper-pagination-bullet-horizontal-gap: clamp(0.45rem, 1.11vw, 0.85rem);}
  /* top = 팝업 아래 간격(3.4) + nav 높이(화살표 2.4) + nav~버튼 간격(4.2) */
  .review-modal__angle-toggle {top: calc(100% + clamp(5rem, 13.02vw, 10rem)); gap: clamp(0.8rem, 2.08vw, 1.6rem);}
  .review-modal__angle-btn {width: clamp(4.5rem, 11.72vw, 9rem); height: clamp(4.5rem, 11.72vw, 9rem); font-size: clamp(1.3rem, 3.39vw, 2.6rem);}
}
