/* Classys Hospital Finder — classys.co.kr 컨테이너(최대 1320px) 안에서 반응형 */
.chf {
  --chf-accent: #1a1a1a;
  --chf-accent-soft: rgba(0, 0, 0, 0.05);
  --chf-text: #222;
  --chf-sub: #707070;
  --chf-line: #e4e4e4;
  --chf-bg: #f8f8f8;
  --chf-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "search" "map" "results";
  width: 100%;
  margin: 0 0 12px;
  border: 1px solid var(--chf-line);
  border-radius: var(--chf-radius);
  overflow: hidden;
  background: #fff;
  color: var(--chf-text);
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.chf *, .chf *::before, .chf *::after { box-sizing: border-box; }

/* 검색 영역 */
.chf .chf__search {
  grid-area: search;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--chf-line);
  background: #fff;
}
.chf .chf__field { position: relative; flex: 1 1 0; min-width: 0; }
.chf .chf__input,
.chf .chf__sido,
.chf .chf__sigungu {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--chf-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--chf-text);
  font: inherit;
  font-size: 16px; /* iOS 입력 시 확대 방지 */
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.chf .chf__input { padding-right: 38px; }
.chf .chf__input::-webkit-search-cancel-button { display: none; }
.chf .chf__input:focus,
.chf .chf__sido:focus,
.chf .chf__sigungu:focus { border-color: var(--chf-accent); }
.chf .chf__sido,
.chf .chf__sigungu {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23707070' stroke-width='1.5' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.chf .chf__sigungu:disabled { background-color: var(--chf-bg); color: #b2b2b2; cursor: not-allowed; }
.chf .chf__clear {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--chf-sub);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.chf .chf__clear[hidden] { display: none; }
.chf .chf__locate {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--chf-accent);
  border-radius: 8px;
  background: #fff;
  color: var(--chf-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.chf .chf__locate:hover,
.chf .chf__locate:focus-visible { background: var(--chf-accent); color: #fff; }
.chf .chf__locate.is-loading svg { animation: chf-spin 1s linear infinite; }
@keyframes chf-spin { to { transform: rotate(360deg); } }
.chf .chf__filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

/* 지도 */
.chf .chf__map-wrap {
  grid-area: map;
  position: relative;
  height: clamp(280px, 72vw, 440px);
  background: var(--chf-bg);
}
.chf .chf__map { width: 100%; height: 100%; }
.chf .chf__map-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--chf-bg);
  color: var(--chf-sub);
  font-size: 14px;
  text-align: center;
}
.chf .chf__map-msg[hidden] { display: none; }

/* 목록 */
.chf .chf__results {
  grid-area: results;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--chf-line);
}
.chf .chf__count {
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--chf-line);
  background: var(--chf-bg);
  color: var(--chf-sub);
  font-size: 13px;
}
.chf .chf__count:empty { display: none; }
.chf .chf__list {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 480px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.chf .chf__item {
  position: relative;
  margin: 0;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--chf-line);
  list-style: none;
}
.chf .chf__item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: transparent;
}
.chf .chf__item.is-active { background: var(--chf-accent-soft); }
.chf .chf__item.is-active::before { background: var(--chf-accent); }
.chf .chf__item-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chf .chf__item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chf .chf__item-name { font-size: 16px; font-weight: 600; color: var(--chf-text); word-break: keep-all; }
.chf .chf__item-btn:hover .chf__item-name { color: var(--chf-accent); }
.chf .chf__item-dist { flex: 0 0 auto; color: var(--chf-accent); font-size: 13px; font-weight: 600; }
.chf .chf__item-addr { display: block; margin-top: 4px; color: var(--chf-sub); font-size: 14px; word-break: keep-all; }
.chf .chf__item-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--chf-accent);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chf .chf__empty {
  padding: 40px 16px;
  color: var(--chf-sub);
  font-size: 14px;
  text-align: center;
  list-style: none;
}

/* 지도 마커·정보창 */
.chf-pin {
  display: block;
  width: 30px;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='40' viewBox='0 0 30 40'%3E%3Cpath fill='%231a1a1a' d='M15 0C6.7 0 0 6.6 0 14.8 0 25.9 15 40 15 40s15-14.1 15-25.2C30 6.6 23.3 0 15 0z'/%3E%3Ccircle cx='15' cy='14.5' r='5.5' fill='%23fff'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
  transform-origin: 50% 100%;
  transition: transform .15s;
  cursor: pointer;
}
/* 클릭(활성) 마커: #00ff00 핀(테두리 동일색) + 흰 중심점 */
.chf-pin.is-active {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='40' viewBox='0 0 30 40'%3E%3Cpath fill='%2300ff00' stroke='%2300ff00' stroke-width='1.5' d='M15 .75C7.1.75.75 7 .75 14.8c0 10.5 14.25 24.1 14.25 24.1s14.25-13.6 14.25-24.1C29.25 7 22.9.75 15 .75z'/%3E%3Ccircle cx='15' cy='14.5' r='5.5' fill='%23fff'/%3E%3C/svg%3E");
  transform: scale(1.2);
}
.chf-me {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #00ff00;
  box-shadow: 0 0 0 6px rgba(0, 255, 0, .25), 0 1px 3px rgba(0, 0, 0, .3);
}
/* 정보창 위치: 좌표점(마커 꼭지점) 기준 가로 중앙, 활성 핀 높이 48px + 여백 8px 위 */
.chf-info-wrap {
  position: absolute;
  z-index: 200;
  transform: translate(-50%, calc(-100% - 56px));
}
.chf-info {
  position: relative;
  width: 260px;
  max-width: calc(100vw - 64px);
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  color: #222;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.chf-info *, .chf-info *::before, .chf-info *::after { box-sizing: border-box; } /* 지도 레이어는 .chf 밖이라 별도 지정 */
.chf-info__name { display: block; color: #1a1a1a; font-size: 15px; font-weight: 700; word-break: keep-all; }
.chf-info__addr { margin: 4px 0 0; color: #555; font-size: 13px; word-break: keep-all; }
.chf-info__dist { margin: 4px 0 0; color: #1a1a1a; font-size: 13px; font-weight: 600; }
/* 네이버 지도 이동 버튼 — 네이버 브랜드 그린 + 흰 바탕 N 심볼 */
.chf-info__link,
.chf-info__link:visited {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 38px;
  margin-top: 12px;
  padding: 0 12px;
  border-radius: 6px;
  background: #03c75a;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .15s;
}
.chf-info__link:hover,
.chf-info__link:focus-visible { background: #02b04f; color: #fff; text-decoration: none; }
.chf-info__nlogo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
}
.chf-info__nlogo svg, .chf-info__ext { display: block; flex: 0 0 auto; }
.chf-info__ext { opacity: .85; }

/* 태블릿·데스크톱: 목록(좌) + 지도(우) */
@media (min-width: 768px) {
  .chf .chf__search { flex-wrap: wrap; }
}
@media (min-width: 1024px) {
  .chf {
    grid-template-columns: 360px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "search map" "results map";
    height: 680px;
  }
  .chf .chf__search { border-right: 1px solid var(--chf-line); }
  .chf .chf__results { border-top: 0; border-right: 1px solid var(--chf-line); }
  .chf .chf__list { max-height: none; }
  .chf .chf__map-wrap { height: auto; }
}
@media (min-width: 1280px) {
  .chf { grid-template-columns: 400px minmax(0, 1fr); height: 720px; }
}
@media (max-width: 767px) {
  /* 모바일 좌우 여백: Elementor 칼럼 10px + 10px = 화면 끝에서 20px */
  .chf { width: auto; margin-left: 10px; margin-right: 10px; border-radius: 8px; }
  .chf .chf__search { padding: 14px; }
  .chf .chf__locate span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .chf .chf__locate { width: 44px; justify-content: center; padding: 0; }
  .chf .chf__item { padding: 14px 14px 14px 18px; }
  .chf .chf__count { padding: 12px 14px; }
}

/* 지도 하단 안내 문구 */
.chf-notice {
  margin: 0 0 4rem;
  color: #707070;
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}
@media (max-width: 767px) {
  .chf-notice { margin: 0 10px 2.5rem; font-size: 12px; }
}
