/* ==================== 产品列表页样式 ==================== */

/* Hero 区域 */
.product-hero-section {
    background: #ffffff;
    padding: 80px 0 56px;
    text-align: left;
}

.product-hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 面包屑导航 */
.product-hero-breadcrumb {
    margin-bottom: 16px;
    font-family: "poppins"!important;
}

.product-hero-breadcrumb .breadcrumbs {
    font-size: 14px;
    color: #999;
    background: transparent;
    padding: 0;
}

.product-hero-breadcrumb .breadcrumbs nav {
    padding: 20px 0 0;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-hero-breadcrumb .breadcrumbs a,
.product-hero-breadcrumb nav a {
    color: #666;
    text-decoration: none;
}

.product-hero-breadcrumb .breadcrumbs a:hover,
.product-hero-breadcrumb nav a:hover {
    color: #f29900;
}

.product-hero-breadcrumb .current,
.product-hero-breadcrumb .breadcrumb_last {
    color: #1a1a2e;
    font-weight: 500;
}

.product-page-title {
    font-size: 42px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px 0;
}

.product-page-desc {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0;
}

/* ==================== 筛选区域 (药丸风格 - 同 Blog) ==================== */
.product-filter {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.product-filter-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.product-filter-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.product-filter-tabs::-webkit-scrollbar {
    height: 0;
}

.product-filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.product-filter-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.product-filter-tab.active {
    background: #1a1a2e;
    color: #fff;
}

/* ==================== 产品列表 ==================== */
.product-list-section {
    background: #fff;
    padding: 48px 0 140px;
}

.product-list-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* ==================== 产品卡片 ==================== */
.product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s, transform 0.3s;
}

.product-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.product-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 卡片图片 */
.product-card-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.5s;
}

.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

.product-card-placeholder {
    font-size: 48px;
    color: #dee2e6;
}

/* ==================== 拐角圆角标签 (Blog 同款) ==================== */
.product-card-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #fff;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 15px 20px;
    border-top-right-radius: 16px;
    z-index: 2;
}

.product-card-tag::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 100%;
    width: 16px;
    height: 16px;
    background: transparent;
    border-bottom-left-radius: 16px;
    box-shadow: -8px 8px 0 8px #fff;
}

.product-card-tag::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 16px;
    height: 16px;
    background: transparent;
    border-bottom-left-radius: 16px;
    box-shadow: -8px 8px 0 8px #fff;
}

/* 卡片内容区 */
.product-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #1a1a2e;
    margin: 0 0 14px 0;
    min-height: 2.8em;  /* 2行高度，保持对齐 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片内规格小标签 */
.product-card-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* PC: 3列 */
    gap: 10px 12px;
    margin-bottom: 20px;
}

/* 移动端: 2列，只显示前4个 */
@media screen and (max-width: 1024px) {
    .product-card-specs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card-specs .product-spec-mini:nth-child(n+5) {
        display: none;
    }
}

.product-spec-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-mini-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spec-mini-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* ==================== 线条按钮 (Blog 同款 - 在链接内) ==================== */
.product-card-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    color: #1a1a2e;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid #1a1a2e;
    border-radius: 50px;
    transition: all 0.2s ease;
    margin-top: auto;
    box-sizing: border-box;
}

.product-card-btn:hover {
    background: #1a1a2e;
    color: #fff;
}

/* ==================== 卡片底部操作栏 (View Details + Compare 两端对齐) ==================== */
.product-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px 24px;
    margin-top: 0;
}

.product-card .product-card-btn {
    display: none;
}

.product-card-btn-sm {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid #1a1a2e;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.product-card-btn-sm:hover {
    background: #1a1a2e;
    color: #fff;
}

/* ==================== Compare 按钮 ==================== */
.product-compare-check {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.product-compare-check:hover {
    border-color: #f29900;
    color: #f29900;
}

.product-compare-check.checked {
    background: rgba(242,153,0,.08);
    border-color: #f29900;
    color: #f29900;
}

.product-compare-check.checked::before {
    content: '\2713';
    font-size: 10px;
    font-weight: 700;
}

.product-compare-check:not(.checked)::before {
    content: '+';
    font-size: 13px;
    font-weight: 500;
}

.product-compare-check.disabled {
    opacity: .35;
    pointer-events: none;
    cursor: not-allowed;
}

/* ==================== 浮动对比栏 (胶囊样式) ==================== */
.compare-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.15);
    display: none;
    align-items: center;
    padding: 12px 16px 12px 16px;
    gap: 12px;
    z-index: 99999 !important;
    border: 1px solid #f0f0f0;
    max-width: 90vw;
}

.compare-bar.visible {
    display: flex;
}

/* 关闭按钮（右上角，替换 Clear all） */
.compare-bar-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1a1a2e;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 10;
}

.compare-bar-close:hover {
    background: #f29900;
}

.compare-bar-close:hover {
    background: #f29900;
}

/* 吸底模式：滚动到 footer 附近时吸附在 footer 上方，居中 */
.compare-bar.docked {
    position: absolute;
    bottom: auto;
}

.compare-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-right: 4px;
    white-space: nowrap;
}

.compare-chips {
    display: flex;
    gap: 12px;
}

.compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    padding: 4px 8px 4px 4px;
    border-radius: 8px;
    font-size: 12px;
    color: #333;
    font-weight: 500;
    transition: .2s;
    flex-shrink: 0;
    max-width: 140px;
}

.compare-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
}

.compare-chip:hover {
    background: #eee;
}

.compare-chip-image {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

.compare-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: .2s;
    border: none;
    padding: 0;
    flex-shrink: 0;
}

.compare-chip-remove:hover {
    background: #f29900;
    color: #fff;
}

.compare-bar-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: #f29900;
    color: #fff;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: .2s;
    white-space: nowrap;
}

.compare-bar-cta:hover {
    background: #e08a00;
}

.compare-bar-cta.disabled {
    background: #ccc;
    pointer-events: none;
    cursor: not-allowed;
}

.compare-bar-cta i {
    font-size: 12px;
}

/* ==================== Toast 提示 ==================== */
.compare-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.compare-toast.show {
    display: block;
    animation: compareToastIn .3s ease;
}

@keyframes compareToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==================== 分页 ==================== */
.product-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.product-pagination a,
.product-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #fff;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.product-pagination a:hover,
.product-pagination .current {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

/* ==================== 空状态 ==================== */
.product-empty {
    text-align: center;
    padding: 80px 0;
}

.product-empty p {
    font-size: 18px;
    color: #666;
}

/* ==================== View All 按钮 ==================== */
.product-view-all {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.product-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: #1a1a2e;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.product-view-all-btn:hover {
    background: #f29900;
    transform: translateX(4px);
}

.product-view-all-btn i {
    font-size: 12px;
    transition: transform 0.3s;
}

.product-view-all-btn:hover i {
    transform: translateX(4px);
}

/* ==================== 简码专用样式 ==================== */
.product-list-shortcode .product-filter--shortcode {
    position: static;
    border-bottom: none;
}

/* 强制简码内链接颜色，覆盖全局 .post_content a */
.product-list-shortcode a,
.product-list-shortcode .product-card-btn-sm,
.product-list-shortcode .product-view-all-btn {
    color: inherit !important;
}

.product-list-shortcode .product-filter-tab {
    color: #666 !important;
}

.product-list-shortcode .product-filter-tab.active {
    color: #fff !important;
}

.product-list-shortcode .product-card-btn-sm {
    color: #1a1a2e !important;
}

.product-list-shortcode .product-card-btn-sm:hover {
    color: #fff !important;
}

.product-list-shortcode .product-compare-check {
    color: #666 !important;
}

.product-list-shortcode .product-compare-check:hover {
    color: #f29900 !important;
}

.product-list-shortcode .product-compare-check.checked {
    color: #f29900 !important;
}

.product-list-shortcode .product-view-all-btn {
    color: #fff !important;
}

.product-grid--shortcode {
    margin-bottom: 30px;
}

/* 简码列数控制 */
.product-grid--cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid--cols-2 .product-card-specs {
    grid-template-columns: repeat(2, 1fr);
}

.product-grid--cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.product-grid--cols-3 .product-card-specs {
    grid-template-columns: repeat(3, 1fr);
}

/* 简码移动端 */
@media screen and (max-width: 1024px) {
    .product-grid--shortcode {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .product-grid--shortcode .product-card-specs {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .product-grid--shortcode .product-card-specs .product-spec-mini:nth-child(n+5) {
        display: none;
    }
}

@media screen and (max-width: 768px) {
    .product-grid--shortcode {
        grid-template-columns: 1fr !important;
    }
}

/* ==================== 响应式 ==================== */
@media screen and (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .product-hero-section {
        padding: 48px 0 40px;
    }
    
    .product-page-title {
        font-size: 28px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-filter-tabs {
        flex-wrap: nowrap;
    }
    
    .product-card-image {
        height: 200px;
    }
    
    .compare-bar {
        left: 12px;
        right: 12px;
        transform: none;
        border-radius: 16px;
        bottom: 12px;
        padding: 12px 12px 12px 16px;
    }

    .compare-bar.docked {
        left: 12px;
        right: 12px;
        transform: none;
    }
    
    .compare-chips {
        overflow-x: auto;
        flex: 1;
    }
    
    /* 移动端只显示前2个芯片 */
    .compare-chips .compare-chip:nth-child(n+3) {
        display: none;
    }
    
    .product-card-actions {
        padding: 0 16px 20px;
        gap: 8px;
    }
    
    .product-compare-check {
        padding: 10px 14px;
        font-size: 12px;
    }
}
