/* ===== 产品中心：多属性筛选 ===== */

.pf-layout {
    display: grid;
    grid-template-columns: 236px 1fr;
    gap: 32px;
    align-items: start;
}

/* ---------- 筛选侧栏 ---------- */
.pf-sidebar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px 18px;
    position: sticky;
    top: 92px;
    box-shadow: var(--shadow-sm);
}

.pf-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
}

.pf-clear {
    border: none;
    background: none;
    color: var(--gray-500);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    transition: var(--transition);
}

.pf-clear:hover {
    color: var(--primary);
}

.pf-group {
    margin-bottom: 22px;
}

.pf-group:last-child {
    margin-bottom: 0;
}

.pf-group h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 10px;
}

.pf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pf-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    background: var(--white);
    color: var(--gray-700);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.4;
}

.pf-chip:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}

.pf-chip.on {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pf-chip-sm {
    padding: 4px 10px;
    font-size: 12.5px;
}

.pf-chip em {
    font-style: normal;
    font-size: 11px;
    color: var(--gray-500);
    background: var(--gray-100);
    border-radius: 10px;
    padding: 0 5px;
    min-width: 18px;
    text-align: center;
}

.pf-chip.on em {
    background: rgba(255, 255, 255, 0.24);
    color: rgba(255, 255, 255, 0.92);
}

.pf-chip.is-disabled:not(.on) {
    opacity: 0.45;
}

/* ---------- 主区域 ---------- */
.pf-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.pf-count {
    font-size: 13px;
    color: var(--gray-600);
}

.pf-count span {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-right: 2px;
}

.pf-active {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.pf-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12.5px;
    cursor: pointer;
}

.pf-tag i {
    font-style: normal;
    font-size: 14px;
    line-height: 1;
}

.pf-tag:hover {
    background: var(--primary);
    color: var(--white);
}

.pf-sort {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--gray-700);
    background: var(--white);
    outline: none;
    cursor: pointer;
}

.pf-sort:focus {
    border-color: var(--primary);
}

/* 卡片内的详情按钮（原来是 a 标签） */
.product-link {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

/* 有真实图片时铺满卡片 */
.pf-main .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.pf-main .product-list .product-desc {
    -webkit-line-clamp: 3;
}

.pf-main .product-card {
    display: flex;
    flex-direction: column;
}

.pf-main .product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pf-main .product-link {
    margin-top: auto;
}

/* ---------- 空状态 ---------- */
.pf-empty {
    text-align: center;
    padding: 70px 20px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    color: var(--gray-600);
}

.pf-empty strong {
    display: block;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 6px;
}

/* ---------- 分页 ---------- */
.pf-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.pf-page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pf-page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.pf-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- 详情弹窗 ---------- */
.pf-modal {
    position: fixed;
    inset: 0;
    background: rgba(16, 26, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 120;
    overflow-y: auto;
}

.pf-modal[hidden] {
    display: none;
}

.pf-modal-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 48px);
    display: grid;
    grid-template-columns: 300px 1fr;
    overflow: hidden;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    animation: pfPop 0.2s ease-out;
}

@keyframes pfPop {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.pf-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--gray-700);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    box-shadow: var(--shadow-sm);
}

.pf-modal-media {
    background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
}

.pf-modal-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pf-modal-icon {
    width: 96px;
    height: 96px;
    background: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.pf-modal-icon svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.pf-modal-info {
    padding: 34px 32px 28px;
    overflow-y: auto;
}

.pf-modal-cat {
    display: inline-block;
    background: var(--primary-light, #e8f1fb);
    color: var(--primary);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 12px;
    margin-bottom: 10px;
}

.pf-modal-info h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 10px;
}

.pf-modal-desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 18px;
}

.pf-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-bottom: 22px;
}

.pf-spec-table th,
.pf-spec-table td {
    border-bottom: 1px solid var(--gray-200);
    padding: 9px 0;
    text-align: left;
    vertical-align: top;
}

.pf-spec-table th {
    width: 88px;
    color: var(--gray-500);
    font-weight: 500;
}

.pf-spec-tag {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 4px;
    padding: 1px 8px;
    margin: 0 6px 4px 0;
    font-size: 12.5px;
}

.pf-modal-actions {
    display: flex;
    gap: 10px;
}

.pf-modal-more {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.pf-modal-more:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ---------- 移动端筛选开关 ---------- */
.pf-toggle {
    display: none;
    width: 100%;
    margin-bottom: 16px;
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pf-toggle.on {
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 992px) {
    .pf-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .pf-toggle {
        display: block;
    }

    .pf-sidebar {
        position: static;
        display: none;
    }

    .pf-sidebar.open {
        display: block;
    }

    .pf-modal-card {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .pf-modal-media {
        min-height: 200px;
        max-height: 220px;
    }

    .pf-modal-info {
        padding: 24px 20px;
    }
}

@media (max-width: 620px) {
    .pf-main .product-list {
        grid-template-columns: 1fr;
    }

    .pf-toolbar {
        padding: 10px 12px;
    }

    .pf-sort {
        margin-left: auto;
    }
}

/* ---------- 产品详情页 ---------- */
.pd-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.pd-main {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.pd-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--white);
}

.pd-main-icon {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.pd-main-icon svg {
    width: 56px;
    height: 56px;
}

.pd-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.pd-thumb {
    width: 78px;
    height: 62px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.pd-thumb.on,
.pd-thumb:hover {
    border-color: var(--primary);
}

.pd-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-cat {
    display: inline-block;
    background: #e8f1fb;
    color: var(--primary);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 12px;
    margin-bottom: 12px;
}

.pd-name {
    font-size: 30px;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.35;
    margin-bottom: 8px;
}

.pd-model {
    font-size: 13px;
    color: var(--gray-500);
    font-family: ui-monospace, Consolas, monospace;
    margin-bottom: 16px;
}

.pd-summary {
    font-size: 15px;
    color: var(--gray-600);
    line-height: 1.9;
    margin-bottom: 22px;
}

.pd-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-top: 1px solid var(--gray-200);
}

.pd-spec-table th,
.pd-spec-table td {
    border-bottom: 1px solid var(--gray-200);
    padding: 11px 0;
    text-align: left;
    vertical-align: top;
}

.pd-spec-table th {
    width: 100px;
    color: var(--gray-500);
    font-weight: 500;
}

.pd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.pd-actions .btn-light {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.pd-actions .btn-light:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.pd-related {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--gray-200);
}

.pd-related-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 22px;
}

.pd-related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.pd-related-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.pd-related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.pd-related-media {
    aspect-ratio: 4 / 3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    overflow: hidden;
}

.pd-related-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-related-icon svg {
    width: 44px;
    height: 44px;
}

.pd-related-body {
    padding: 14px 16px 18px;
}

.pd-related-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.pd-related-body p {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pd-back-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--primary);
    font-weight: 500;
}

@media (max-width: 992px) {
    .pd-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .pd-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pd-name {
        font-size: 24px;
    }

    .pd-related-grid {
        grid-template-columns: 1fr;
    }
}
