/* ============================================
   商品分类页面样式 - category_goods.css
   版本: 1.0
   更新时间: 2026-07-06
   ============================================ */

/* 容器 */
.category-container {
    width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    background-color: #ffffff;
}

/* ============================================
   分类区块样式
   ============================================ */
.category-section {
    margin-bottom: 40px;
}

/* 分类头部 */
.category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 24px;
    border-bottom: 2px solid #d92121;
    position: relative;
}

.category-header::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #d92121, #fbd5d5, transparent);
}

/* 分类图标 */
.category-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #d92121 0%, #ff4757 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(217, 33, 33, 0.3);
    flex-shrink: 0;
}

.category-icon svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

/* 分类标题组 */
.category-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.category-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
}

/* 子分类数量标签 */
.category-count {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background-color: #fef2f2;
    color: #d92121;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid #fde8e8;
    white-space: nowrap;
}

/* 查看全部链接 */
.category-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #999999;
    font-size: 14px;
    text-decoration: none;
    margin-left: auto;
    transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-more:hover {
    color: #d92121;
}

.category-more:hover svg {
    transform: translateX(3px);
}

/* ============================================
   商品网格
   ============================================ */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* ============================================
   商品卡片
   ============================================ */
.goods-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eeeeee;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.goods-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(217, 33, 33, 0.15);
    border-color: rgba(217, 33, 33, 0.3);
}

/* 图片容器 */
.card-img-wrapper {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background-color: #f5f5f5;
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.goods-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* 图片遮罩层 */
.card-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 40%, rgba(217, 33, 33, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-img-overlay span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transform: translateY(10px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.goods-card:hover .card-img-overlay {
    opacity: 1;
}

.goods-card:hover .card-img-overlay span {
    transform: translateY(0);
}

/* 文字区域 */
.card-text {
    padding: 12px 16px;
    text-align: center;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-name {
    font-size: 14px;
    color: #333333;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.goods-card:hover .card-name {
    color: #d92121;
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 1200px) {
    .category-container {
        width: 100%;
        max-width: 1200px;
    }
    
    .goods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-header {
        flex-wrap: wrap;
    }
    
    .category-more {
        margin-left: 0;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .category-section {
        margin-bottom: 32px;
    }
    
    .category-title {
        font-size: 18px;
    }
    
    .category-icon {
        width: 36px;
        height: 36px;
    }
    
    .category-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .category-container {
        padding: 20px 12px;
    }
    
    .goods-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-text {
        padding: 10px 12px;
    }
    
    .card-name {
        font-size: 13px;
    }
}
