/**
 * 商品列表多样式布局 CSS
 * 支持卡片式、列表式、紧凑式三种布局
 */

/* 通用样式 */
.goods-list-section {
    margin-top: 20px;
}

/* 卡片式布局 */
.goods-grid {
    display: grid;
    gap: 15px;
}

.goods-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.goods-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.goods-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.goods-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.goods-grid.cols-6 { grid-template-columns: repeat(6, 1fr); }

.goods-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

.goods-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: transparent;
    z-index: 2;
    text-decoration: none;
    color: inherit;
}

.goods-img-box {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f9f9f9;
    overflow: hidden;
}

.goods-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.goods-card:hover .goods-img {
    transform: scale(1.08);
}

.goods-info {
    padding: 12px;
}

.goods-title {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    height: 42px;
    margin-bottom: 10px;
    font-weight: 500;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.goods-price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.price-current {
    color: #ff4d4f;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
}

.price-current small {
    font-size: 12px;
    margin-right: 1px;
}

.price-market {
    color: #ccc;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}

.buy-icon {
    width: 24px;
    height: 24px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    transition: all 0.2s;
}

.goods-card:hover .buy-icon {
    background: #2196F3;
    color: #fff;
}

/* 列表式布局 */
.goods-list-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.goods-list-item {
    display: flex;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    padding: 15px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.goods-list-item:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: #2196F3;
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.goods-list-img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 15px;
    background: #f9f9f9;
}

.goods-list-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.goods-list-item:hover .goods-list-img img {
    transform: scale(1.1);
}

.goods-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.goods-list-title {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.goods-list-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 10px;
    line-height: 1.3;
}

.goods-list-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.goods-list-price .price-current {
    font-size: 20px;
}

.goods-list-buy {
    background: #2196F3;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.goods-list-buy:hover {
    background: #1976D2;
    transform: scale(1.05);
}

/* 紧凑式布局 */
.goods-compact-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.goods-compact-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.goods-compact-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    border-color: #2196F3;
    text-decoration: none;
    color: inherit;
}

.goods-compact-img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    background: #f9f9f9;
}

.goods-compact-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.goods-compact-content {
    flex: 1;
    min-width: 0;
}

.goods-compact-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.goods-compact-price {
    font-size: 16px;
    color: #ff4d4f;
    font-weight: bold;
}

.goods-compact-price small {
    font-size: 11px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .goods-grid.cols-6 { grid-template-columns: repeat(5, 1fr); }
    .goods-grid.cols-5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 992px) {
    .goods-grid.cols-6,
    .goods-grid.cols-5,
    .goods-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .goods-grid.cols-6,
    .goods-grid.cols-5,
    .goods-grid.cols-4,
    .goods-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    
    .goods-list-item {
        flex-direction: column;
        text-align: center;
    }
    
    .goods-list-img {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .goods-grid { grid-template-columns: repeat(2, 1fr); }
    
    .goods-list-item {
        padding: 12px;
    }
    
    .goods-list-img {
        width: 60px;
        height: 60px;
    }
    
    .goods-compact-img {
        width: 40px;
        height: 40px;
    }
}

/* 动画效果 */
.layui-anim-scaleSpring {
    animation-duration: 0.6s;
    animation-fill-mode: both;
}

.layui-anim-fadeInUp {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.layui-anim-fadeInLeft {
    animation-duration: 0.4s;
    animation-fill-mode: both;
}

/* 工具类 */
.row-2-hidden {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}