:root { --primary-color: #007bff; --primary-hover: #d35400; --secondary-color: #2c3e50; --light-bg: #f8f9fa; --card-bg: #ffffff; --border-color: #dee2e6; --text-primary: #2c3e50; --text-muted: #6c757d; --sidebar-width: 300px; --header-height: 1px; }
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; background-color: var(--light-bg); color: var(--text-primary); padding-top: var(--header-height); }
.main-container { min-height: calc(100vh - var(--header-height) - 160px); }
.navbar { background: #0050a0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 1030; }
.navbar-brand { font-weight: 700; font-size: 1.25rem; }
.search-box { max-width: 350px; width: 100%; }

.category-tabs-bar { position: sticky; top: var(--header-height); z-index: 1020; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.cat-tab { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border: 2px solid transparent; border-radius: 10px; cursor: pointer; background: #f0f2f5; color: #555; font-weight: 500; font-size: 0.9rem; transition: all 0.2s; }
.cat-tab:hover { background: #e4e6eb; }
.cat-tab.active { background: var(--primary-color); color: white; border-color: var(--primary-color); }
.cat-tab i { margin-right: 6px; }

.sidebar { position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: 1rem; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1040; }
.sidebar-overlay.show { display: block; }
.filter-panel { background: var(--card-bg); border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); overflow: hidden; }
.filter-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-color); background: linear-gradient(135deg, var(--secondary-color), #3296FA); color: white; }
.filter-body { padding: 0.5rem 0; max-height: calc(100vh - 200px); overflow-y: auto; scrollbar-width: thin; }
.filter-group { border-bottom: 1px solid #eee; } .filter-group:last-child { border-bottom: none; }
.filter-group-title { padding: 0.75rem 1.25rem; cursor: pointer; display: flex; align-items: center; font-weight: 600; font-size: 0.9rem; color: var(--secondary-color); }
.filter-group-title:hover { background: #f0f0f0; } .filter-group-title .bi-chevron-down { transition: transform 0.3s; font-size: 0.75rem; margin-left: auto; }
.filter-group-title[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }
.filter-group-content { padding: 0.25rem 1.25rem 0.75rem; }
.filter-item { display: flex; align-items: center; padding: 0.35rem 0; cursor: pointer; font-size: 0.875rem; }
.filter-item input { margin-right: 0.5rem; accent-color: var(--primary-color); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.product-card { background: var(--card-bg); border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: all 0.3s ease; overflow: hidden; border: 2px solid transparent; position: relative; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,0.12); }
.product-card.selected { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.2); }
.product-card-header { padding: 0.25rem 1rem; overflow: hidden; background: linear-gradient(135deg, #f8f9fa, #e9ecef); border-bottom: 1px solid var(--border-color); position: relative; }
.product-name { font-size: 1.15rem; font-weight: 700; color: var(--secondary-color); margin-bottom: 0.25rem; }
.product-series { font-size: 0.8rem; color: var(--text-muted); }
.status-badge { position: absolute; top: 0.75rem; right: 0.75rem; font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 20px; font-weight: 600; }
.status-first { background: #d4edda; color: #155724; } .status-second { background: #fff3cd; color: #856404; } .status-third { background: #f8d7da; color: #721c24; }
.product-card-body { padding: 0 1rem; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.1rem; }
.spec-item { display: flex; flex-direction: column; padding: 0.2rem 0; }
.spec-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.spec-value { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card-footer { padding: 0.75rem 1rem; border-top: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; background: #fafafa; }
.brand-badges { display: flex; gap: 0.35rem; }
.brand-badge { font-size: 0.9rem; padding: 0.15rem 0.4rem; border-radius: 4px; font-weight: 600; }
.badge-brand { background: #cce5ff; color: #004085; }
.product-card-actions .btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.compare-checkbox { position: absolute; top: 2.2rem; left: 11.5rem; font-size: 0.9rem; z-index: 2; display: flex; align-items: center; }
.compare-checkbox input { width: 14px; height: 14px; accent-color: var(--primary-color); cursor: pointer; }

.toolbar { padding: 0.75rem; background: var(--card-bg); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
#tableView .table th { white-space: nowrap; font-size: 0.8rem; font-weight: 600; }
.compare-table th { background: #6c757d; color: white; font-weight: 600; min-width: 120px; }
.compare-table td { font-size: 0.85rem; max-width: 200px; word-break: break-word; }
.compare-table td.highlight { background: #fff3cd; font-weight: 600; }
.detail-section { margin-bottom: 1.5rem; }
.detail-section h6 { font-weight: 700; color: var(--secondary-color); border-bottom: 2px solid var(--primary-color); padding-bottom: 0.5rem; margin-bottom: 0.75rem; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.detail-item { padding: 0.5rem; background: #f8f9fa; border-radius: 8px; }
.detail-item .label { font-size: 0.75rem; color: var(--text-muted); display: block; }
.detail-item .value { font-size: 0.9rem; font-weight: 600; }
.pagination .page-link { color: var(--primary-color); border-color: var(--border-color); }
.pagination .page-item.active .page-link { background-color: #cce5ff; border-color: #dee2e6; }

.btn-back { border: 1px solid #ced4da; color: #495057; background: #fff; transition: all 0.2s;  }
.btn-back:hover { background: #99ccff; border-color: #adb5bd; }
.btn-ds { border: 1px solid #ced4da; color: #495057; background: #fff; transition: all 0.2s; }
.btn-ds:hover { background: #f8f9fa; border-color: #adb5bd; }
.detail-product-hero { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.detail-img-wrapper { background: var(--gray-10); border: 1px solid #e5e5e5; border-radius: 8px; padding: 1.5rem; display: flex; align-items: center; justify-content: center; min-height: 280px; }
.detail-img-wrapper img { max-height: 260px; width: auto; object-fit: contain; }
.detail-section-title { font-weight: 700; font-size: 1.25rem; margin-bottom: 1rem; color: #1a1d21; }  
.detail-spec-card { background: #fff; border: none; border-radius: 10px; }
.detail-list-group { border: 1px solid #e5e5e5; border-radius: 8px; } 
.detail-spec-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-200); transition: background 0.15s; }
.detail-spec-item:last-child { border-bottom: none; }
.detail-spec-card .detail-list-group-flush .detail-spec-item:nth-child(even) { background-color: rgba(0,0,0,0.03); }
.detail-spec-card .detail-list-group-flush .detail-spec-item:hover { background-color: rgba(13,110,253,0.05); }
.detail-spec-label { color: #6c757d; font-size: 0.9rem; }
.detail-spec-value { color: #212529; font-weight: 500; font-size: 0.95rem; display: flex; justify-content: center; align-items: center; flex: 1; }

@media (max-width: 768px) {
    body { padding-top: 0; }
    .category-tabs-bar { position: static; }
    .sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; max-height: 100vh; z-index: 1050; transform: translateX(-100%); transition: transform 0.3s ease; padding: 0; }
    .sidebar.show { transform: translateX(0); }
    .sidebar .filter-panel { border-radius: 0; min-height: 100vh; }
    .product-grid { grid-template-columns: 1fr; }
    .search-box { max-width: 100%; margin-top: 0.5rem; }
}
@media (min-width: 768px) and (max-width: 991.98px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1400px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 992px) { .detail-split-right { padding-left: 1rem; } }
