/* =========================================================
   덴티움 우리동네 치과찾기 & 임플란트 알아보기
   공통 스타일시트 (모바일 퍼스트 반응형)
   ========================================================= */

:root {
    /* ---- 덴티움 공식 브랜드 톤 (streaming.dentium.com 기준으로 폰트·색채 통일) ---- */
    --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", system-ui, "Noto Sans KR", sans-serif;
    --black: #080905;
    --ink: #16171a;
    --ink-2: #5c5d63;
    --ink-3: #8c8d93;
    --line: #e7e7ea;
    --parchment: #f4f5f2;
    --lime: #acc90e;
    --lime-bright: #c4e41c;
    --lime-deep: #5c7003;
    --lime-tint: #f1f5d6;
    --info: #1a7fd4;
    --info-deep: #0d5ba8;
    --info-tint: #e7f2fb;
    --warn: #c2410c;
    --warn-bg: #fff6ed;
    --r-lg: 22px;
    --r-md: 16px;
    --r-sm: 10px;
    --r-pill: 999px;
    --shadow-soft: 0 2px 10px rgba(8, 9, 5, .08);
    --shadow-deep: 0 24px 60px -20px rgba(8, 9, 5, .34), 0 4px 14px -6px rgba(8, 9, 5, .1);

    /* ---- 기존 컴포넌트가 참조하는 별칭: 값만 위 브랜드 톤으로 맞춤 (구조 변경 없음) ---- */
    --navy: var(--ink);
    --navy-light: #2a2b30;
    --green: var(--lime);
    --green-dark: var(--lime-deep);
    --green-tint: var(--lime-tint);
    --gold: var(--lime-bright);
    --gold-dark: var(--lime-deep);
    --accent-red: var(--warn);
    --accent-blue: var(--info);
    --text: var(--ink);
    --text-muted: var(--ink-2);
    --border: var(--line);
    --bg: var(--parchment);
    --white: #ffffff;
    --radius: var(--r-md);
    --radius-sm: var(--r-sm);
    --shadow: var(--shadow-soft);
    --shadow-lg: var(--shadow-deep);
    --container-max: 1180px;
    --header-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-h);
    padding-bottom: 64px; /* 모바일 하단 고정 치과찾기 바 여백 */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 0; margin: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================================
   버튼 공통
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    white-space: nowrap;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--green); color: var(--ink); }
.btn--primary:hover { background: var(--green-dark); }
.btn--dark { background: #ebebeb; color: var(--ink); }
.btn--dark:hover { background: #dcdcdc; }
.btn--dark.btn--block { background: #acc90e; color: var(--white); }
.btn--dark.btn--block:hover { background: var(--lime-deep); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-dark); }
.btn--outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }
.btn--block { width: 100%; }

/* =========================================================
   헤더 / 네비게이션
   ========================================================= */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--white);
    z-index: 200;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo { display: flex; align-items: baseline; gap: 6px; line-height: 1.1; color: var(--ink); white-space: nowrap; min-width: 0; }
.logo__mark { font-size: 1.25rem; font-weight: 800; letter-spacing: .5px; color: var(--ink); }
.logo__mark--footer { color: var(--navy); font-size: 1.1rem; }
.logo__sub { font-size: .78rem; color: rgba(22, 23, 26, .72); font-weight: 600; }
@media (max-width: 360px) {
    .logo__mark { font-size: 1.05rem; }
    .logo__sub { font-size: .68rem; }
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 40px;
    background: transparent;
    border: none;
    padding: 0;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 0 auto; border-radius: 2px; }

.primary-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--navy-light);
    display: none;
    flex-direction: column;
    padding: 8px 20px 20px;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
}
.primary-nav.is-open { display: flex; }

.primary-nav__list { display: flex; flex-direction: column; }
.primary-nav__link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    color: var(--white);
    padding: 14px 4px;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.dropdown-toggle svg { transition: transform .2s ease; color: var(--white); }
.has-dropdown.is-open .dropdown-toggle svg { transform: rotate(180deg); }

.dropdown-menu {
    display: none;
    flex-direction: column;
    padding: 4px 0 8px 12px;
}
.has-dropdown.is-open .dropdown-menu { display: flex; }
.dropdown-menu a {
    color: rgba(255,255,255,.82);
    padding: 10px 4px;
    font-size: .92rem;
}
.dropdown-menu a.is-active, .dropdown-menu a:hover { color: var(--green); }

.nav-cta {
    margin-top: 16px;
    align-self: flex-start;
}

@media (min-width: 992px) {
    body { padding-bottom: 0; }
    .site-header__inner { position: relative; }
    .nav-toggle { display: none; }
    .primary-nav {
        display: flex !important;
        position: static;
        flex-direction: row;
        align-items: center;
        background: transparent;
        padding: 0;
        max-height: none;
        overflow: visible; /* 모바일 규칙의 overflow-y:auto가 남아있으면 드롭다운이 잘려 보이지 않음 */
        gap: 28px;
    }
    .primary-nav__list { flex-direction: row; gap: 28px; }
    .primary-nav__link {
        width: auto;
        border-bottom: none;
        padding: 8px 2px;
        color: rgba(22, 23, 26, .82);
    }
    .primary-nav__link:hover { color: var(--ink); }
    .dropdown-toggle svg { color: var(--ink); }
    .has-dropdown { position: relative; }
    .dropdown-menu {
        position: absolute;
        top: 100%; left: 50%;
        transform: translateX(-50%);
        background: var(--white);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-lg);
        padding: 10px;
        min-width: 220px;
        display: none;
    }
    .has-dropdown:hover .dropdown-menu,
    .has-dropdown.is-open .dropdown-menu { display: flex; }
    .dropdown-menu a { color: var(--text); border-radius: 6px; padding: 10px 12px; }
    .dropdown-menu a:hover, .dropdown-menu a.is-active { background: var(--green-tint); color: var(--green-dark); }
    .nav-cta { margin-top: 0; }
}

/* =========================================================
   플로팅 "우리 동네 치과 찾기" 버튼
   ========================================================= */
.floating-clinic-btn {
    position: fixed;
    z-index: 190;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    background: var(--green);
    color: var(--ink);
    font-weight: 800;
    font-size: .95rem;
    box-shadow: 0 -4px 14px rgba(0,0,0,.12);
}
.floating-clinic-btn__text { display: none; }
body.page-clinics .floating-clinic-btn { display: none; }

@media (min-width: 992px) {
    .floating-clinic-btn {
        left: auto; right: 20px; bottom: 90px;
        top: auto;
        width: 84px; height: 84px;
        border-radius: 50%;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
    }
    .floating-clinic-btn__text {
        display: block;
        font-size: .72rem;
        line-height: 1.25;
        text-align: center;
    }
}

/* =========================================================
   배너 헤더 (초록색) - 각 콘텐츠 페이지 상단
   ========================================================= */
.page-banner {
    background: var(--lime);
    color: var(--white);
    padding: 18px 0;
    text-align: center;
    font-weight: 800;
    font-size: 1.05rem;
}
.page-banner__sub { display: block; font-weight: 500; font-size: .82rem; margin-top: 4px; opacity: .85; }

.page-hero {
    padding: 32px 0 8px;
}
.page-hero__eyebrow {
    display: inline-block;
    background: var(--navy);
    color: var(--white);
    font-size: .75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.page-hero h1 { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
.page-hero p { margin-top: 8px; color: var(--text-muted); font-size: .95rem; }

@media (min-width: 768px) {
    .page-hero h1 { font-size: 2.1rem; }
}

/* =========================================================
   섹션 / 카드 공통
   ========================================================= */
.section { padding: 28px 0; }
.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 14px;
}
.section-title small {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 576px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) {
    .card-grid--3 { grid-template-columns: repeat(3, 1fr); }
    .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
    .card-grid--4 { grid-template-columns: repeat(4, 1fr); }
    .card-grid--5 { grid-template-columns: repeat(5, 1fr); }
    .card-grid--6 { grid-template-columns: repeat(3, 1fr); }
}

.stat-card { text-align: center; padding: 24px 16px; }
.stat-card__num { font-size: 2.1rem; font-weight: 800; color: var(--green-dark); display: block; }
.stat-card__num.red { color: var(--accent-red); }
.stat-card__num.blue { color: var(--accent-blue); }
.stat-card__label { color: var(--text-muted); font-size: .88rem; margin-top: 4px; display: block; }

.icon-badge {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--green-tint);
    color: var(--green-dark);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    font-size: 1.4rem;
}

/* =========================================================
   표 (모바일 카드형 스택)
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.compare-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: center; font-size: .9rem; }
.compare-table thead th { background: var(--navy); color: var(--white); font-weight: 700; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; font-weight: 700; }

@media (max-width: 575px) {
    table.compare-table.stack-mobile thead { display: none; }
    table.compare-table.stack-mobile, table.compare-table.stack-mobile tbody, table.compare-table.stack-mobile tr, table.compare-table.stack-mobile td { display: block; width: 100%; }
    table.compare-table.stack-mobile tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; padding: 6px 0; }
    table.compare-table.stack-mobile td { text-align: left; border-bottom: none; padding: 6px 14px; }
    table.compare-table.stack-mobile td::before { content: attr(data-label); display: block; font-size: .72rem; color: var(--text-muted); font-weight: 700; margin-bottom: 2px; }
}

/* =========================================================
   하단 CTA 바 (노란색) - 콘텐츠 페이지 공통
   ========================================================= */
.bottom-cta {
    background: var(--gold);
    margin-top: 12px;
}
.bottom-cta__inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 16px 20px;
}
.bottom-cta__text { font-weight: 800; color: var(--ink); font-size: .95rem; }
@media (min-width: 768px) {
    .bottom-cta__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* =========================================================
   타임라인 (임플란트 치료과정)
   ========================================================= */
.timeline { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 768px) { .timeline { grid-template-columns: repeat(4, 1fr); } }
.timeline__step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
}
.timeline__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--navy); color: var(--white); font-weight: 800; font-size: .85rem;
    margin-bottom: 10px;
}
.timeline__title { font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.timeline__duration { display: inline-block; font-size: .75rem; color: var(--green-dark); background: var(--green-tint); padding: 2px 8px; border-radius: 999px; margin-bottom: 8px; }
.timeline__desc { font-size: .88rem; color: var(--text-muted); }

/* =========================================================
   체크리스트
   ========================================================= */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist label {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: .92rem; cursor: pointer;
}
.checklist input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--green-dark); }

/* =========================================================
   자가체크 퀴즈 (건강보험 임플란트)
   ========================================================= */
.quiz-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; max-width: 560px; margin: 0 auto; }
.quiz-progress { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.quiz-progress__bar { height: 100%; width: 0%; background: var(--green); transition: width .3s ease; }
.quiz-step { display: none; }
.quiz-step.is-active { display: block; }
.quiz-step__q { font-weight: 800; color: var(--navy); font-size: 1.05rem; margin-bottom: 14px; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-options button {
    width: 100%; text-align: left;
    background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 16px; font-size: .95rem; font-weight: 600;
    transition: border-color .15s, background .15s;
}
.quiz-options button:hover, .quiz-options button:focus-visible { border-color: var(--green); background: var(--green-tint); }
.quiz-result { text-align: center; }
.quiz-result__icon { font-size: 2.4rem; margin-bottom: 8px; }
.quiz-result__msg { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.quiz-result__note { font-size: .82rem; color: var(--text-muted); margin-bottom: 18px; }
.quiz-result__actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 480px) { .quiz-result__actions { flex-direction: row; justify-content: center; } }

/* =========================================================
   FAQ 탭 + 아코디언
   ========================================================= */
.faq-tabs { display: flex; overflow-x: auto; gap: 8px; margin-bottom: 16px; padding-bottom: 4px; }
.faq-tabs button {
    flex: 0 0 auto;
    background: var(--white); border: 1.5px solid var(--border); border-radius: 999px;
    padding: 9px 18px; font-weight: 700; font-size: .88rem; color: var(--text-muted);
    white-space: nowrap;
}
.faq-tabs button.is-active { background: #ebebeb; color: var(--ink); border-color: #ebebeb; }

.faq-panel { display: none; flex-direction: column; gap: 10px; }
.faq-panel.is-active { display: flex; }

.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.faq-item__q {
    width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: none; border: none; text-align: left; font-weight: 700; color: var(--text);
}
.faq-item__q .q-mark { color: var(--green-dark); font-weight: 800; margin-right: 6px; }
.faq-item__q svg { flex-shrink: 0; transition: transform .2s ease; color: var(--text-muted); }
.faq-item.is-open .faq-item__q svg { transform: rotate(180deg); }
.faq-item__a { display: none; padding: 0 16px 16px 40px; font-size: .9rem; color: var(--text-muted); }
.faq-item.is-open .faq-item__a { display: block; }

/* =========================================================
   우리동네 치과찾기 페이지
   ========================================================= */
.clinic-search { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.clinic-search__grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 768px) { .clinic-search__grid { grid-template-columns: repeat(4, 1fr); } }
.clinic-search select, .clinic-search input[type="text"] {
    width: 100%; padding: 11px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--white); font-size: .92rem;
}
.clinic-search__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.clinic-layout { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
@media (min-width: 992px) { .clinic-layout { grid-template-columns: 1fr 1fr; align-items: start; } }

.clinic-map {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.mock-map {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background:
        linear-gradient(135deg, var(--parchment) 0%, var(--lime-tint) 100%);
    border: 1px solid var(--border);
}
.mock-map__grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(22,35,63,.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(22,35,63,.06) 1px, transparent 1px);
    background-size: 32px 32px;
}
.mock-map__notice {
    position: absolute; top: 10px; left: 10px; right: 10px;
    background: rgba(255,255,255,.9);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: .72rem;
    color: var(--text-muted);
}
.mock-map__pin {
    position: absolute;
    transform: translate(-50%, -100%);
    display: flex; flex-direction: column; align-items: center;
    cursor: pointer;
}
.mock-map__pin svg { filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.mock-map__pin.is-active svg path { fill: var(--accent-red); }
.mock-map__pin .pin-label {
    margin-top: 2px; font-size: .68rem; font-weight: 700; color: var(--navy);
    background: rgba(255,255,255,.9); padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.mock-map__pin.is-me svg path { fill: var(--accent-blue); }

.clinic-count { font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.clinic-list { display: flex; flex-direction: column; gap: 12px; max-height: 640px; overflow-y: auto; padding-right: 2px; }
.clinic-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: border-color .15s, box-shadow .15s; }
.clinic-card.is-highlight { border-color: var(--green); box-shadow: var(--shadow); }
.clinic-card__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.clinic-card__name { font-weight: 800; color: var(--navy); font-size: 1.02rem; }
.clinic-card__distance { font-size: .82rem; font-weight: 700; color: var(--green-dark); background: var(--green-tint); padding: 2px 9px; border-radius: 999px; }
.clinic-card__addr { font-size: .85rem; color: var(--text-muted); margin: 6px 0 8px; }
.clinic-card__tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.clinic-card__tags span { font-size: .74rem; color: var(--accent-blue); background: var(--info-tint); padding: 3px 9px; border-radius: 999px; }
.clinic-card__actions { display: flex; gap: 8px; }
.clinic-card__actions .btn { flex: 1; }
.clinic-empty { text-align: center; color: var(--text-muted); padding: 40px 10px; font-size: .9rem; }

.partner-note {
    margin-top: 22px;
    background: var(--navy);
    color: var(--white);
    border-radius: var(--radius);
    padding: 20px;
}
.partner-note h3 { color: var(--green); font-size: 1.02rem; margin-bottom: 6px; }
.partner-note p { font-size: .88rem; opacity: .9; }

/* =========================================================
   홈 허브 페이지
   ========================================================= */
.hub-hero {
    background: var(--lime);
    color: var(--white);
    padding: 48px 0 40px;
    text-align: center;
}
.hub-hero h1 { font-size: 1.7rem; font-weight: 800; }
.hub-hero p { margin-top: 10px; color: rgba(255, 255, 255, .9); font-size: .95rem; }
@media (min-width: 768px) { .hub-hero h1 { font-size: 2.3rem; } }

.hub-track { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: -26px; position: relative; z-index: 2; }
@media (min-width: 768px) { .hub-track { grid-template-columns: 1fr 1fr; } }
.hub-track__card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 24px; }
.hub-track__card h2 { font-size: 1.15rem; color: var(--navy); font-weight: 800; margin-bottom: 6px; }
.hub-track__card p { font-size: .88rem; color: var(--text-muted); margin-bottom: 14px; }

.hub-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.hub-menu-grid a {
    display: block; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; font-size: .84rem; font-weight: 700; color: var(--navy); text-align: center;
}
.hub-menu-grid a:hover { border-color: var(--green); color: var(--green-dark); }

/* utility */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mb-24 { margin-bottom: 24px; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
