/**
 * 検索ハブコンポーネント（template-parts/search-hub.php）専用CSS
 *
 * 元データ: kakarte_search_component_only_v5.html（カンプ）
 * カンプの<style>は、旧バージョン（v3〜v19相当）のCSSがそのまま積み重なって残ったもの
 * （:rootの再宣言・同じセレクタの上書きが何段にも重なっている）。ここでは実際に
 * レンダリングされる最終的な値（カスケードを手動で解決した結果）だけを、無関係な
 * ページ全体のセレクタ（.header/.logo/.container/.footer/.eyebrow単体等、テーマの
 * 共通CSSと名前が重複するもの）を除いて .search-zone 配下にスコープして書き起こしている。
 *
 * 「気になる体の部位」の人体図（.body-picker/.body-map/.anatomy-/.silhouette/.organ/
 * .part-chip等）はcheckup-search-form.php向けに既にstyle_pc.cssで実装済みのため、
 * カンプ側の同名定義は完全に重複していた。ここでは追加せず、既存CSSをそのまま再利用する。
 *
 * 現時点ではUIの見た目のみを部品化したもので、中のデータ（都道府県セレクト・
 * 50音別クリニック一覧・検査カテゴリチェック等）はカンプ通りのダミーのまま。
 * 実データ連携は別タスクで行う。
 */


:root {
    --radius-panel: 13px;
    --shadow-xs: 0 3px 9px rgba(0, 143, 163, .10);
    --shadow-lg: 0 12px 28px rgba(22, 67, 91, .10);
    --focus: 0 0 0 3px rgba(0, 143, 163, .14);
    --transition-ui: .18s ease;
}

.section:has(.search-zone) {
    padding-bottom: 0;
}

.search-zone {
    padding: 42px 0 16px;
    border-top: 2px solid var(--line-strong);
    border-bottom: 2px solid #7fa9bc;
    background: linear-gradient(180deg, #f6fafc 0, #fff 300px);
    color: var(--text);
}

.search-zone.embedded-search-zone {
    padding: 28px 0;
    background: transparent;
}

.search-zone-head {
    text-align: left;
    margin-bottom: 18px;
}

.search-zone-head h2 {
    margin: 0;
    color: #0f2e58;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 900;
    letter-spacing: .01em;
}

.search-zone-head p {
    margin: 7px 0 0;
    max-width: none;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

/* --- 検索ハブ本体（4タブ切替） --- */
.search-hub {
    border: 2px solid #6f9daf;
    border-radius: var(--radius-panel);
    background: #fff;
    box-shadow: 0 16px 38px rgba(18, 48, 91, .20);
    overflow: hidden;
}

.search-hub button,
.search-hub input,
.search-hub select,
.search-hub a {
    cursor: pointer;
}

.hub-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 2px solid #6f9daf;
    background: #dcecf1;
}

.hub-tab {
    min-height: 72px;
    padding: 13px 12px;
    border: 0;
    border-right: 1px solid #d6e5eb;
    background: #e8f2f5;
    color: #25455f;
    font-weight: 900;
    font-size: 14px;
    transition: background-color var(--transition-ui), color var(--transition-ui), box-shadow var(--transition-ui);
}

.hub-tab:last-child {
    border-right: 0;
}

.hub-tab small {
    display: block;
    margin-top: 2px;
    color: #7890a2;
    font-size: 10px;
    font-weight: 700;
}

.hub-tab:hover {
    background: #d9edf1;
    color: var(--teal-dark);
    border-color: var(--teal);
}

.hub-tab.active {
    background: #fff;
    color: #005f6d;
    box-shadow: inset 0 -4px 0 var(--teal);
}

.hub-tab.active small {
    color: var(--teal-dark);
}

.hub-panel {
    display: none;
    padding: 22px;
}

.hub-panel.active {
    display: block;
}

.panel-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 15px;
}

.panel-intro h3 {
    margin: 0;
    color: #14335d;
    font-size: 18px;
}

.panel-intro p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

/* --- 地域・路線・駅から探す --- */
.combo-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.combo-field label {
    display: block;
    margin-bottom: 4px;
    color: #36556e;
    font-size: 11px;
    font-weight: 900;
}

.select-control {
    position: relative;
}

.select-control select {
    width: 100%;
    height: 42px;
    padding: 0 30px 0 11px;
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    appearance: none;
    background: linear-gradient(180deg, #fff 0, #fbfdfe 100%);
    color: var(--text);
    /* MVPでは実際のコンボボックス（文字入力＋候補）ではなく単なるプルダウンのため、
       内側が凹んで見えるinset shadowは使わない。代わりに「押せる要素」だと伝わる
       程度の軽い立体シャドウ（外側・弱め）だけを付ける（CTAのhub-goほど強くしない）。 */
    box-shadow: 0 1px 2px rgba(18, 48, 91, .08), 0 2px 5px rgba(18, 48, 91, .06);
}

.select-control::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--teal-dark);
    border-bottom: 2px solid var(--teal-dark);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.select-control select:hover {
    border-color: #91b7c7;
    box-shadow: 0 2px 4px rgba(18, 48, 91, .10), 0 3px 8px rgba(18, 48, 91, .08);
}

.select-control select:focus {
    border-color: var(--teal);
    box-shadow: var(--focus);
    outline: 0;
}

/* 都道府県を選ぶまで市区町村・路線・駅・エリアが選べないことを見た目でも伝える
   （template-parts/search-hub.php参照）。 */
.select-control select:disabled {
    background: #eef1f3;
    border-color: var(--line-strong);
    color: #9aa5ac;
    box-shadow: none;
    cursor: not-allowed;
}

.select-control:has(select:disabled)::after {
    border-color: #b7c1c8;
}

.detail-condition-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid #d8e5ec;
}

.detail-condition-copy strong {
    display: block;
    color: #14335d;
    font-size: 14px;
}

.detail-condition-copy span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
}

.detail-condition-button {
    flex: none;
    height: 42px;
    padding: 0 13px;
    border: 1.5px solid #007f91;
    border-radius: 8px;
    background: #fff;
    color: #005f6d;
    font-weight: 900;
}

.detail-condition-button:hover {
    background: var(--teal-soft);
}

.detail-condition-button .plus {
    margin-left: 8px;
    font-size: 18px;
    font-weight: 400;
}

.detail-panel {
    display: none;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #d8e5ec;
    border-radius: 9px;
    background: #f8fcfd;
}

.detail-panel.open {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.detail-field label {
    display: block;
    margin-bottom: 5px;
    color: #36556e;
    font-size: 11px;
    font-weight: 900;
}

/* select本体の見た目（枠線・矢印・シャドウ）は都道府県等と同じ.select-controlに統一済み
   （template-parts/search-hub.php参照）。ここではlabelの文字だけ扱う。 */

.hub-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 12px;
    margin-top: 15px;
}

.hub-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 68px;
    padding: 11px 14px;
    border: 1.5px solid #79adbd;
    border-radius: 10px;
    background: #f3fafc;
}

.hub-count span {
    color: #29465f;
    font-size: 11px;
    font-weight: 800;
}

.hub-count .count {
    flex-shrink: 0;
}

.hub-count b {
    color: #0b2e5d;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
}

.hub-go {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: #007f91;
    color: #fff;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(0, 143, 163, .16);
    transition: transform var(--transition-ui), box-shadow var(--transition-ui), background-color var(--transition-ui);
}

.hub-go:disabled {
    background: #c8d8df;
    box-shadow: none;
    cursor: not-allowed;
}

.hub-go:not(:disabled):hover {
    background: #006f7d;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 143, 163, .22);
}

.hub-go:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: none;
}

.box-label {
    display: block;
    margin-bottom: 8px;
    color: #36556e;
    font-size: 11px;
    font-weight: 900;
}

/* --- 検査から探す ---
   都道府県・金額上限の項目を廃止した分（ユーザー指示）、検査項目名のボックスが
   使える横幅・縦幅が増えたため、列数とmax-heightを拡張し、スクロール操作だと
   分かるよう薄いカスタムスクロールバーを付けている。 */
.exam-category-box {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #a9c4d2 #eef3f6;
}

.exam-category-box::-webkit-scrollbar {
    width: 10px;
}

.exam-category-box::-webkit-scrollbar-track {
    background: #eef3f6;
    border-radius: 999px;
}

.exam-category-box::-webkit-scrollbar-thumb {
    background: #a9c4d2;
    border-radius: 999px;
}

.exam-category-box::-webkit-scrollbar-thumb:hover {
    background: #7fa9bc;
}

.exam-category-box,
.purpose-box {
    padding: 15px;
    border: 1.5px solid #769faf;
    border-radius: 10px;
    background: #fbfdfe;
}

.exam-checks {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.exam-checks label {
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid #9fbcc8;
    border-radius: 7px;
    background: #fff;
    color: #29465f;
    font-size: 12px;
    font-weight: 800;
    transition: border-color var(--transition-ui), background-color var(--transition-ui), box-shadow var(--transition-ui), transform var(--transition-ui);
}

.exam-checks label:hover {
    border-color: var(--teal);
    background: var(--teal-soft);
    box-shadow: var(--shadow-xs);
    transform: translateY(-1px);
}

.exam-checks input {
    accent-color: var(--teal);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.std-field label {
    display: block;
    margin-bottom: 4px;
    color: #36556e;
    font-size: 11px;
    font-weight: 900;
}

/* select本体の見た目は.select-controlに統一済み（template-parts/search-hub.php参照）。
   ここでは（将来std-field内にテキスト入力が入る場合に備えて）inputだけ扱う。 */
.std-field input {
    width: 100%;
    height: 42px;
    padding: 0 10px;
    border: 1.5px solid #769faf;
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.std-field input::placeholder {
    color: #60758a;
}

.std-field input:hover {
    border-color: var(--teal);
}

.std-field input:focus {
    border-color: var(--teal);
    box-shadow: var(--focus);
    outline: 0;
}

/* --- 受けたい検査がわからない人 --- */
.purpose-layout {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 16px;
}

.purpose-layout.single-purpose {
    grid-template-columns: 1fr;
}

#hub-unknown .purpose-layout.single-purpose {
    grid-template-columns: minmax(280px, .72fr) minmax(520px, 1.28fr);
    align-items: start;
}

#hub-unknown .unknown-left-column {
    display: grid;
    gap: 14px;
    position: sticky;
    top: 92px;
}

#hub-unknown .unknown-left-column .hub-result {
    grid-template-columns: 1fr;
    margin-top: 0;
}

#hub-unknown .unknown-left-column .hub-go {
    min-height: 48px;
}

#hub-unknown .body-map {
    height: 590px;
    border-color: var(--line-strong);
}

/* style_pc.cssの.unknown-right（checkup-search-form.php側の狭い480px幅カラム用に
   人体図を88%へ縮小する指定）が、このパネルの.purpose-box.unknown-rightにも
   クラス名が同じというだけで意図せず適用され、610px超の縦の余白ができていた
   （縮小した図に対して.body-mapの高さが変わらないため）。ここではその縮小を
   打ち消し、人体図を原寸で表示することで余白を詰めている。 */
#hub-unknown .anatomy-map {
    max-width: 520px;
    transform: none;
}

#hub-unknown .part-chip {
    font-family: inherit;
}

/* --- クリニックを50音から探す --- */
#hub-index .kana-nav-v3 {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

#hub-index .kana-nav-v3 button {
    height: 42px;
    min-width: 58px;
    padding: 0 14px;
    border: 1.5px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    color: #234064;
    font-weight: 900;
    cursor: pointer;
}

#hub-index .kana-nav-v3 button:hover,
#hub-index .kana-nav-v3 button.active {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

#hub-index .kana-results-v3 {
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

#hub-index .kana-head-v3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #eef7fa;
}

#hub-index .kana-head-v3 h3 {
    margin: 0;
    color: #17375e;
    font-size: 14px;
}

#hub-index .kana-head-v3 span {
    color: #6d8198;
    font-size: 10px;
    font-weight: 800;
}

#hub-index .kana-list-v3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

#hub-index .kana-item-v3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 10px 12px 10px 14px;
    border-right: 1px solid #dfe9ee;
    border-bottom: 1px solid #dfe9ee;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

#hub-index .kana-item-v3:nth-child(even) {
    border-right: 0;
}

#hub-index .kana-item-v3:hover {
    background: #f5fbfc;
}

#hub-index .kana-name-v3 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 900;
    color: #17375e;
}

#hub-index .kana-detail-v3 {
    flex: none;
    min-width: 98px;
    height: 31px;
    border: 1.5px solid var(--teal);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 900;
    background: #fff;
}

#hub-index .kana-more-v3 {
    width: 100%;
    height: 44px;
    border: 0;
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--teal-dark);
    font-weight: 900;
    cursor: pointer;
}

#hub-index .kana-more-v3:hover {
    background: var(--teal-soft);
}

/* --- レスポンシブ --- */
@media (max-width: 1050px) {
    .combo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 980px) {

    .exam-search-grid,
    .purpose-layout {
        grid-template-columns: 1fr;
    }

    .hub-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .hub-tab:nth-child(2) {
        border-right: 0;
    }

    .hub-tab:nth-child(-n+2) {
        border-bottom: 1px solid #d6e5eb;
    }

    #hub-unknown .purpose-layout.single-purpose {
        grid-template-columns: 1fr;
    }

    #hub-unknown .unknown-left-column {
        position: static;
    }

    .exam-checks {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .search-zone {
        padding-top: 36px;
    }


    .exam-checks,
    .field-row {
        grid-template-columns: 1fr;
    }

    .hub-tabs {
        font-size: 13px;
    }

    .hub-tab {
        min-height: auto;
        border-bottom: 1px solid #d6e5eb;
    }

    .hub-tab:last-child {
        border-bottom: 0;
    }

    .hub-panel {
        padding: 16px;
    }

    .panel-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .combo-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-condition-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-condition-button {
        width: 100%;
    }

    .hub-result {
        grid-template-columns: 1fr;
    }

    .hub-go {
        height: 46px;
    }
}

@media (max-width: 640px) {
    #hub-unknown .body-map {
        height: 540px;
        padding: 10px;
    }

    #hub-unknown .anatomy-map {
        transform: scale(.82);
        transform-origin: top center;
    }
}

@media (max-width: 560px) {
    #hub-index .kana-list-v3 {
        grid-template-columns: 1fr;
    }


    #hub-index .kana-item-v3 {
        border-right: 0;
    }
}