/**
 * 検索絞り込みパネル用スタイル
 * ヘッダー検索の絞り込みボタン・パネル（PC/スマホ対応）
 * サイトカラー: #1e5a9c
 */

/* ===== 絞り込みボタン ===== */
.search-filter-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0.3rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    transition: all 0.2s ease;
}
.search-filter-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e5a9c;
}
.search-filter-btn i {
    font-size: 1.1rem;
}

/* ===== 絞り込みパネル全体 ===== */
.search-filter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #1e5a9c;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(30, 90, 156, 0.15);
    z-index: 1050;
    max-height: 72vh;
    overflow: hidden;
    flex-direction: column;
}
.search-filter-panel.show {
    display: flex;
}

/* ===== パネルヘッダー ===== */
.search-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    border-radius: 7px 7px 0 0;
}
.search-filter-panel-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #334155;
}
.search-filter-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* ヘッダー内クリアボタン */
.search-filter-panel-header .search-filter-clear {
    font-size: 0.78rem;
    padding: 0.2rem 0.65rem;
    background: transparent;
    border: 1px solid #cbd5e1;
    color: #64748b;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
}
.search-filter-panel-header .search-filter-clear:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}
.search-filter-panel-close {
    padding: 0.25rem;
    font-size: 0.875rem;
}

/* ===== パネルボディ ===== */
.search-filter-panel-body {
    padding: 0.5rem 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* ===== アコーディオン ===== */
.sf-accordion {
    border-bottom: 1px solid #e8eef6;
}
.sf-accordion:last-of-type {
    border-bottom: none;
}
.sf-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e5a9c;
    text-align: left;
    transition: background 0.15s ease;
}
.sf-accordion-trigger:hover {
    background: #f0f5fb;
}
.sf-accordion-trigger[aria-expanded="true"] {
    background: #f0f5fb;
    border-left: 3px solid #1e5a9c;
    padding-left: calc(1rem - 3px);
}
.sf-accordion-trigger i.sf-accordion-arrow {
    font-size: 0.8rem;
    color: #1e5a9c;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.sf-accordion-trigger[aria-expanded="true"] i.sf-accordion-arrow {
    transform: rotate(180deg);
}
.sf-accordion-body {
    display: none;
    padding: 0 0.75rem 0.75rem;
    background: #f8fbff;
}
.sf-accordion-body.open {
    display: block;
}

/* ===== ドリルダウン共通 ===== */
.search-filter-drilldown {
    max-height: 220px;
    overflow-y: auto;
    border-radius: 6px;
}
.search-filter-drilldown-level.d-none {
    display: none !important;
}
.search-filter-drilldown-back {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.4rem 0.75rem;
    margin-bottom: 0.35rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: #1e5a9c;
    background: #e8eef6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.search-filter-drilldown-back:hover {
    background: #d0dff0;
}
.search-filter-drilldown-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.search-filter-drilldown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    transition: background 0.15s ease, color 0.15s ease;
    color: #334155;
}
.search-filter-drilldown-item:hover {
    background: #e8eef6;
    color: #1e5a9c;
}
.search-filter-drilldown-item.active {
    background: #dbeafe;
    color: #1e5a9c;
    font-weight: 600;
}
.search-filter-drilldown-item i {
    font-size: 0.72rem;
    color: #1e5a9c;
    flex-shrink: 0;
}

/* ドリルダウン チェックボックス＋ラベル */
.sf-drilldown-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto; /* 幅をコンテンツ分だけに縮める → 残りが余白クリック領域になる */
    cursor: pointer;
    max-width: calc(100% - 1.5rem); /* 矢印分を除いた最大幅 */
}
.sf-drilldown-check {
    width: 1rem;
    height: 1rem;
    accent-color: #1e5a9c;
    cursor: pointer;
    flex-shrink: 0;
}
.sf-drilldown-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 矢印（子あり項目のインジケーター） */
.sf-drilldown-arrow {
    font-size: 0.72rem;
    color: #94a3b8;
    flex-shrink: 0;
    margin-left: 0.25rem;
    pointer-events: none; /* 行全体でクリックを受けるため矢印自体はイベント無効 */
}

/* ===== 新規取扱品のみ ===== */
.sf-newonly {
    padding: 0.6rem 1rem;
    border-top: 1px solid #e8eef6;
}
.sf-newonly-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e5a9c;
    padding: 0.4rem 0;
    user-select: none;
}
.sf-newonly-label input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: #1e5a9c;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== スマホ対応 ===== */
@media (max-width: 991px) {
    .search-filter-btn span {
        display: none;
    }
    .search-filter-btn {
        min-width: 44px;
        padding: 0.3rem 0.5rem;
    }
    /* キーワード欄直下に表示（PCと同じ absolute 配置） */
    .search-filter-panel {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        bottom: auto;
        max-height: 75vh;
        border-radius: 10px;
        border: 2px solid #1e5a9c;
    }
    .search-filter-panel-header {
        border-radius: 7px 7px 0 0;
    }
    .search-filter-panel-body {
        padding-bottom: 1rem;
    }
}
@media (max-width: 575px) {
    .search-filter-panel {
        max-height: 80vh;
    }
}

/* 絞り込みパネル表示中は親画面スクロール禁止 */
body.search-filter-open {
    overflow: hidden;
}
