/* 商品搜索页 - 简洁卡片样式 */

/* 重置容器样式 */
.listwrap, .listbox, #filter_list, #blk_list_list {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 商品网格布局 */
.product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    padding: 20px 0 !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 商品卡片 */
.product-card {
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e8e8e8 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    float: none !important;
}

.product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}

/* 商品图片区域 */
.product-image {
    position: relative !important;
    height: 160px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    width: 100% !important;
}

.product-image img {
    width: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
    display: block !important;
}

.product-card:hover .product-image img {
    transform: scale(1.05) !important;
}

/* 商品标签 */
.product-tag {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: #4CAF50 !important;
    color: white !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    z-index: 2 !important;
}

/* 商品信息区域 */
.product-info {
    padding: 12px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

.product-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    color: #333 !important;
    word-break: break-word !important;
}

/* 价格区域 */
.product-price {
    margin: 5px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.current-price {
    color: #e74c3c !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.original-price {
    color: #999 !important;
    font-size: 14px !important;
    text-decoration: line-through !important;
}

/* 商品元信息 */
.product-meta {
    margin-top: auto !important;
    display: flex !important;
    justify-content: space-between !important;
    color: #666 !important;
    font-size: 12px !important;
}

/* 热门排名样式 - 专门针对侧边栏排名 */
.sidebar .sbcont h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #e8e8e8 !important;
}

.sidebar .sbcont h3 .green-line {
    display: none !important;
}

.sidebar .viewbuy-box {
    list-style: none !important;
    padding: 0 !important;
}

.sidebar .viewbuy-box li {
    margin-bottom: 15px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
}

.sidebar .rank-link {
    display: flex !important;
    align-items: center !important;
    padding: 12px !important;
    background: #fff !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    color: inherit !important;
}

.sidebar .rank-link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.sidebar .ico-rank {
    width: 24px !important;
    height: 24px !important;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
    color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: bold !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

/* 金银铜牌样式 - 使用更精确的选择器 */
.sidebar .viewbuy-box li:nth-child(1) .ico-rank {
    background: linear-gradient(135deg, #ffd700, #ffb347) !important;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}

.sidebar .viewbuy-box li:nth-child(2) .ico-rank {
    background: linear-gradient(135deg, #c0c0c0, #a9a9a9) !important;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3) !important;
}

.sidebar .viewbuy-box li:nth-child(3) .ico-rank {
    background: linear-gradient(135deg, #cd7f32, #b8860b) !important;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3) !important;
}

.sidebar .djimg {
    width: 105px !important;
    height: 60px !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

.sidebar .djimg img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

.sidebar .djinfo {
    flex: 1 !important;
    min-width: 0 !important;
}

.sidebar .djname {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.4 !important;
    margin-bottom: 6px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.sidebar .djprice {
    font-size: 12px !important;
    color: #666 !important;
    margin-bottom: 4px !important;
}

.sidebar .djcpri {
    font-size: 12px !important;
    color: #333 !important;
}

.sidebar .djcpri strong {
    color: #e74c3c !important;
    font-size: 12px !important;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 15px !important;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 10px !important;
        padding: 15px 0 !important;
    }
    
    .product-image {
        height: 180px !important;
    }
    
    .product-info {
        padding: 12px !important;
    }
    
    .product-title {
        font-size: 14px !important;
        height: 40px !important;
    }
    
    .current-price {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 8px 0 !important;
    }
    
    .product-image {
        height: 160px !important;
    }
    
    .product-info {
        padding: 10px !important;
    }
}

/* 强制覆盖可能的冲突样式 */
.listbox .product-grid,
#blk_list_list .product-grid,
#filter_list .product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 20px !important;
    padding: 20px 0 !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 确保卡片在网格中正确对齐 */
.product-card {
    box-sizing: border-box !important;
    margin: 0 !important;
    float: none !important;
    clear: both !important;
}

/* 修复可能的浮动问题 */
.clearfix::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* 确保所有相关元素都使用正确的盒模型 */
.listwrap *, .listbox *, #filter_list *, #blk_list_list * {
    box-sizing: border-box !important;
}
