/* 商品卡片组件样式 - 避免冲突的命名 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.product-cards-wrapper {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    color: #333;
    line-height: 1.6;
}

.product-cards-container {
    width: 100%;
    margin: 0 auto;
    padding: 40px;
    margin-top: 40px;
}

.product-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.product-cards-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.product-cards-subtitle {
    font-size: 1.1rem;
    color: #666;
}

.product-cards-view-more {
    color: #666;
    text-decoration: none;
}

/* 商品网格 - 支持动态列数 */
.product-cards-grid {
    display: grid;
    grid-template-columns: repeat(var(--xs-cols, 2), 1fr);
    gap: var(--product-grid-gap, 24px);
    margin-bottom: 40px;
}

/* 商品卡片 */
.product-card-item {
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-card-item:hover {
    background-color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 商品图片容器 */
.product-card-image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 正方形比例 */
    overflow: hidden;
}

.product-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
    transition: transform 0.3s ease;
}

.product-card-item:hover .product-card-image {
    transform: scale(1.05);
}

.product-card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
}

/* 商品信息 */
.product-card-info {
    padding: 15px;
}

.product-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-brand {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.product-card-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ff4f24;
}

/* 悬停效果 */
.product-card-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 响应式设计 - 使用CSS变量控制列数 */

/* 默认列数设置 - 可通过JavaScript动态修改 */
:root {
    --xs-cols: 2;      /* 超小屏幕 <480px */
    --mobile-cols: 2;  /* 手机端 480px-768px */
    --tablet-cols: 3;  /* 平板端 768px-1024px */
    --desktop-cols: 4; /* PC端 >1024px */
    --product-grid-gap-xs: 10px;
    --product-grid-gap-sm: 12px;
    --product-grid-gap-md: 16px;
    --product-grid-gap-lg: 18px;
}

/* >1024px：PC端 */
@media (min-width: 1025px) {
    .product-cards-grid {
        grid-template-columns: repeat(var(--desktop-cols, 4), 1fr);
        gap: var(--product-grid-gap-lg, 18px);
    }
}

/* 768px-1024px：平板端 */
@media (max-width: 1024px) and (min-width: 769px) {
    .product-cards-container {
        padding: 0 20px;
    }
    
    .product-cards-grid {
        grid-template-columns: repeat(var(--tablet-cols, 3), 1fr);
        gap: var(--product-grid-gap-md, 16px);
    }
    
    .product-card-info {
        padding: 12px;
    }
    
    .product-card-name {
        font-size: 0.9rem;
    }
    
    .product-card-brand {
        font-size: 0.8rem;
    }
    
    .product-card-price {
        font-size: 1.05rem;
    }
}

/* 480px-768px：手机端 */
@media (max-width: 768px) and (min-width: 481px) {
    .product-cards-container {
        padding: 10px;
        margin-top: 30px;
    }
    .product-cards-header {
        margin-bottom: 15px;
    }

    
    .product-cards-title {
        font-size: 1.8rem;
    }
    
    .product-cards-grid {
        grid-template-columns: repeat(var(--mobile-cols, 2), 1fr);
        gap: var(--product-grid-gap-sm, 12px);
    }
    
    .product-card-info {
        padding: 12px;
    }
    
    .product-card-name {
        font-size: 0.85rem;
    }
    
    .product-card-brand {
        font-size: 0.8rem;
    }
    
    .product-card-price {
        font-size: 1rem;
    }
}

/* <480px：超小屏幕 */
@media (max-width: 480px) {
    .product-cards-container {
        padding: 10px;
        max-width: 100%;
    }
    
    .product-cards-title {
        font-size: 1.5rem;
    }
    
    .product-cards-grid {
        grid-template-columns: repeat(var(--xs-cols, 2), 1fr);
        gap: var(--product-grid-gap-xs, 10px);
    }
    
    .product-card-info {
        padding: 12px;
    }
    
    .product-card-name {
        font-size: 0.8rem;
    }
    
    .product-card-brand {
        font-size: 0.85rem;
    }
    
    .product-card-price {
        font-size: 1.1rem;
    }
}

/* 加载动画 */
.product-cards-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #666;
}

/* 空状态 */
.product-cards-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.product-cards-empty h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.product-cards-empty p {
    font-size: 0.9rem;
}

/* 商品卡片加载更多按钮样式 - 独立样式，不依赖热门商品组件 */
.product-cards-load-more-section {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.product-cards-load-more-btn {
    border: 1px solid #000;
    background: transparent;
    color: #000;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.product-cards-load-more-btn:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

.product-cards-load-more-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
}

.product-cards-load-more-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-cards-load-more-btn.loading::after {
    content: " 加载中...";
}