/* 수술항목 상세보기 모달 */
.surgery-detail-modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

/* 로딩 스타일 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 40px 20px;
}

.loading-content {
  text-align: center;
  max-width: 300px;
}

.loading-spinner-container {
  margin-bottom: 25px;
}

.loading-spinner {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid #FFB9B7;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top-color: #FF8A80;
  animation-delay: -0.4s;
}

.spinner-ring:nth-child(3) {
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
  border-top-color: #FF6B6B;
  animation-delay: -0.8s;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 20px;
}

.loading-message {
  color: #666;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 10px 0;
  letter-spacing: 0.5px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.dot {
  width: 6px;
  height: 6px;
  background-color: #FFB9B7;
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite both;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotPulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.surgery-detail-modal-content {
  background-color: #fff;
  margin: 0 auto;
  padding: 0;
  border-radius: 20px;
  width: 90%;
  max-width: 1920px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.surgery-detail-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.surgery-detail-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.surgery-detail-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #888;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
}

.surgery-detail-modal-close:hover {
  background-color: #f5f5f5;
  color: #222;
}

.surgery-detail-modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

.surgery-detail-info {
  margin-bottom: 120px;
}

.surgery-detail-description {
  font-size: 16px;
  line-height: 1.6;
  color: #555;
  margin-bottom: 20px;
}

.surgery-detail-description h1,
.surgery-detail-description h2,
.surgery-detail-description h3,
.surgery-detail-description h4,
.surgery-detail-description h5,
.surgery-detail-description h6 {
  color: #222;
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}

.surgery-detail-description ul,
.surgery-detail-description ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

.surgery-detail-description li {
  margin-bottom: 5px;
}

.surgery-detail-description strong,
.surgery-detail-description b {
  font-weight: 600;
  color: #222;
}

.surgery-detail-description em,
.surgery-detail-description i {
  font-style: italic;
}

.surgery-detail-description a {
  color: #007bff;
  text-decoration: none;
}

.surgery-detail-description a:hover {
  text-decoration: underline;
}

.surgery-detail-description img {
  height: auto;
  display: block;
}

/* 복수 수술항목 섹션 스타일 */
.surgery-item-section {
  margin-bottom: 30px;
}

.surgery-item-section:last-child {
  margin-bottom: 0;
}

.surgery-item-name {
  font-size: 22px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #FFB9B7;
  display: inline-block;
}

.surgery-item-description {
  font-size: 16px;
  line-height: 1.7;
  color: #555;
}

.surgery-item-divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 40px 0;
}

/* 반응형 - 복수 수술항목 */
@media (max-width: 768px) {
  .surgery-item-name {
    font-size: 18px;
    margin-bottom: 12px;
    padding-bottom: 8px;
  }

  .surgery-item-description {
    font-size: 15px;
  }

  .surgery-item-divider {
    margin: 30px 0;
  }
}

/* 섹션 제목 */
.section-title {
  font-size: 48px;
  font-weight: 400;
  text-align: center;
  color: #222;
  margin-bottom: 66px;
}

/* Before & After 섹션 */
.before-after-detail-section {
  margin: 0 auto;
  position: relative;
}

.before-after-slider {
  position: relative;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 80px;
}

.before-after-main {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 500px;
}

.after-image {
  width: 650px;
  max-height: 500px;
  height: auto;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.after-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.after-text {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
}

/* 커스텀 슬라이더 버튼 */
.custom-slider-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  width: 56px !important;
  height: 56px !important;
  background: #FFB9B7 !important;
  color: #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
  cursor: pointer !important;
  font-size: 36px !important;
  transition: background 0.2s, color 0.2s !important;
  border: none !important;
}

.before-after-slider-button-prev.custom-slider-btn {
  left: 10% !important;
}

.before-after-slider-button-next.custom-slider-btn {
  right: 10% !important;
}

.custom-slider-btn:hover {
  background: #ff69b4 !important;
  color: #fff !important;
}

.custom-slider-btn .material-symbols-outlined {
  font-size: 40px !important;
  color: inherit !important;
}

/* 썸네일 */
.before-after-thumbnails {
  margin-top: 30px;
  display: flex;
  gap: 20px;
  justify-content: center;
}

.thumbnail-item {
  width: 340px;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border 0.2s, transform 0.2s;
}

.thumbnail-item.active {
  border: 2px solid #ff69b4;
  transform: scale(1.05);
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 수술 후기 섹션 */
.review-detail-section {
  margin: 120px auto;
  max-width: 1200px;
  position: relative;
}

.review-detail-section .review-slider {
  position: relative;
  width: 87%;
  margin: 0 auto;
  transition: width 0.3s ease;
}

/* 슬라이드 부족 시 nav 버튼 숨김 */
.review-slider-button-next.swiper-button-lock,
.review-slider-button-prev.swiper-button-lock {
  display: none !important;
}

/* 모달 내 수술후기 카드 (메인 페이지와 동일 디자인) */
.modal-review-card {
  position: relative;
  height: 280px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

.modal-review-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.modal-review-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.4s ease;
}

.modal-review-card:hover .modal-review-bg img {
  transform: scale(1.08);
  filter: brightness(0.35);
}

/* 상단 title 영역 (평상시 표시, 호버 시 숨김) */
.modal-review-title-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 14px 16px;
  box-sizing: border-box;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  transition: opacity 0.4s ease;
  z-index: 3;
}

.modal-review-title-bar .modal-review-title-text {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: block;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-review-card:hover .modal-review-title-bar {
  opacity: 0;
}

/* 하단 시술명 영역 (평상시 표시, 호버 시 숨김) */
.modal-review-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  transition: opacity 0.4s ease;
}

.modal-review-content .modal-review-tag {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: inline-block;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.5);
  border-bottom: 2px solid rgba(255, 255, 255, 0.5);
  padding-bottom: 4px;
}

.modal-review-card:hover .modal-review-content {
  opacity: 0;
}

/* 호버 오버레이 (호버 시 표시) */
.modal-review-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  padding: 16px;
  box-sizing: border-box;
  text-align: center;
}

.modal-review-card:hover .modal-review-overlay {
  opacity: 1;
}

.modal-review-overlay .modal-review-tag {
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.modal-review-overlay .modal-review-title {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 수술 후기 슬라이더 버튼 */
.review-slider-button-next,
.review-slider-button-prev {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  top: 50% !important;
  transform: translateY(30px) !important;
  z-index: 10 !important;
  width: 40px !important;
  height: 40px !important;
  background: transparent !important;
  color: #000 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 24px !important;
  transition: opacity 0.2s !important;
  border: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.review-slider-button-prev {
  left: 0px !important;
}

.review-slider-button-next {
  right: 0px !important;
}

.review-slider-button-next:hover,
.review-slider-button-prev:hover {
  opacity: 0.7 !important;
}

.review-slider-button-next:after,
.review-slider-button-prev:after {
  content: "" !important;
  width: 100%;
  height: 100%;
  mask: url("/images/icon/icon-arrow-right-4a4688d3e0ea619abfc1b28b92491087.svg") no-repeat center / cover;
  -webkit-mask: url("/images/icon/icon-arrow-right-4a4688d3e0ea619abfc1b28b92491087.svg") no-repeat center / cover;
  background-color: #888;
}
.review-slider-button-prev:after {
  transform: rotate(180deg);
}

/* 상담 및 예약 섹션 */
.consultation-section {
  background: linear-gradient(135deg, #ffe6f0, #fff0f5);
  padding: 40px;
  border-radius: 20px;
  margin: 40px 0;
}

.consultation-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.consultation-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.consultation-cards {
  display: flex;
  gap: 20px;
  flex: 2;
}

.consultation-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  flex: 1;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
  max-width: 280px;
  height: 238px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.consultation-card:hover {
  transform: translateY(-5px);
}

.card-icon {
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
}

.card-icon img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(39%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.4) contrast(1);
  transition: filter 0.3s ease;
}

.consultation-card p {
  font-size: 14px;
  color: #1d1d1f;
  margin: 0;
  font-weight: 400;
  transition: font-weight 0.3s ease;
}

.consultation-card:hover .card-icon img {
  filter: brightness(0) saturate(100%) invert(85%) sepia(15%) saturate(1000%) hue-rotate(320deg) brightness(1.1) contrast(1);
}

.consultation-card:hover p {
  font-weight: 700;
}

/* 반응형 */
@media (max-width: 1024px) {
  .section-title {
    font-size: 32px;
    margin-bottom: 30px;
  }

  .after-image {
    width: 100%;
    height: auto;
  }

  .custom-slider-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 22px !important;
  }

  .before-after-slider {
    padding: 0 50px;
  }

  .before-after-thumbnails {
    gap: 10px;
  }

  .thumbnail-item {
    width: 160px;
    height: 100px;
  }

  /* 수술 후기 카드 반응형 */
  .modal-review-card {
    height: 180px;
  }

  /* 수술 후기 슬라이더 반응형 */
  .review-slider-button-next,
  .review-slider-button-prev {
    width: 32px !important;
    height: 32px !important;
    font-size: 18px !important;
  }

  .review-slider-button-prev {
    left: -20px !important;
  }

  .review-slider-button-next {
    right: -20px !important;
  }

  .review-slider-button-next:after,
  .review-slider-button-prev:after {
    font-size: 18px !important;
  }
}

@media (max-width: 768px) {

  /* 수술항목 상세보기 모달 */
  .surgery-detail-modal-content {
    margin: 10% auto;
    width: 95%;
    max-height: 85vh;
  }

  .surgery-detail-modal-header {
    padding: 12px 20px;
  }

  .surgery-detail-modal-header h3 {
    font-size: 18px;
  }

  .surgery-detail-modal-body {
    padding: 20px;
  }

  .surgery-detail-description {
    font-size: 15px;
  }

  /* 섹션 제목 */
  .section-title {
    font-size: 22px;
    margin: 30px 0 20px 0;
  }

  /* Before & After 섹션 */
  .before-after-main {
    flex-direction: column;
    height: auto;
    gap: 10px;
  }

  .before-overlay .material-symbols-outlined {
    font-size: 32px;
  }

  .before-after-slider-button-next,
  .before-after-slider-button-prev {
    width: 30px;
    height: 30px;
  }

  .before-after-slider-button-next:after,
  .before-after-slider-button-prev:after {
    font-size: 14px;
  }

  .before-after-thumbnails {
    flex-wrap: wrap;
    gap: 10px;
  }

  .thumbnail-item {
    width: 100px;
    height: 70px;
  }

  .thumbnail-before,
  .thumbnail-after {
    height: 60px;
  }

  /* 수술 후기 카드 반응형 */
  .modal-review-card {
    height: 140px;
  }

  .modal-review-title-bar {
    padding: 10px 12px;
  }

  .modal-review-title-bar .modal-review-title-text {
    font-size: 12px;
  }

  .modal-review-content {
    padding: 10px 12px;
  }

  .modal-review-content .modal-review-tag {
    font-size: 12px;
  }

  /* 수술 후기 섹션 */
  .review-slider-button-next,
  .review-slider-button-prev {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }

  .review-slider-button-prev {
    left: 0 !important;
  }

  .review-slider-button-next {
    right: 0 !important;
  }

  .review-slider-button-next:after,
  .review-slider-button-prev:after {
    font-size: 16px !important;
  }

  /* 상담 및 예약 섹션 */
  .consultation-section {
    padding: 20px;
  }

  .consultation-content {
    flex-direction: column;
    gap: 20px;
  }

  .consultation-cards {
    flex-direction: column;
  }

  .consultation-card {
    padding: 15px;
  }

  .logo-icon img {
    width: 36px;
    height: 36px;
  }

  .consultation-logo h3 {
    font-size: 20px;
  }

  .card-icon img {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 600px) {
  .custom-slider-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }

  .before-after-slider {
    padding: 0 30px;
  }

  .before-after-thumbnails {
    gap: 6px;
  }

  .thumbnail-item {
    width: 70px;
    height: 50px;
  }

  /* 수술 후기 슬라이더 모바일 */
  .review-slider-button-prev {
    left: -15px !important;
  }

  .review-slider-button-next {
    right: -15px !important;
  }

  .review-slider-button-next:after,
  .review-slider-button-prev:after {
    font-size: 14px !important;
  }
}

/* ========================================
   비로그인 사용자 블러 오버레이 (모달용)
   ======================================== */

/* 메인 이미지 블러 오버레이 */
.after-image.blur-overlay-container {
  position: relative;
  overflow: hidden;
  background: rgba(26, 26, 26, 0.8);
  /* 원래 .after-image 크기 유지 (width: 650px, max-height: 500px) */
}

.after-image.blur-overlay-container > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.after-image.blur-overlay-container .blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: brightness(0.85) contrast(1.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.after-image.blur-overlay-container:hover > img:first-child {
  opacity: 0.08;
  filter: blur(2px);
}

.after-image.blur-overlay-container:hover .blur-overlay {
  filter: brightness(0.75) contrast(1.15);
}

/* 썸네일 블러 오버레이 */
.thumbnail-item.blur-overlay-container {
  position: relative;
  overflow: hidden;
  background: rgba(26, 26, 26, 0.8);
}

.thumbnail-item.blur-overlay-container > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: blur(8px);
}

.thumbnail-item.blur-overlay-container .blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

/* 수술후기 카드 블러 오버레이 (여성클리닉/모발이식 비로그인) */
.modal-review-bg.blur-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: rgba(26, 26, 26, 0.8);
}

.modal-review-bg.blur-overlay-container > img:first-child {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-review-bg.blur-overlay-container .blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  filter: brightness(0.85) contrast(1.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-review-card-blur:hover .modal-review-bg.blur-overlay-container > img:first-child {
  opacity: 0.08;
  filter: blur(2px);
}

.modal-review-card-blur:hover .modal-review-bg.blur-overlay-container .blur-overlay {
  filter: brightness(0.75) contrast(1.15);
}

/* ========================================
   수술후기 상세보기 모달 (surgery-detail 내부)
   ======================================== */
.sd-review-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 1100;
}

.sd-review-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 16px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

.sd-review-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
  z-index: 5;
  transition: color 0.2s;
}

.sd-review-modal-close:hover {
  color: #1d1d1f;
}

.sd-review-modal-header {
  padding: 30px 30px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.sd-review-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  margin: 0 0 10px 0;
}

.sd-review-modal-surgery {
  font-size: 15px;
  color: #ec4899;
  font-weight: 500;
  margin-bottom: 10px;
}

.sd-review-modal-info {
  display: flex;
  gap: 16px;
  color: #888;
  font-size: 13px;
}

.sd-review-modal-content {
  padding: 24px 30px 30px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.7;
  color: #444;
  font-size: 15px;
}

@media (max-width: 768px) {
  .sd-review-modal {
    width: 95%;
    max-height: 85vh;
  }

  .sd-review-modal-header {
    padding: 20px 20px 15px;
  }

  .sd-review-modal-title {
    font-size: 18px;
  }

  .sd-review-modal-content {
    padding: 16px 20px 20px;
    font-size: 14px;
  }
}
