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

/* 主体区域 */
/* 覆盖main的overflow属性，使sticky定位生效 */

.products-main {
    position: relative;
}

.products-main__container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* 产品内容区域 */
.products-content {
    min-height: 600px;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.products-header__info {
    font-size: 0.95rem;
    color: var(--muted);
}

.products-header__info strong {
    color: var(--primary);
    font-weight: 600;
}

.sort-select {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--fg);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-select:hover {
    border-color: var(--primary);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(54, 153, 102, 0.1);
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* 产品卡片 */
.product-item {
    background: var(--card);
    /* border: 1px solid var(--border); */
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
}

.product-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 55px rgba(15, 23, 42, 0.2);
    /* border-color: var(--primary); */
}

.product-item__image {
    width: 100%;
    background: linear-gradient(135deg, rgba(54, 153, 102, 0.08), rgba(255, 102, 0, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
/*.product-item__image img{*/
/*    object-fit: contain;*/
/*}*/
.product-placeholder {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.product-item__content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-item__title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: var(--fg);
    font-weight: 600;
}

.product-item__desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 1rem;
    flex: 1;
    /* 多行省略：优先使用 -webkit-line-clamp，兼容常见现代浏览器 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 非 -webkit 浏览器的降级处理：限制最大高度，超出内容隐藏 */
     max-height: calc(1.6em * 2); 
}

.product-item__specs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(54, 153, 102, 0.05);
    border-radius: 12px;
}

.product-item__specs span {
    font-size: 0.85rem;
    color: var(--muted);
}

.product-item__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    background: var(--secondary);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-align: center;
}

.product-item__link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(54, 153, 102, 0.3);
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .products-main__container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* .sidebar-container {
        position: static;
        max-height: none;
    } */

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-banner {
        padding: 6rem 1.5rem 3rem;
    }

    .products-banner__content h1 {
        font-size: 2rem;
    }

    .products-banner__content p {
        font-size: 1rem;
    }

    /* .breadcrumb {
        padding: 0 1.5rem;
    } */

    .products-main {
        padding: 0 0 3rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .pagination__pages {
        flex-wrap: wrap;
    }
}