/**
 * Filter Form Styles
 *
 * @package ChoiEsAddon
 */

.cea-filter-order {
    margin-bottom: 1.5rem;
}

/* フォーム全体 */
.cea-filter-form {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    gap: 0;
}

/* タイトル */
.cea-filter-form__title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #666;
    padding: 10px 8px 8px;
}

.cea-filter-form__title-icon {
    font-size: 24px;
    line-height: 16px;
    color: #fff;
}

.cea-filter-form__title-text {
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

/* ボタンエリア */
.cea-filter-form__buttons {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 15px;
    flex: 1;
    border: 1px solid #afafaf;
    background: #f2f2f2;
    padding: 24px;
    justify-content: space-between;
}

.cea-filter-form__buttons-filter-wrapper {
    display: flex;
    flex: 1 1 auto;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* ボタングループ */
.cea-filter-form__button-group {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-width: 120px;
    height: 100%;
    justify-content: center;
}

.cea-filter-form__button {
    position: relative;
    background: #e3f9fe;
    border: 1px solid #316fb8;
    border-radius: 4px;
    padding: .25rem 20px;
    font-size: 16px;
    font-weight: 600;
    color: #316fb8;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

.cea-filter-form__button:hover {
    background: #d0f0fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(49, 111, 184, 0.2);
}

.cea-filter-form__button:active {
    transform: translateY(0);
}

.cea-filter-form__button-group--submit {
    flex-shrink: 0;
}

/* 検索ボタン */
.cea-filter-form__submit-button {
    background: #3270bb;
    border: none;
    border-radius: 4px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(50, 112, 187, 0.3);
    min-width: 150px;
    height: 100%;
    max-height: 65px;
    justify-content: center;
}

.cea-filter-form__submit-button:hover {
    background: #2a5fa0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 112, 187, 0.5);
}

.cea-filter-form__submit-button:active {
    transform: translateY(0);
}

.cea-filter-form__submit-button i {
    font-size: 18px;
}

/* 選択内容表示 */
.cea-filter-selection {
    display: none;
    /* padding: 8px 12px; */
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    text-align: center;
    word-break: break-all;
}

/* モーダル */
.cea-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cea-filter-modal.is-active {
    display: flex;
}

.cea-filter-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.cea-filter-modal__content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

/* エリアモーダルのみ固定高さ */
#area-modal .cea-filter-modal__content {
    height: max(450px, 60vh);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cea-filter-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cea-filter-modal__title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin: 0 !important;
}

.cea-filter-modal__close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cea-filter-modal__close:hover {
    background: #f5f5f5;
    color: #333;
}

.cea-filter-modal__body {
    padding: 25px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cea-filter-modal__footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cea-filter-modal__reset {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cea-filter-modal__reset:hover {
    background: #f5f5f5;
    border-color: #999;
    transform: translateY(-2px);
}

.cea-filter-modal__apply {
    background: #3270bb;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(50, 112, 187, 0.3);
}

.cea-filter-modal__apply:hover {
    background: #2a5fa0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(50, 112, 187, 0.5);
}

/* エリアタブ */
.cea-area-tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.cea-area-tabs__nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

/* .cea-area-tabs__nav::-webkit-scrollbar {
    height: 6px;
}

.cea-area-tabs__nav::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #7dd3fc 0%, #0ea5e9 100%);
    border-radius: 3px;
}

.cea-area-tabs__nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #67e8f9 0%, #0284c7 100%);
} */

.cea-area-tabs__tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 0;
}

.cea-area-tabs__tab:hover {
    color: #667eea;
    background: #f5f5f5;
}

.cea-area-tabs__tab.is-active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: #f0f0f0;
}

.cea-area-tabs__content {
    padding: 20px 0;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.cea-area-tabs__panel {
    display: none;
}

.cea-area-tabs__panel.is-active {
    display: block;
}

.cea-area-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.cea-area-checkboxes__item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
    border: 1px solid #e0e0e0;
}

.cea-area-checkboxes__item:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.cea-area-checkboxes__item input {
    cursor: pointer;
}

.cea-area-checkboxes__item input:checked + span {
    color: #667eea;
    font-weight: 600;
}

.cea-area-checkboxes__item span {
    font-size: 14px;
    color: #555;
}

/* 口コミ数セレクト */
.cea-review-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cea-review-select label {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.cea-review-select__wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cea-review-select__input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex: 0 0 auto;
    min-width: 120px;
}

.cea-review-select__input:hover,
.cea-review-select__input:focus {
    border-color: #667eea;
    outline: none;
}

.cea-review-select__suffix {
    font-size: 16px;
    font-weight: 500;
    color: #555;
}

/* スライダーラッパー */
.cea-slider-wrapper {
    padding: 20px 0;
}

.cea-slider-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cea-slider {
    margin: 20px 0;
}

/* noUiSliderカスタマイズ */
.cea-slider .noUi-connect {
    background: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%);
}

.cea-slider .noUi-handle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 3px solid #0ea5e9;
    background: #fff;
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
    cursor: pointer;
}

.cea-slider .noUi-handle:before,
.cea-slider .noUi-handle:after {
    display: none;
}

.cea-slider .noUi-handle:hover {
    transform: scale(1.1);
}

.cea-slider .noUi-handle:active {
    transform: scale(0.95);
}

/* 表示順・フィルターセクション */
.cea-sorting-section {
    max-width: 1200px;
    margin: 20px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cea-sorting-section__left {
    flex: 0 0 auto;
}

.cea-sorting-section__checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    user-select: none;
}

.cea-sorting-section__checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #316fb8;
    border-radius: 4px;
    background: #e3f9fe;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cea-sorting-section__checkbox:hover {
    background: #d0f0fa !important;
    border-color: #2a5fa0;
    transform: scale(1.05);
}

.cea-sorting-section__checkbox:checked {
    background: #3270bb;
    border-color: #3270bb;
}

.cea-sorting-section__checkbox:checked:hover {
    background: #2a5fa0 !important;
}

.cea-sorting-section__checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 1px;
    width: 8px;
    height: 13px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cea-sorting-section__checkbox-label span {
    line-height: 1.4;
}

.cea-sorting-section__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.cea-sorting-section__label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Wrapper for select with icon */
.cea-sorting-section__select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 180px;
}

.cea-sorting-section__select {
    width: 100%;
    padding: 0.25rem 35px 0.25rem 20px;
    border: 1px solid #316fb8 !important;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #316fb8;
    background: #e3f9fe !important;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
}

.cea-sorting-section__select:hover {
    background: #d0f0fa;
    box-shadow: 0 4px 8px rgba(49, 111, 184, 0.2);
}

.cea-sorting-section__select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(49, 111, 184, 0.1);
}

.cea-sorting-section__select:active {
    transform: translateY(0);
}

/* Icon font for dropdown arrow */
.cea-sorting-section__select-wrapper::after {
    content: "\e900"; /* icon-chevron-down */
    font-family: 'iconmeta';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 18px;
    color: #316fb8;
    transition: all 0.3s ease;
}

.cea-sorting-section__select-wrapper.is-open::after {
    content: "\e90b"; /* icon-chevron-up */
}

/* レスポンシブ */
@media (max-width: 768px) {
    .cea-filter-order {
        padding: 0 10px;
    }

    /* フォーム全体を縦方向に */
    .cea-filter-form {
        flex-direction: column;
    }

    /* タイトルを横書きに */
    .cea-filter-form__title {
        flex-direction: row;
        padding: 8px 1rem;
        justify-content: center;
        gap: 10px;
    }

    .cea-filter-form__title-icon {
        margin-bottom: 0;
        font-size: 20px;
    }

    .cea-filter-form__title-text {
        font-size: 16px;
        writing-mode: horizontal-tb;
        text-orientation: initial;
    }

    /* ボタンエリアを2列グリッドに */
    .cea-filter-form__buttons-filter-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 100%;
    }

    .cea-filter-form__buttons {
        flex-direction: column;
        gap: 15px;
    }

    .cea-filter-form__button-group {
        width: 100%;
        min-width: auto;
    }

    .cea-filter-form__submit-button {
        padding: 12px 16px;
    }

    /* 検索ボタンを全幅に */
    .cea-filter-form__button-group--submit {
        grid-column: 1 / -1;
    }

    .cea-filter-form__button,
    .cea-filter-form__submit-button {
        width: 100%;
        justify-content: center;
    }

    .cea-filter-modal__content {
        width: 95%;
        max-height: 90vh;
    }

    #area-modal .cea-filter-modal__content {
        height: 70vh;
    }

    .cea-area-checkboxes {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .cea-sorting-section {
        flex-direction: column;
        align-items: flex-end;
        gap: 15px;
    }

    .cea-sorting-section__left {
        align-self: flex-end;
    }

    .cea-sorting-section__right {
        width: 100%;
        justify-content: flex-end;
    }

    .cea-sorting-section__select-wrapper {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .cea-filter-modal__header {
        padding: 15px 20px;
    }

    .cea-filter-modal__title {
        font-size: 18px;
    }

    .cea-filter-modal__body {
        padding: 20px;
    }

    #budget-modal .cea-filter-modal__body,
    #age-modal .cea-filter-modal__body,
    #height-modal .cea-filter-modal__body {
        padding: 20px 48px;
    }

    .cea-area-tabs__tab {
        padding: 10px 15px;
        font-size: 14px;
    }

    .cea-area-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .cea-slider-values {
        font-size: 16px;
    }
}
