/* 商品列表页样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f8f8f8;
    color: #333;
    line-height: 1.6;
}

/* 产品切换导航 - 复用 product.css 样式 */
.product-nav {
    background: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.product-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.product-nav-item {
    padding: 10px 20px;
    text-decoration: none;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.product-nav-item:hover {
    border-color: #ff6700;
    color: #ff6700;
}

.product-nav-item.active {
    border-color: #ff6700;
    background: #fff5f0;
    color: #ff6700;
    font-weight: bold;
}

/* 主容器 - 左右两栏布局 */
.list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    min-height: calc(100vh - 120px);
}

/* 左侧筛选区 */
.filter-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

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

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clear-all-btn {
    padding: 6px 12px;
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-all-btn:hover {
    background: #fff;
    border-color: #ff6700;
    color: #ff6700;
}

/* 筛选器内容 */
.filter-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.filter-loading {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

/* 筛选组 */
.filter-group {
    margin-bottom: 24px;
}

.filter-group-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.filter-group-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #ff6700;
    margin-right: 8px;
    border-radius: 2px;
}

/* 单选筛选项 */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.3s;
}

.filter-option:hover {
    color: #ff6700;
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    accent-color: #ff6700;
    cursor: pointer;
}

.filter-option-label {
    font-size: 14px;
    color: #555;
    flex: 1;
}

.filter-option:hover .filter-option-label {
    color: #ff6700;
}

.filter-option input:checked + .filter-option-label {
    color: #ff6700;
    font-weight: 500;
}

/* 滑块筛选器 */
.filter-slider {
    padding: 10px 0;
}

.slider-track {
    width: 100%;
    height: 4px;
    background: #e8e8e8;
    border-radius: 2px;
    position: relative;
    margin: 20px 0 10px;
}

.slider-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(to right, #ff6700, #ff8534);
    border-radius: 2px;
}

.slider-handle {
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #ff6700;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 2;
    transition: box-shadow 0.2s;
}

.slider-handle:hover,
.slider-handle:active {
    box-shadow: 0 0 0 4px rgba(255, 103, 0, 0.2);
}

.slider-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.slider-input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.slider-input:focus {
    border-color: #ff6700;
    outline: none;
}

.slider-separator {
    color: #999;
}

/* 右侧列表区 */
.product-list-main {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.list-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.result-count {
    font-size: 14px;
    color: #666;
}

.result-count strong {
    color: #ff6700;
    font-weight: 600;
}

/* 表格样式 */
.table-wrapper {
    overflow-x: auto;
}

.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.product-table thead {
    background: #f8f8f8;
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 1px solid #e8e8e8;
    white-space: nowrap;
}

.product-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.product-table tbody tr {
    transition: background 0.2s;
    cursor: pointer;
}

.product-table tbody tr:hover {
    background: #fafafa;
}

.product-table tbody tr:last-child td {
    border-bottom: none;
}

/* 产品列 */
.col-product {
    min-width: 200px;
}

.product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background: #fff;
}

.product-cell-info {
    flex: 1;
    min-width: 0;
}

.product-order-code {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

.product-name {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 属性列 */
.col-attr {
    min-width: 100px;
    white-space: nowrap;
}

.attr-value {
    color: #555;
}

/* 操作列 */
.col-action {
    width: 50px;
    text-align: center;
}

.cart-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    border-color: #ff6700;
    color: #ff6700;
}

.cart-btn svg {
    width: 18px;
    height: 18px;
}

/* 加载状态 */
.loading-cell {
    text-align: center;
    color: #999;
    padding: 60px 20px !important;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state-icon {
    font-size: 48px;
    color: #d9d9d9;
    margin-bottom: 16px;
}

.empty-state-text {
    color: #999;
    font-size: 14px;
}

/* 底部导航 */
.bottom-nav {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

.bottom-nav a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.bottom-nav a:hover {
    color: #ff6700;
}

.bottom-nav .divider {
    margin: 0 15px;
    color: #d9d9d9;
}

/* 响应式 */
@media (max-width: 1024px) {
    .list-container {
        grid-template-columns: 240px 1fr;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .list-container {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
        margin-bottom: 16px;
    }

    .filter-content {
        max-height: none;
    }

    .product-table {
        font-size: 13px;
    }

    .product-table th,
    .product-table td {
        padding: 12px 10px;
    }

    .product-thumb {
        width: 40px;
        height: 40px;
    }
}

/* 滚动条美化 */
.filter-content::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.filter-content::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #bfbfbf;
}

/* ========== 产品选型 Tab ========== */
.selection-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.selection-tab {
    flex: 1;
    padding: 12px 10px;
    background: #f5f5f5;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.selection-tab:hover {
    border-color: #ff6700;
    background: #fff;
}

.selection-tab.active {
    border-color: #ff6700;
    background: #fff5f0;
}

.selection-tab .tab-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.selection-tab .tab-status {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #fafafa;
    color: #999;
    border: 1px solid #e8e8e8;
}

.selection-tab .tab-status.selected {
    background: #f6ffed;
    color: #52c41a;
    border-color: #b7eb8f;
}

.selection-tab.active .tab-name {
    color: #ff6700;
}

/* 选择按钮 */
.select-btn {
    padding: 6px 16px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    transition: all 0.3s;
}

.select-btn:hover {
    border-color: #ff6700;
    color: #ff6700;
}

.select-btn.selected {
    border-color: #52c41a;
    background: #f6ffed;
    color: #52c41a;
    font-weight: 600;
}

/* 选中行样式 */
.product-table tbody tr.selected-row {
    background: #f6ffed;
}

.product-table tbody tr.selected-row:hover {
    background: #d9f7be;
}

/* ========== 底部选型固定栏 ========== */
.selection-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0;
}

.selection-footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.selection-summary {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.selection-summary .summary-placeholder {
    color: #999;
    font-size: 14px;
}

.selection-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
}

.selection-summary .summary-item.not-selected {
    background: #fff7e6;
    border-color: #ffd591;
}

.selection-summary .summary-label {
    font-size: 13px;
    color: #666;
}

.selection-summary .summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

.selection-summary .summary-item.not-selected .summary-value {
    color: #d46b08;
    font-weight: normal;
    font-family: inherit;
}

.btn-add-all {
    padding: 14px 40px;
    background: #ff6700;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-add-all:hover:not(:disabled) {
    background: #ff8534;
}

.btn-add-all:disabled {
    background: #d9d9d9;
    color: #999;
    cursor: not-allowed;
}

/* 响应式 - 底部栏 */
@media (max-width: 768px) {
    .selection-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .selection-footer-inner {
        flex-direction: column;
        gap: 12px;
    }

    .selection-summary {
        width: 100%;
        justify-content: center;
    }

    .btn-add-all {
        width: 100%;
    }
}
