/*!
 * 商城商品网格统一样式规范
 * 确保所有模块的商品展示风格一致
 */

/* 基础商品网格容器 */
.shop-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 商品网格布局 - 参考京东商城标准 */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 24px 0;
}

/* 商品卡片基础样式 - 京东风格优化 */
.shop-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.shop-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e33333;
}

/* 商品图片区域 - 京东风格优化 */
.shop-item-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: #f8f8f8;
}

.shop-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shop-item:hover .shop-item-image img {
    transform: scale(1.08);
}

/* 商品标签 */
.shop-item-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e33333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

/* 商品信息区域 - 京东风格优化 */
.shop-item-info {
    padding: 24px;
}

/* 商品标题 - 京东风格优化 */
.shop-item-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.4;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 700;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 商品描述 - 京东风格优化 */
.shop-item-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 400;
}

/* 价格区域 - 京东风格优化 */
.shop-item-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.shop-item-price-current {
    color: #e33333;
    font-size: 24px;
    font-weight: 800;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.shop-item-price-original {
    color: #999;
    font-size: 16px;
    text-decoration: line-through;
    font-weight: 400;
}

/* 库存和销量信息 - 京东风格优化 */
.shop-item-stats {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* 操作按钮区域 - 京东风格优化 */
.shop-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* 基础按钮样式 - 京东风格优化 */
.shop-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.shop-btn-primary {
    background: #e33333;
    color: white;
}

.shop-btn-primary:hover {
    background: #d42b2b;
}

.shop-btn-default {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e8e8e8;
}

.shop-btn-default:hover {
    background: #e8e8e8;
    border-color: #d9d9d9;
}

/* 积分商城特殊样式 */
.points-item .shop-item-price-current {
    color: #ff9502; /* 积分商品使用橙色 */
}

.points-item .shop-item-tag {
    background: #ff9502;
}

/* 响应式设计 - 京东风格优化 */
@media (max-width: 1400px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        padding: 20px 0;
    }
    
    .shop-item-image {
        height: 260px;
    }
    
    .shop-item-title {
        font-size: 17px;
        height: 48px;
    }
    
    .shop-item-price-current {
        font-size: 22px;
    }
}

@media (max-width: 1200px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
        padding: 18px 0;
    }
    
    .shop-item-image {
        height: 240px;
    }
    
    .shop-item-title {
        font-size: 16px;
        height: 44px;
    }
    
    .shop-item-price-current {
        font-size: 20px;
    }
}

@media (max-width: 992px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
        padding: 16px 0;
    }
    
    .shop-item-image {
        height: 220px;
    }
    
    .shop-item-info {
        padding: 20px;
    }
    
    .shop-item-title {
        font-size: 15px;
        height: 42px;
    }
    
    .shop-item-desc {
        font-size: 14px;
        height: 42px;
    }
    
    .shop-item-price-current {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px 0;
    }
    
    .shop-item-image {
        height: 200px;
    }
    
    .shop-item-info {
        padding: 16px;
    }
    
    .shop-item-title {
        font-size: 14px;
        height: 40px;
    }
    
    .shop-item-desc {
        font-size: 13px;
        height: 39px;
    }
    
    .shop-item-price-current {
        font-size: 16px;
    }
    
    .shop-item-price-original {
        font-size: 12px;
    }
    
    .shop-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .shop-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 0;
    }
    
    .shop-item-image {
        height: 180px;
    }
    
    .shop-item-info {
        padding: 14px;
    }
    
    .shop-item-title {
        font-size: 14px;
        height: 42px;
    }
    
    .shop-item-desc {
        font-size: 12px;
        height: 36px;
    }
    
    .shop-item-price-current {
        font-size: 15px;
    }
    
    .shop-item-price-original {
        font-size: 11px;
    }
    
    .shop-item-stats {
        font-size: 11px;
    }
    
    .shop-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 加载状态 */
.shop-grid-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
    color: #999;
}

.shop-grid-loading i {
    font-size: 24px;
    margin-right: 10px;
    animation: icon-spin 2s infinite linear;
}

/* 空状态 */
.shop-grid-empty {
    text-align: center;
    padding: 60px 0;
    color: #999;
}

.shop-grid-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.shop-grid-empty h3 {
    margin: 0 0 10px 0;
    color: #666;
}

.shop-grid-empty p {
    margin: 0;
    font-size: 14px;
}

/* 动画定义 */
@keyframes icon-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(359deg); }
}

/* 兼容性处理 */
@supports not (display: grid) {
    .shop-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .shop-item {
        width: calc(33.333% - 20px);
        margin-bottom: 20px;
    }
    
    @media (max-width: 768px) {
        .shop-item {
            width: calc(50% - 10px);
        }
    }
    
    @media (max-width: 480px) {
        .shop-item {
            width: 100%;
        }
    }
}