/* 우측 하단 플로팅 아이콘 컨테이너 */
.floating-icons {
  position: fixed;
  right: 16px;
  bottom: 65px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  z-index: 1000;
}

/* 빠른 AI 상담 (이미지 크기에 맞게 표시) */
.floating-icons .ai-btn img {
  height: 44px;
  width: auto;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: #fff;
  cursor: pointer;
  display: block;
}

/* 카카오톡 (동그란 아이콘) */
.floating-icons .kakao-btn img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background: #fff;
  cursor: pointer;
  display: block;
}

/* ============================
   하단 고정 패널
   ============================ */
.fixed-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #c9b7fb;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0));
  z-index: 1000;

  /* iOS 렌더링 흔들림 방지 */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* iOS 11~12 구형 사파리 fallback */
@supports (-webkit-touch-callout: none) {
  .fixed-panel {
    padding-bottom: calc(14px + constant(safe-area-inset-bottom));
  }
}

.panel-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 500;
  color: #000;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.panel-item img {
  width: 32px;
  height: 30px;
  display: block;
}

/* ============================
   맞춤비용 전체화면 팝업
   ============================ */
.cost-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: none;
}

.cost-modal[aria-hidden="false"] {
  display: block;
}

.cost-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

/* 풀스크린 시트 */
.cost-dialog {
  position: fixed;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top, 0)) 16px
    calc(16px + env(safe-area-inset-bottom, 0));
  overflow: hidden;
}

@media (min-width: 768px) {
  .cost-dialog {
    width: 560px;
    height: auto;
    max-height: calc(100dvh - 40px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  }
}

.cost-close {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top, 0));
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cost-title {
  font-size: 1.5rem;
  margin: 5px 4px 6px 0;
  letter-spacing: 0.7px;
}

.cost-desc {
  color: #777;
  margin: 0 0 18px;
}

/* 본문은 내부 스크롤 */
.cost-form {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: 12px;
}

.cost-field {
  margin-bottom: 14px;
}

.cost-field.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cost-field label {
  display: block;
  font-weight: 700;
  margin: 0 0 4px;
}

.cost-field .req {
  color: #e11d48;
}

.cost-field input,
.cost-field select {
  width: 100%;
  height: 46px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
}

.cost-field input:focus,
.cost-field select:focus {
  border-color: #111;
}

/* 인풋 우측 아이콘 */
.with-icon {
  position: relative;
}

.with-icon .icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* 동의 체크박스 */
.cost-consent {
  margin: 10px 0 6px;
}

.cost-consent .chk {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.cost-consent a {
  color: #6b7280;
  text-decoration: underline;
}

/* ===== 상담 시간 커스텀 드롭다운 ===== */
.time-select-wrapper {
  position: relative;
  width: 100%;
}

/* 보이는 선택 영역 (인풋처럼) */
.time-select-display {
  width: 100%;
  height: 46px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 36px 0 14px; /* 오른쪽 아이콘 여백 고려 */
  font-size: 16px;
  box-sizing: border-box;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  outline: none;
}

/* placeholder 스타일 */
.time-select-text {
  color: #9ca3af; /* 회색 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 값 선택 후 텍스트 색상 */
.time-select-wrapper.selected .time-select-text {
  color: #111;
}

/* 열렸을 때 보더 강조 */
.time-select-wrapper.open .time-select-display {
  border-color: #111;
}

/* 옵션 박스 */
.time-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1100;
  padding: 4px 0;
  display: none;
}

/* 열렸을 때만 표시 */
.time-select-wrapper.open .time-options {
  display: block;
}

/* 옵션 한 줄 */
.time-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 14px;
  font-size: 15px;
  cursor: pointer;
  box-sizing: border-box;
}

/* 옵션 hover / focus */
.time-option:hover,
.time-option:focus {
  background: #f3f4f6;
}

/* 스크롤바(optional, 필요 없으면 삭제 가능) */
.time-options::-webkit-scrollbar {
  width: 6px;
}
.time-options::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
}
.time-options::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================
   하단 버튼 (항상 가로 1줄)
   아이콘이 위, 텍스트가 아래
   ============================ */
.cost-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: 10px;
  margin-top: 12px;
  display: flex !important;
  gap: 10px;
}

.cost-actions a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  height: 80px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  padding: 0 10px;
  line-height: 1.2;
  word-break: keep-all;
}

@media (max-width: 360px) {
  .cost-actions a {
    font-size: 14px;
  }
}

/* 버튼 색상 */
.btn-call {
  background: #402522;
  color: #fff;
}

.btn-kakao {
  background: #fee500;
  color: #111;
}

/* 아이콘 영역: 오른쪽 여백 제거, 크기 지정 */
.cost-actions .ico {
  display: inline-flex;
  margin: 0 !important;
}

.cost-actions .ico img {
  display: block;
  width: 24px;
  height: 24px;
}

/* (과거 규칙 무력화용) */
.btn-call .ico,
.btn-kakao .ico {
  margin-right: 0 !important;
}

/* ============================
   스크롤 잠금 (모달 열릴 때)
   ============================ */
.body-locked {
  overflow: hidden;
}

/* ============================
   접근성/터치 강화 (선택)
   ============================ */
@media (hover: hover) {
  .btn-call:hover {
    filter: brightness(1.05);
  }

  .btn-kakao:hover {
    filter: brightness(0.98);
  }

  .panel-item:hover {
    opacity: 0.9;
  }
}

/* ===== 실시간 전문상담 모달 ===== */
.consult-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: block;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.consult-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

/* 반투명 배경 */
.consult-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* 바텀시트 컨테이너: 화면 하단 고정 */
.consult-dialog {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  padding: 0;
  pointer-events: none;
}

/* 시트(실제 패널) */
.consult-sheet {
  pointer-events: auto;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  padding: 22px 18px 10px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  padding-bottom: 50px;
  transform: translateY(100%);
  transition: transform 0.28s ease;
  position: relative;
}

.consult-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 22px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .consult-x:hover {
    background: rgba(0, 0, 0, 0.06);
  }
}

.consult-x:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.consult-modal[aria-hidden="false"] .consult-sheet {
  transform: translateY(0);
}

/* 그립(선택) */
.consult-grip {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  margin: 4px auto 10px;
}

.consult-title {
  font-size: 1.5rem;
  margin: 0;
  color: #111;
  letter-spacing: 0.7px;
}

.consult-desc {
  font-size: 0.9rem;
  color: #777;
  margin: 0 0 20px;
}

.consult-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 8px 0 14px;
  padding: 0 2px;
}

.consult-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 115px;
  padding: 8px 10px;
  width: 100%;
  text-decoration: none;
  background: #f6f7f9;
  color: #fff;
  font-size: 0.9rem;
}

.consult-btn img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
  margin-bottom: 10px;
}

/* 내원 진료 예약 */
.consult-btn.reserve {
  background: #ab94eb;
}

/* 전화 상담 */
.consult-btn.call {
  background: #8cb7f2;
}

/* 동일한 정사각 타일 비율 고정 */
@supports (aspect-ratio: 1) {
  .consult-modal .consult-btn {
    aspect-ratio: 1 / 1;
  }
}

.consult-hours {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 3px 0;
  font-size: 12px;
  color: #777;
  justify-items: center;
  margin: 16px 2px 16px;
  padding: 0 12px;
}

.consult-hours > div {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 2px;
  width: 100%;
}

.consult-hours > div span {
  margin-left: 4px;
}

.consult-hours strong {
  color: #666;
  font-weight: 700;
}

.consult-hours span {
  color: #777;
}

/* 시트 하단 닫기 버튼 */
.consult-close {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-top: 1px solid #eee;
  padding: 12px 6px 8px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  border-radius: 0 0 18px 18px;
}

/* 전화상담 / 카카오톡 상담 */
.popup-container,
.popup-container2 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1002;
  cursor: pointer;
}

.popup-container .popup,
.popup-container2 .popup {
  background: none;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
}

.popup-container .popup img,
.popup-container2 .popup img {
  max-width: 70%;
  border-radius: 10px;
  height: auto;
  margin: 0 auto;
}

/* 배경 스크롤 완전 차단(iOS 포함) */
html.body-locked,
body.body-locked {
  overflow: hidden !important;
  height: 100% !important;
  overscroll-behavior: none;
  touch-action: none;
}

/* iOS 고정 스크롤 보정(top: -scrollY 적용 시 필요한 고정) */
body.body-locked--fix {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

/* 모달 내부 영역은 자체 스크롤 허용 */
.cost-dialog,
.cost-form {
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ================================
    jQuery UI Datepicker 커스텀 스타일
================================ */

/* 전체 달력 박스 */
.ui-datepicker {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", Segoe UI, Roboto, Arial, sans-serif;
  border: 1px solid #e3e5ee;
  border-radius: 12px;
  padding: 8px 10px 10px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  z-index: 9999 !important; /* 다른 요소보다 위로 */
}

/* 헤더 (월/년, 이전/다음 버튼 영역) */
.ui-datepicker .ui-datepicker-header {
  background: #f5f7fb;
  border: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 8px;
  color: #222;
}

/* 월/년 텍스트 */
.ui-datepicker .ui-datepicker-title {
  font-weight: 600;
  font-size: 14px;
}

/* 이전/다음 버튼 공통 */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
}

/* 이전/다음 버튼 아이콘 */
.ui-datepicker .ui-icon {
  background-image: none !important;
}

/* 이전/다음 버튼에 화살표 직접 표시 */
.ui-datepicker .ui-datepicker-prev span::before,
.ui-datepicker .ui-datepicker-next span::before {
  display: inline-block;
  font-size: 14px;
  color: #555;
}

.ui-datepicker .ui-datepicker-prev span::before {
  content: "‹";
}

.ui-datepicker .ui-datepicker-next span::before {
  content: "›";
}

/* 요일 헤더 */
.ui-datepicker thead {
  border-bottom: 1px solid #edf0f7;
}

.ui-datepicker th {
  padding: 6px 0;
  font-weight: 500;
  color: #888;
}

/* 날짜 셀 기본 */
.ui-datepicker td {
  padding: 0;
}

/* 날짜 버튼 기본 */
.ui-datepicker .ui-state-default {
  display: block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  margin: 2px auto;
  border-radius: 8px;
  border: none;
  text-align: center;
  color: #333;
  background: transparent;
}

/* hover 시 */
.ui-datepicker .ui-state-hover {
  background: #f0f5ff;
  color: #1f3fb6;
}

/* 오늘 날짜 */
.ui-datepicker .ui-datepicker-today .ui-state-default {
  border: 1px solid #3c73ff;
  color: #1f3fb6;
  font-weight: 600;
  background: #eef3ff;
}

/* 선택된 날짜 */
.ui-datepicker .ui-state-active {
  background: #3c73ff !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(60, 115, 255, 0.35);
}

/* 이전/다음 버튼 아이콘 span 기본값 초기화 */
.ui-datepicker .ui-datepicker-prev span,
.ui-datepicker .ui-datepicker-next span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;

  text-indent: 0;
  overflow: visible;
}

/* 화살표 모양 글자 스타일 */
.ui-datepicker .ui-datepicker-prev span::before,
.ui-datepicker .ui-datepicker-next span::before {
  font-size: 28px !important;
  line-height: 1;
}

/* 작은 화면에서 달력 폭 꽉 차게 */
@media (max-width: 480px) {
  .ui-datepicker {
    width: 100% !important;
    max-width: 320px;
  }

  .ui-datepicker .ui-state-default {
    width: 30px;
    height: 30px;
    line-height: 30px;
    margin: 1px auto;
  }
}
