/* SFM Frontend CSS */

.sfm-empty {
    padding: 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    color: #6c757d;
}

/* ========================================
   스펙 아코디언 + 표형식
======================================== */
.sfm-spec-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 24px 0;
    font-size: var(--font-size, 14px);
}
.spec-header {
    background: linear-gradient(135deg, #1e3a5f, #2c5282);
    color: #fff;
    padding: 20px 28px;
}
.spec-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.spec-accordion { border-top: 1px solid #e9ecef; }
.accordion-item { border-bottom: 1px solid #e9ecef; }
.accordion-item:last-child { border-bottom: none; }
.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.2s;
}
.accordion-title:hover { background: #f1f3f5; }
.acc-icon { font-size: 20px; }
.acc-label { flex: 1; font-weight: 600; color: #1e3a5f; font-size: 15px; }
.acc-arrow { color: #868e96; transition: transform 0.3s; font-size: 12px; }
.accordion-item.collapsed .acc-arrow { transform: rotate(-90deg); }
.accordion-item.collapsed .accordion-content { display: none; }
.accordion-content { padding: 0; background: #fff; }

/* 스펙 그리드 - PC 3세트(6칸), 모바일 1세트(2칸) */
.spec-table-responsive { width: 100%; }
.spec-grid-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.spec-grid-item {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}
.spec-grid-item:nth-child(3n) { border-right: none; }
.spec-grid-items .spec-grid-item:nth-last-child(-n+3) { border-bottom: none; }
.spec-th {
    flex: 0 0 var(--label-width, 40%);
    background: #2c5282;
    color: #fff;
    font-weight: 600;
    font-size: var(--font-size, 14px);
    padding: 10px 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}
.spec-td {
    flex: 0 0 var(--value-width, 60%);
    background: #fff;
    color: #212529;
    font-weight: 500;
    font-size: var(--font-size, 14px);
    padding: 10px 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: keep-all;
}

/* 그룹별 줄무늬 */
.accordion-item:nth-child(odd) .accordion-title { background: #f8f9fa; }
.accordion-item:nth-child(even) .accordion-title { background: #edf2f7; }

/* 모바일: 2세트(4칸) */
@media (max-width: 768px) {
    .spec-grid-items { grid-template-columns: repeat(2, 1fr); }
    .spec-grid-item { border-right: 1px solid #e9ecef; }
    .spec-grid-item:nth-child(3n) { border-right: 1px solid #e9ecef; }
    .spec-grid-item:nth-child(2n) { border-right: none; }
    .spec-grid-items .spec-grid-item:nth-last-child(-n+3) { border-bottom: 1px solid #e9ecef; }
    .spec-grid-items .spec-grid-item:nth-last-child(-n+2) { border-bottom: none; }
    .spec-th, .spec-td {
        font-size: calc(var(--font-size, 14px) * 0.85);
        padding: 8px 6px;
    }
}

/* 더 작은 화면 */
@media (max-width: 480px) {
    .spec-th, .spec-td {
        font-size: calc(var(--font-size, 14px) * 0.75);
        padding: 6px 4px;
    }
}

/* ========================================
   스펙 비교 테이블
======================================== */
.sfm-table-wrap { margin: 24px 0; font-size: var(--font-size, 14px); }

/* 필터 영역 */
.table-filters {
    background: #fff;
    padding: 16px 20px;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}
.filter-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.filter-group:last-child { margin-bottom: 0; }
.filter-label {
    font-weight: 600;
    min-width: 80px;
    color: #1e3a5f;
    font-size: 13px;
    padding-top: 6px;
}
.filter-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.2s;
    color: #495057;
    font-weight: 500;
}
.filter-btn:hover {
    border-color: #1e3a5f;
    background: #f8f9fa;
    color: #1e3a5f;
}
.filter-btn.active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
    font-weight: 600;
}

@media (max-width: 768px) {
    .filter-btn { padding: 4px 10px; font-size: 12px; }
    .filter-label { min-width: 60px; font-size: 12px; }
    .table-filters { padding: 12px 16px; }
}

/* 테이블 스크롤 */
.table-scroll {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 0 0 12px 12px;
}
.table-filters + .table-scroll { border-radius: 0 0 12px 12px; }
.table-scroll:first-child { border-radius: 12px; }

/* 스펙 테이블 */
.sfm-spec-table { width: 100%; border-collapse: collapse; background: #fff; }
.sfm-spec-table th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
}
.sfm-spec-table .header-1 th { background: var(--hc1, #1e3a5f); color: #fff; }
.sfm-spec-table .header-2 th { background: var(--hc2, #2c5282); color: #fff; }
.sfm-spec-table .col-model { border-right: 2px solid rgba(255,255,255,0.3); }
.sfm-spec-table td {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    text-align: center;
    word-break: keep-all;
}
.sfm-spec-table td.col-model {
    text-align: left;
    font-weight: 600;
    border-right: 2px solid #dee2e6;
}
.sfm-spec-table td.col-model a { color: #1e3a5f; text-decoration: none; }
.sfm-spec-table td.col-model a:hover { text-decoration: underline; color: #2c5282; }

/* 줄무늬 */
.sfm-spec-table .row-odd td { background: #fff; }
.sfm-spec-table .row-even td { background: #f8f9fa; }
.sfm-spec-table thead th.col-model { background: var(--hc1, #1e3a5f); color: #fff; }
.sfm-spec-table .row-top td { border-bottom: 1px dashed #dee2e6; }
.sfm-spec-table .row-bottom td { border-bottom: 2px solid #dee2e6; }
.sfm-spec-table tr.row-top:hover td,
.sfm-spec-table tr.row-top:hover + tr.row-bottom td { background: #e7f5ff !important; }
.sfm-spec-table tr.hidden { display: none; }

.table-footer { margin-top: 12px; text-align: right; }
.product-count {
    background: #f8f9fa;
    padding: 8px 16px;
    font-size: 13px;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: inline-block;
}
