/**
 * Advanced Search 简洁统一样式
 * 整齐的布局设计
 */

/* ========== 基础重置 ========== */
.products-wrapper * {
    box-sizing: border-box;
}

/* ========== 网格视图 - 简洁设计 ========== */
.products-wrapper.grid-view .product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 0;
    height: 100%;
    transition: all 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.products-wrapper.grid-view .product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* 图片容器 */
.products-wrapper.grid-view .product-image-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-wrapper.grid-view .product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

/* 产品信息 */
.products-wrapper.grid-view .product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 产品名称 */
.products-wrapper.grid-view .product-name {
    font-size: 13px;
    font-weight: 400;
    color: #333;
    height: 36px;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

.products-wrapper.grid-view .product-name a {
    color: inherit;
    text-decoration: none;
}

.products-wrapper.grid-view .product-name a:hover {
    color: #000;
}

/* 评分 - 简化版 */
.grid-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
}

.grid-rating-stars {
    color: #ffc107;
}

.grid-rating-stars .star {
    font-size: 11px;
}

/* 价格 */
.products-wrapper.grid-view .product-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 4px 0;
}

.products-wrapper.grid-view .price-new {
    font-size: 16px;
    font-weight: 600;
    color: #c41e3a;
}

.products-wrapper.grid-view .price-old {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

/* 操作按钮区域 - 整齐对齐 */
.grid-product-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

/* 购物车按钮 */
.products-wrapper.grid-view .add-to-cart,
.products-wrapper.grid-view .grid-btn-view {
    flex: 1;
    height: 36px;
    background: #c41e3a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.2s;
    text-decoration: none;
}

.products-wrapper.grid-view .add-to-cart:hover,
.products-wrapper.grid-view .grid-btn-view:hover {
    background: #a01729;
}

.products-wrapper.grid-view .add-to-cart i,
.products-wrapper.grid-view .grid-btn-view i {
    font-size: 14px;
}

/* 收藏按钮 */
.grid-secondary-actions {
    display: flex;
    gap: 4px;
}

.grid-btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.grid-btn-icon:hover {
    border-color: #c41e3a;
    color: #c41e3a;
}

.grid-btn-icon.active {
    background: #c41e3a;
    border-color: #c41e3a;
    color: #fff;
}

.grid-btn-icon i {
    font-size: 14px;
}

/* 折扣标签 */
.grid-discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #c41e3a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    z-index: 2;
}

/* ========== 列表视图 - 简洁设计 ========== */
.pc-enhanced-product-card {
    display: flex;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 15px;
    transition: all 0.2s;
}

.pc-enhanced-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 列表视图图片 */
.pc-product-image-wrapper {
    width: 180px;
    height: 180px;
    background: #fafafa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    margin-right: 20px;
}

.pc-product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

/* 列表视图信息 */
.pc-product-info-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pc-product-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.pc-product-title a {
    color: inherit;
    text-decoration: none;
}

.pc-product-title a:hover {
    color: #000;
}

.pc-product-description {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}

.pc-product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pc-rating-stars {
    color: #ffc107;
}

.pc-rating-stars .star {
    font-size: 13px;
}

.pc-rating-score {
    font-weight: 500;
    color: #333;
}

.pc-rating-count {
    color: #666;
    font-size: 12px;
}

/* 列表视图价格和按钮 */
.pc-product-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.pc-price-wrapper {
    display: flex;
    flex-direction: column;
}

.pc-price-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
}

.pc-price-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pc-price-current {
    font-size: 20px;
    font-weight: 600;
    color: #c41e3a;
}

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

.pc-action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pc-btn-add-cart {
    height: 40px;
    padding: 0 20px;
    background: #c41e3a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    text-decoration: none;
}

.pc-btn-add-cart:hover {
    background: #a01729;
}

.pc-secondary-actions {
    display: flex;
    gap: 6px;
}

.pc-btn-icon {
    width: 40px;
    height: 40px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pc-btn-icon:hover {
    border-color: #c41e3a;
    color: #c41e3a;
}

.pc-btn-icon.active {
    background: #c41e3a;
    border-color: #c41e3a;
    color: #fff;
}

/* 折扣标签 */
.pc-discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #c41e3a;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* 隐藏不必要的元素 */
.pc-product-features,
.pc-product-badges,
.grid-product-badges,
.pc-btn-quick-view,
.grid-quick-view,
.pc-product-brand,
.pc-price-save {
    display: none !important;
}

/* ========== 移动端优化 ========== */
@media (max-width: 768px) {
    /* 网格视图移动端 - 正方形设计 */
    .products-wrapper.grid-view .col-6 {
        padding: 5px;
    }
    
    .products-wrapper.grid-view .product-card {
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .products-wrapper.grid-view .product-image-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 100%; /* 创建正方形 */
        height: 0;
        overflow: hidden;
        background: #fafafa;
    }
    
    .products-wrapper.grid-view .product-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 10px;
    }
    
    .products-wrapper.grid-view .product-info {
        padding: 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    
    .products-wrapper.grid-view .product-name {
        font-size: 12px;
        height: 32px;
    }
    
    .products-wrapper.grid-view .price-new {
        font-size: 14px;
    }
    
    .products-wrapper.grid-view .add-to-cart,
    .products-wrapper.grid-view .grid-btn-view {
        height: 32px;
        font-size: 11px;
    }
    
    .products-wrapper.grid-view .add-to-cart span,
    .products-wrapper.grid-view .grid-btn-view span {
        display: none;
    }
    
    .products-wrapper.grid-view .add-to-cart i,
    .products-wrapper.grid-view .grid-btn-view i {
        margin: 0;
    }
    
    .grid-btn-icon {
        width: 32px;
        height: 32px;
    }
    
    /* 列表视图移动端 - 卡片式布局 */
    .products-wrapper.list-view {
        padding: 0 10px;
    }
    
    .pc-enhanced-product-card {
        flex-direction: row;
        padding: 10px;
        margin-bottom: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .pc-product-image-wrapper {
        width: 100px;
        height: 100px;
        margin-right: 12px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .pc-product-image-wrapper img {
        padding: 8px;
    }
    
    .pc-product-info-wrapper {
        flex: 1;
        padding: 0;
        min-width: 0;
    }
    
    .pc-product-title {
        font-size: 13px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .pc-product-description {
        display: none;
    }
    
    .pc-product-rating {
        margin-bottom: 6px;
    }
    
    .pc-rating-stars .star {
        font-size: 10px;
    }
    
    .pc-rating-score,
    .pc-rating-count {
        font-size: 10px;
    }
    
    .pc-product-actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-top: 8px;
    }
    
    .pc-price-wrapper {
        flex: 0 0 auto;
    }
    
    .pc-price-label {
        display: none;
    }
    
    .pc-price-current {
        font-size: 16px;
    }
    
    .pc-price-original {
        font-size: 12px;
    }
    
    .pc-action-buttons {
        flex: 0 0 auto;
        display: flex;
        gap: 6px;
    }
    
    .pc-btn-add-cart {
        height: 32px;
        padding: 0 12px;
        font-size: 12px;
    }
    
    .pc-btn-add-cart span {
        display: none;
    }
    
    .pc-btn-icon {
        width: 32px;
        height: 32px;
    }
    
    .pc-btn-icon i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .products-wrapper.grid-view .col-6 {
        width: 50%;
    }
    
    .products-wrapper.grid-view .product-image-wrapper {
        height: 120px;
    }
    
    .grid-product-rating {
        display: none;
    }
}
