/**
 * PC Parts Spec Database - Public CSS
 * v2.0.0: sticky列、ヒートマップ、棒グラフ、高度フィルタ、
 *         ページネーション、カラムトグル、詳細ポップアップ
 * v3.1.3: sticky列left値をCSS変数化（重なり修正）
 * v3.2.0: (version bump for cache busting)
 * v4.0.0: ボタン式フィルタ、ベンチマーク切替UI
 * v4.3.0: シリーズカテゴリラベル、世代アコーディオン、モバイル最適化強化
 * v4.4.0: 汎用アコーディオン、市場ボタン、suffix_tagフィルタ、モバイル折りたたみ
 */

.pcparts-list-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================
   ツールバー
   ========================================== */
.pcparts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f8f9fa, #f0f1f3);
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    flex-wrap: wrap;
}

.pcparts-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* 統一入力スタイル（filter-btnと同じトーン） */
.pcparts-filter-socket,
.pcparts-search,
.pcparts-preset-select,
.pcparts-per-page-select {
    padding: 3px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 11px;
    background: #fff;
    color: #495057;
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 1.4;
}

.pcparts-filter-socket:focus,
.pcparts-search:focus,
.pcparts-preset-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
    outline: none;
}

.pcparts-search {
    min-width: 160px;
}

.pcparts-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* フィルタリセットボタン */
.pcparts-filter-reset {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #dc3545;
    color: #dc3545;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.15s;
    line-height: 1.4;
}

.pcparts-filter-reset:hover {
    background: #dc3545;
    color: #fff;
}

/* 高度なフィルタトグル */
.pcparts-advanced-filter-toggle {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #6c757d;
    color: #6c757d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
}

.pcparts-advanced-filter-toggle:hover,
.pcparts-advanced-filter-toggle.active {
    background: #6c757d;
    color: #fff;
}

.pcparts-advanced-filters {
    display: none;
    width: 100%;
    padding: 10px 0 0;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pcparts-advanced-filters.open {
    display: flex;
}

.pcparts-range-group {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #495057;
}

.pcparts-range-input {
    width: 60px;
    padding: 3px 6px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
}

/* 比較ボタン */
.pcparts-compare-btn {
    padding: 3px 10px;
    background: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.15s;
    line-height: 1.4;
}

.pcparts-compare-btn:hover:not(:disabled) {
    background: #0b5ed7;
}

.pcparts-compare-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

/* カラムトグル */
.pcparts-column-toggle {
    position: relative;
}

.pcparts-column-toggle-btn {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #495057;
    transition: all 0.15s;
    line-height: 1.4;
}

.pcparts-column-toggle-btn:hover {
    background: #e9ecef;
}

.pcparts-column-toggle-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.pcparts-column-toggle-dropdown.open {
    display: block;
}

.pcparts-column-toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: background 0.1s;
}

.pcparts-column-toggle-item:hover {
    background: #f0f1f3;
}


/* ==========================================
   ボタン式フィルタ
   ========================================== */
.pcparts-filter-panel {
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-bottom: none;
}

.pcparts-filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.pcparts-filter-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: #0d6efd;
}

.pcparts-filter-section {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    flex-wrap: wrap;
}

.pcparts-filter-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    min-width: 80px;
    flex-shrink: 0;
    white-space: nowrap;
}

.pcparts-filter-btn-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    padding-bottom: 2px;
    min-width: 0;
}


.pcparts-filter-btn {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #495057;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.pcparts-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pcparts-filter-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    font-weight: 600;
}

/* ベンチマーク切替 */
.pcparts-benchmark-selector {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    flex-wrap: wrap;
}

.pcparts-bench-mode-label {
    min-width: auto !important;
    margin-left: 0;
}

/* 「表示：」ラベルとモードボタンを同一行にまとめる */
.pcparts-bench-mode-wrapper {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-shrink: 0;
}

.pcparts-benchmark-mode-buttons {
    flex: 0 0 auto;
    min-width: auto;
}

.pcparts-benchmark-btn {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #495057;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.pcparts-benchmark-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pcparts-benchmark-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    font-weight: 600;
}

/* ベンチマークSC/MCモード切替 */
.pcparts-benchmark-mode-btn {
    padding: 3px 10px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #495057;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}

.pcparts-benchmark-mode-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pcparts-benchmark-mode-btn.active {
    background: #198754;
    color: #fff;
    border-color: #198754;
    font-weight: 600;
}

/* メーカーグループ（AMD/Intelを行分離） */
.pcparts-mfr-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.pcparts-mfr-group + .pcparts-mfr-group {
    margin-top: 4px;
}

/* シリーズメーカーラベル（メーカー未選択時） */
.pcparts-series-mfr-label {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    padding: 3px 8px;
    background: #495057;
    border-radius: 3px;
    white-space: nowrap;
    margin-right: 2px;
    flex-shrink: 0;
}

/* カテゴリラベル+ボタンをまとめるグループ（ラベルとボタンが同じ行に留まる） */
.pcparts-category-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    margin-right: 4px;
}

/* シリーズカテゴリラベル */
.pcparts-series-category-label {
    font-size: 11px;
    font-weight: 600;
    color: #0d6efd;
    padding: 3px 6px;
    background: #e7f1ff;
    border-radius: 3px;
    white-space: nowrap;
    margin-right: 2px;
    flex-shrink: 0;
}

/* 汎用アコーディオン（HEDT、旧世代、モバイル折りたたみ共通） */
.pcparts-accordion-wrapper {
    flex-shrink: 0;
    width: 100%;
    margin-top: 4px;
}

.pcparts-accordion-toggle {
    padding: 4px 12px;
    background: #f8f9fa;
    border: 1px dashed #adb5bd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #6c757d;
    transition: all 0.15s;
    white-space: nowrap;
}

.pcparts-accordion-toggle:hover {
    background: #e9ecef;
    border-color: #6c757d;
}

.pcparts-accordion-arrow {
    font-size: 10px;
    display: inline-block;
    transition: transform 0.2s;
}

.pcparts-accordion-arrow.open {
    transform: rotate(180deg);
}

.pcparts-accordion-body {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 6px;
}

.pcparts-accordion-body.open {
    display: flex;
}

/* モバイル用「その他の絞り込み」トグル - PCでは非表示 */
.pcparts-filter-more-toggle {
    display: none;
    padding: 6px 12px;
    background: #f0f1f3;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #495057;
    font-weight: 600;
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

.pcparts-filter-more-toggle:hover {
    background: #e9ecef;
}

/* 折りたたみ対象エリア - PCでは常に表示、色で区別 */
.pcparts-filter-collapsible {
    display: block;
    background: #f8f9fb;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    border: 1px solid #e9ecef;
}

/* セカンダリツールバー（検索・範囲・アクション） */
.pcparts-secondary-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    margin-top: 6px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.pcparts-secondary-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ==========================================
   テーブル
   ========================================== */
.pcparts-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    position: relative;
}

.pcparts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.pcparts-table th,
.pcparts-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #f0f1f3;
    white-space: nowrap;
}

.pcparts-table th {
    background: #343a40;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 2px solid #495057;
    border-right: 1px solid #495057;
}

.pcparts-table th:last-child,
.pcparts-table td:last-child {
    border-right: none;
}

/* sticky チェックボックス列 */
.pcparts-sticky-col {
    position: sticky;
    left: 0;
    z-index: 4;
    background: #ffffff;
}

.pcparts-table thead .pcparts-sticky-col {
    z-index: 5;
    background: #2c3136;
}

/* sticky 製品名列 */
.pcparts-sticky-name {
    position: sticky;
    z-index: 4;
    background: #ffffff;
    border-right: 2px solid #dee2e6 !important;
    min-width: 200px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcparts-table thead .pcparts-sticky-name {
    z-index: 5;
    background: #2c3136;
    border-right: 2px solid #495057 !important;
}

/* sticky leftの位置計算（チェックボックス有無で変動） */
.pcparts-list-container[data-show-compare="true"] .pcparts-sticky-col {
    left: 0;
}
.pcparts-list-container[data-show-compare="false"] .pcparts-sticky-name,
.pcparts-list-container:not([data-show-compare]) .pcparts-sticky-name {
    left: 0;
}
/* JS が --sticky-name-left を設定する。フォールバック 0px */
.pcparts-list-container[data-show-compare="true"] .pcparts-sticky-name {
    left: var(--sticky-name-left, 0px);
}

/* 行スタイル */
.pcparts-table tbody tr {
    transition: background 0.1s;
    cursor: pointer;
}

.pcparts-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.pcparts-table tbody tr:hover td {
    background: #e8f4fd !important;
}

.pcparts-table tbody tr:nth-child(even) .pcparts-sticky-name,
.pcparts-table tbody tr:nth-child(even) .pcparts-sticky-col {
    background: #fafbfc;
}

.pcparts-table tbody tr:hover .pcparts-sticky-name,
.pcparts-table tbody tr:hover .pcparts-sticky-col {
    background: #e8f4fd !important;
}

/* ソート */
.pcparts-sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.pcparts-sortable:hover {
    background: #495057 !important;
}

/* ソートアイコン: CSS三角形で描画（絵文字化を防止） */
.pcparts-sort-icon {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
    gap: 1px;
    opacity: 0.4;
}

.pcparts-sort-icon::before,
.pcparts-sort-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.pcparts-sort-icon::before {
    border-bottom: 4px solid currentColor;
}

.pcparts-sort-icon::after {
    border-top: 4px solid currentColor;
}

/* 昇順: 上三角のみ強調 */
.pcparts-sortable.asc .pcparts-sort-icon {
    opacity: 1;
}
.pcparts-sortable.asc .pcparts-sort-icon::after {
    opacity: 0.25;
}

/* 降順: 下三角のみ強調 */
.pcparts-sortable.desc .pcparts-sort-icon {
    opacity: 1;
}
.pcparts-sortable.desc .pcparts-sort-icon::before {
    opacity: 0.25;
}

/* チェックボックス列 */
.pcparts-col-checkbox {
    width: 36px;
    min-width: 36px;
    text-align: center;
    padding: 8px 4px !important;
}

.pcparts-col-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* ==========================================
   ベンチマーク棒グラフ
   ========================================== */
.pcparts-bench-cell {
    position: relative;
    min-width: 100px;
    height: 28px;
    display: flex;
    align-items: center;
}

.pcparts-bench-bar {
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    background: linear-gradient(to right, #4dabf7, #228be6);
    border-radius: 3px;
    opacity: 0.25;
    transition: width 0.3s ease;
}

.pcparts-bench-bar.compare {
    background: linear-gradient(to right, #69db7c, #40c057);
}

.pcparts-bench-value {
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 12px;
    padding-left: 6px;
}

/* ==========================================
   価格・コスパ列
   ========================================== */
.pcparts-price-cell {
    text-align: right;
    white-space: nowrap;
}

.pcparts-price-value {
    font-weight: 600;
    font-size: 12px;
    color: #d9480f;
}

.pcparts-cospa-bar {
    background: linear-gradient(to right, #ffd43b, #fab005) !important;
}

/* ==========================================
   ヒートマップ
   ========================================== */
.pcparts-heatmap {
    font-weight: 600;
}

/* ==========================================
   ページネーション
   ========================================== */
.pcparts-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.pcparts-pagination-top {
    border-radius: 0;
}

.pcparts-page-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pcparts-showing {
    color: #495057;
    font-size: 11px;
    font-weight: 500;
}

.pcparts-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pcparts-page-btn {
    padding: 2px 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    min-width: 24px;
    text-align: center;
    transition: all 0.15s;
}

.pcparts-page-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pcparts-page-btn.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    font-weight: 600;
}

.pcparts-page-ellipsis {
    padding: 4px 6px;
    color: #6c757d;
}

.pcparts-page-prev,
.pcparts-page-next {
    font-weight: 700;
}

/* 結果なし */
.pcparts-no-results {
    text-align: center;
    padding: 40px !important;
    color: #6c757d;
    font-size: 14px;
}

/* ==========================================
   比較モーダル
   ========================================== */
.pcparts-compare-modal,
.pcparts-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcparts-modal-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.pcparts-modal-content {
    position: relative;
    background: #fff;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.pcparts-detail-modal .pcparts-modal-content {
    max-width: 800px;
    max-height: 90vh;
    margin: auto;
    border-radius: 12px;
    width: 95%;
    height: auto;
}

.pcparts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 2px solid #dee2e6;
    background: #fff;
    flex-shrink: 0;
}

.pcparts-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #343a40;
}

.pcparts-modal-close {
    background: none;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 4px 10px;
    transition: all 0.15s;
}

.pcparts-modal-close:hover {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

.pcparts-modal-body {
    overflow: auto;
    flex: 1;
    min-height: 0;
    background: #f8f9fa;
}

.pcparts-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    border-top: 2px solid #dee2e6;
    background: #fff;
    flex-shrink: 0;
}

.pcparts-modal-close-btn {
    padding: 8px 28px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s;
}

.pcparts-modal-close-btn:hover {
    background: #5a6268;
}

/* ==========================================
   比較テーブル
   ========================================== */
.pcparts-compare-table-wrapper {
    padding: 0;
    overflow-x: auto;
    overflow-y: auto;
}

.pcparts-compare-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.pcparts-compare-table th,
.pcparts-compare-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    vertical-align: middle;
}

.pcparts-compare-table thead th {
    background: #343a40;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #495057;
    white-space: normal;
    word-break: break-word;
}

.pcparts-compare-table thead th.pcparts-compare-label-col {
    background: #2c3136;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 12;
    border-right: 2px solid #495057;
}

.pcparts-compare-table thead th.pcparts-compare-product-col {
    white-space: normal;
    word-break: break-word;
    padding: 10px 12px;
}

.pcparts-compare-table td.pcparts-compare-label-cell {
    background: #f8f9fa;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 5;
    border-right: 2px solid #dee2e6;
    font-size: 12px;
    color: #495057;
}

.pcparts-compare-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}

.pcparts-compare-table tbody tr:nth-child(even) td.pcparts-compare-label-cell {
    background-color: #f0f2f4;
}

.pcparts-compare-table tbody tr:hover td {
    background-color: #e8f4fd;
}

.pcparts-compare-table tbody tr:hover td.pcparts-compare-label-cell {
    background-color: #dce9f2;
}

/* 差分ハイライト */
.pcparts-highlight-max {
    background: #d4edda !important;
    color: #155724;
    font-weight: 600;
}

.pcparts-highlight-min {
    background: #f8d7da !important;
    color: #721c24;
}

.pcparts-compare-table td.pcparts-compare-value-cell {
    white-space: nowrap;
}

.pcparts-compare-table tr.pcparts-compare-section-row td {
    background: #e9ecef !important;
    font-weight: 700;
    font-size: 12px;
    color: #343a40;
    text-align: left;
    padding: 6px 12px;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.05em;
}

/* ==========================================
   詳細ポップアップ
   ========================================== */
.pcparts-detail-grid {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pcparts-detail-section h4 {
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #0d6efd;
    color: #343a40;
    font-size: 14px;
    font-weight: 700;
}

.pcparts-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pcparts-detail-table th,
.pcparts-detail-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
}

.pcparts-detail-table th {
    width: 40%;
    color: #6c757d;
    font-weight: 500;
    background: #f8f9fa;
}

.pcparts-detail-table td {
    font-weight: 600;
    color: #212529;
}

/* 機能タグ */
.pcparts-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pcparts-feature-tag {
    display: inline-block;
    padding: 3px 8px;
    background: #e7f1ff;
    color: #0d6efd;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #b6d4fe;
}

/* ==========================================
   スタンドアロン比較テーブル
   ========================================== */
.pcparts-compare-standalone .pcparts-compare-table thead th {
    background: #343a40;
    color: #fff;
}

/* ==========================================
   エラー・ローディング
   ========================================== */
.pcparts-error,
.pcparts-specs-error {
    color: #dc3545;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.pcparts-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.pcparts-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: pcparts-spin 0.8s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes pcparts-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   レスポンシブ
   ========================================== */
@media (max-width: 768px) {
    .pcparts-toolbar,
    .pcparts-secondary-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
        gap: 6px;
    }

    .pcparts-filters,
    .pcparts-secondary-filters,
    .pcparts-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .pcparts-secondary-filters {
        flex-direction: column;
        gap: 6px;
    }

    .pcparts-search {
        min-width: 0;
        width: 100%;
    }

    .pcparts-filter-manufacturer,
    .pcparts-filter-socket,
    .pcparts-filter-series,
    .pcparts-filter-market,
    .pcparts-filter-generation {
        flex: 1;
        min-width: 0;
    }

    .pcparts-filter-panel {
        padding: 8px;
    }

    .pcparts-filter-panel-header {
        margin-bottom: 6px;
    }

    .pcparts-filter-section {
        flex-direction: column;
        gap: 4px;
        padding: 3px 0;
    }

    .pcparts-filter-section-label {
        min-width: auto;
        font-size: 11px;
    }

    .pcparts-filter-btn {
        padding: 3px 7px;
        font-size: 10px;
        min-height: 28px;
    }

    .pcparts-filter-btn-group {
        gap: 2px;
    }

    .pcparts-accordion-body {
        gap: 2px;
    }

    .pcparts-benchmark-btn {
        padding: 3px 7px;
        font-size: 10px;
        min-height: 28px;
    }

    .pcparts-secondary-toolbar {
        flex-direction: column;
        gap: 6px;
        padding: 6px 0;
    }

    .pcparts-secondary-filters {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }

    .pcparts-category-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .pcparts-series-category-label {
        font-size: 10px;
        padding: 2px 4px;
        width: 100%;
        margin-bottom: 2px;
    }

    /* モバイル: 「その他の絞り込み」トグルを表示 */
    .pcparts-filter-more-toggle {
        display: block;
    }

    /* モバイル: 折りたたみ対象を非表示（openで表示） */
    .pcparts-filter-collapsible {
        display: none;
    }

    .pcparts-filter-collapsible.open {
        display: block;
    }

    .pcparts-range-group {
        width: 100%;
    }

    .pcparts-range-input {
        flex: 1;
        min-width: 0;
    }

    .pcparts-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pcparts-preset-select,
    .pcparts-column-toggle-btn,
    .pcparts-compare-btn {
        font-size: 10px;
        padding: 3px 7px;
    }

    .pcparts-filter-reset {
        font-size: 10px;
        padding: 3px 7px;
    }

    .pcparts-filter-collapsible {
        padding: 4px 6px;
    }

    .pcparts-pagination {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 8px;
    }

    .pcparts-page-info {
        flex-direction: column;
        gap: 4px;
        font-size: 12px;
    }

    .pcparts-page-btn {
        min-width: 32px;
        min-height: 32px;
        font-size: 12px;
    }

    .pcparts-modal-content {
        border-radius: 0;
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        box-shadow: none;
    }

    .pcparts-detail-modal .pcparts-modal-content {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .pcparts-modal-header {
        padding: 10px 14px;
    }

    .pcparts-modal-header h3 {
        font-size: 14px;
    }

    .pcparts-sticky-name {
        min-width: 120px;
        max-width: 180px;
        font-size: 11px;
    }

    .pcparts-table {
        font-size: 11px;
    }

    .pcparts-table th,
    .pcparts-table td {
        padding: 5px 6px;
        font-size: 11px;
    }

    .pcparts-table th {
        font-size: 10px;
    }

    .pcparts-detail-grid {
        padding: 10px;
    }

    .pcparts-accordion-toggle {
        font-size: 10px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .pcparts-filters {
        flex-direction: column;
    }

    .pcparts-page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pcparts-sticky-name {
        min-width: 100px;
        max-width: 140px;
        font-size: 10px;
    }

    .pcparts-table th,
    .pcparts-table td {
        padding: 4px 5px;
        font-size: 10px;
    }

    .pcparts-filter-btn {
        padding: 2px 6px;
        font-size: 9px;
        min-height: 24px;
    }

    .pcparts-benchmark-btn {
        padding: 2px 6px;
        font-size: 9px;
        min-height: 24px;
    }

    .pcparts-filter-panel {
        padding: 6px;
    }

    .pcparts-filter-more-toggle {
        font-size: 10px;
        padding: 5px 8px;
    }

    .pcparts-accordion-toggle {
        font-size: 9px;
        padding: 3px 8px;
    }
}
