#clinic_search {
    margin-bottom: 100px;
}
#clinic_search .setsumei {
    color: #d53369;
}

/* 基本スタイル */
.clinic-search-form-container {
    max-width: 800px;
    margin: 30px auto 0;
    font-family: sans-serif;
    border-radius: 30px;
    padding: 50px;
    background: #feefd7;
}
.search-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.treatment-section, .prefecture-section {
    display: flex;
    flex-flow: column;
    width: 100%;
}
.accordion-container,
.prefecture-search-container {
    box-shadow: 0 6px 18px rgb(0 0 0 / 20%);
    transition: 0.3s;
}
.accordion-container:hover,
.prefecture-search-container:hover {
    box-shadow: 0 6px 18px rgb(0 0 0 / 40%);
}
.prefecture-section {
    margin-top: 20px;
}
.treatment-section h3,
.prefecture-section h3 {
    color: #d53369;
}

/* アコーディオンスタイル */
.accordion-container {
    border-radius: 10px;
    overflow: hidden;
}
.accordion-item {
    overflow: hidden;
}

.accordion-header {
    background-color: #d53369;
    color: #fff;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: bold;
    position: relative;
    border-bottom: 1px dashed #fff;
}
.accordion-item.active .accordion-header,
#accordion-sejutsuSection .accordion-header {
    border-bottom: none;
}

.accordion-header:after {
    content: '+';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.accordion-header span {
    background: #fff;
    min-width: 24px;
    height: 24px;
    display: inline-block;
    color: #d53369 !important;
    text-align: center;
    font-size: 14px;
    font-weight: bold !important;
    border-radius: 20px;
    line-height: 24px;
    padding: 0 6px;
    margin: 0 !important;
}

/* カウント表示のスタイル */
.accordion-header .count, .checkbox-item .count {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

.accordion-header .count {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

.accordion-item.active .accordion-header:after {
    content: '-';
}

.accordion-content {
    display: none;
    padding: 15px 15px 7px;
    background-color: #fff;
}

.accordion-item.active .accordion-content {
    display: block;
}

/* チェックボックススタイル */
.checkbox-container {
    max-height: 200px;
    overflow-y: auto;
}
#accordion-buiSection .checkbox-container,
.checkbox-container > div {
    display: flex;
    flex-flow: row;
    flex-wrap: wrap;
}
.checkbox-container > div h4 {
    width: 100%;
    font-size: 18px;
    color: #d53369;
    display: flex;
    margin-bottom: 0;
    align-items: center;
    line-height: 1.3;
    margin: 0 0 10px;
    letter-spacing: .5px;
}
.checkbox-container > div h4::after {
    content: "";
    flex-grow: 1;
    height: 1px;
    background: #d53369;
    display: block;
    margin-left: 10px;
}
.checkbox-item {
    margin: 0 8px 8px 0 !important;
}

/* チェックボックスを非表示にする */
.checkbox-item input[type="checkbox"] {
    display: none;
}

/* ラベルをボタンのようにスタイリング */
.checkbox-item label {
    display: inline-block;
    padding: 3px 6px 0 12px;
    background-color: #fff;
    border: 1px solid #333;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-weight: bold;

}
.checkbox-item label span {
    color: white !important;
    background: #333 !important;
    border-radius: 20px !important;
    min-width: 22px !important;
    height: 22px !important;
    display: inline-block !important;
    text-align: center !important;
    line-height: 22px !important;
    padding: 0 6px;
    margin: 0 !important;
    transition: all 0.3s ease;
}

/* チェックされた状態のスタイル */
.checkbox-item input[type="checkbox"]:checked ~ label,
.checkbox-item label:has(input[type="checkbox"]:checked),
.checkbox-item label:hover {
    background-color: #333;
    color: white;
    border-color: #333;
}
.checkbox-item label:has(input[type="checkbox"]:checked) span,
.checkbox-item label:hover span {
    background-color: #fff !important;
    color: #333 !important;
}
.checkbox-item span.count {
    margin-left: 0 !important;
}


/* 地域の絞り込みセクションスタイル */
.prefecture-section h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.prefecture-search-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;

}

#prefectureSearch {
    width: 100%;
    padding: 8px;
    margin-bottom: 0;
    border: 2px solid #d53369;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    color: #000;
}
#prefectureSearch::placeholder {
    color: #000;
}

.prefecture-select-container {
    position: relative;
    border: none;
}

.selected-prefectures {
}

.selected-prefecture {
    display: inline-block;
    background-color: #333;
    color: #fff;
    font-weight: bold;
    padding: 2px 10px 2px 12px;
    margin: 0 8px 8px 0;
    border-radius: 30px;
    font-size: 0.9em;
}
.selected-prefecture span.count {
    display: none;
}
.selected-prefecture .remove {
    margin-left: 2px;
    cursor: pointer;
    color: #fff;
}

.prefecture-dropdown {
    max-height: 400px;
    overflow-y: auto;
    background-color: #fff;
    /* スクロールバーのスタイリング */
    scrollbar-width: 20px;
    scrollbar-color: #fff #d53369;
    padding: 0 !important;
}

/* Webkit（Chrome、Safari、Edge）用のスクロールバースタイル */
.prefecture-dropdown::-webkit-scrollbar {
    width: 20px;
}

.prefecture-dropdown::-webkit-scrollbar-track {
    background: #fff;
    border: none;
}

.prefecture-dropdown::-webkit-scrollbar-thumb {
    background-color: #d53369;
    border-radius: 0; /* 四角いスクロールバー */
    border: none;
}
/* チェックボックスのスタイル */
.prefecture-group label {
    display: flex;
    align-items: center;
    column-gap: 4px;
    width: fit-content;
    line-height: 1;
    cursor: pointer;
}

.prefecture-group label:not(:last-of-type) {
    margin-bottom: 16px;
}

.prefecture-group input,
.prefecture-parent-checkbox,
.prefecture-checkbox {
    appearance: none;
    position: relative;
    width: 18px;
    height: 18px;
    border: 1px solid #fff;
    border-radius: 2px;
    cursor: pointer;
    margin-right: 5px;
}

.prefecture-children input {
    border: 1px solid #333;
}

.prefecture-group input:checked,
.prefecture-parent-checkbox:checked,
.prefecture-checkbox:checked {
    background-color: #333;
}

.prefecture-group input:checked::after,
.prefecture-parent-checkbox:checked::after,
.prefecture-checkbox:checked::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 3px;
    width: 10px;
    height: 5px;
    border-bottom: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    transform: rotate(-45deg);
}
.prefecture-parent {
    font-weight: bold;
    padding: 5px 10px;
    background-color: #d53369;
    color: #fff;
    cursor: pointer;
    position: relative;
    border-bottom: 1px dashed #fff;
}
.prefecture-dropdown > .prefecture-group:last-child .prefecture-parent {
    border-bottom: unset;
}
.prefecture-parent.open {
    border-color: #d53369;
}
.prefecture-parent:after {
    content: '+';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.prefecture-parent.open:after {
    content: '-';
}
.prefecture-parent span {
    background: #fff;
    color: #d53369;
    padding: 0 6px 1px;
    border-radius: 10px;
    height: 20px;
    display: inline-block;
    text-align: center;
    line-height: 20px;
}
.prefecture-children {
    display: flex;
    flex-flow: row;
    flex-wrap: wrap;
    padding: 10px 10px 2px;
    display: none;
}
.prefecture-children span {
    border: 1px solid #999;
    padding: 0 6px 1px;
    border-radius: 10px;
    height: 20px;
    display: inline-block;
    text-align: center;
    line-height: 17px;
    position: relative;
    top: -1px;
}

/* 親カテゴリーが開いている場合は、JavaScriptで子カテゴリーを表示する */

.no-children {
    color: #999;
    font-style: italic;
    padding: 5px 0;
}

.prefecture-child {
    padding: 0 15px 8px 0;
}

/* 件数表示のスタイル */
.count {
    font-size: 0.85em;
    font-weight: normal;
}

/* 検索結果のハイライト */
/*
.search-highlight {
    background-color: rgba(255, 255, 0, 0.2);
}
*/

/* チェックボックスのスタイル */
.search-buttons {
    display: flex;
    flex-flow: row;
    justify-content: center;
    margin-top: 50px;
}
.search-button,
.reset-button {
    display: flex;
    flex-flow: row;
    justify-content: center;
    width: 150px;
    height: 40px;
    border-radius: 20px;
    line-height: 38px;
    letter-spacing: 1.5px;
    text-align: center;
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    padding: 0;
    margin: 0 10px;
    box-shadow: 0 6px 18px rgb(0 0 0 / 20%);
    position: relative;
    overflow: hidden;
    transition: 0.3s;
}
.search-button {
    background: #f90 !important;
    background: linear-gradient(135deg, #f90 0, #d53369 100%) !important;
}
.reset-button {
    background: #fff !important;
    color: #d53369 !important;
}
.search-button:hover,
.reset-button:hover {
    box-shadow: 0 6px 18px rgb(0 0 0 / 40%);
    transform: translateY(-4px);
}


/* レスポンシブ対応 */
@media (max-width: 991px) {
    .prefecture-dropdown {
        max-height: 247px;
    }
}
@media (max-width: 779px) {
    .clinic-search-form-container {
        padding: 20px;
    }
    .search-buttons {
        margin-top: 30px;
    }
}
@media (max-width: 768px) {
    .search-sections {
        flex-direction: column;
    }
}