/* WordPress电商分佣商品插件 - 前端样式 */

/* 商品列表容器 */
.wpea-products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* 搜索结果标题 */
.wpea-search-results {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wpea-search-results h2 {
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 600;
}

/* 筛选表单 */
.wpea-filters {
    margin-bottom: 30px;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
}

.wpea-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.wpea-filter-group {
    flex: 1;
    min-width: 150px;
}

.wpea-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.wpea-filter-group input,
.wpea-filter-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.wpea-filter-group input:focus,
.wpea-filter-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.wpea-search-btn,
.wpea-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.wpea-search-btn {
    background: #007cba;
    color: white;
}

.wpea-search-btn:hover {
    background: #006ba1;
}

.wpea-reset-btn {
    background: #f1f1f1;
    color: #333;
    margin-left: 10px;
}

.wpea-reset-btn:hover {
    background: #e1e1e1;
}

/* 商品网格 */
.wpea-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 商品卡片 */
.wpea-product-card {
    position: relative;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.wpea-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 平台标识 */
.wpea-product-platform {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1;
}

.wpea-platform-name {
    display: none;
}

@media (min-width: 768px) {
    .wpea-platform-name {
        display: inline;
    }
}

/* 商品图片 */
.wpea-product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f9f9f9;
}

.wpea-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

/* 折扣标签 */
.wpea-product-discount {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #d63638;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

/* 商品信息 */
.wpea-product-info {
    padding: 20px;
}

/* 商品标题 */
.wpea-product-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    height: 45px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wpea-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.wpea-product-title a:hover {
    color: #007cba;
}

/* 商品价格 */
.wpea-product-price {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpea-current-price {
    font-size: 20px;
    font-weight: 700;
    color: #d63638;
}

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

/* 佣金信息 */
.wpea-product-commission {
    margin-bottom: 10px;
    font-size: 14px;
    color: #46b450;
    font-weight: 500;
}

.wpea-commission-label {
    color: #666;
}

/* 商品分类 */
.wpea-product-category {
    margin-bottom: 15px;
    font-size: 13px;
}

.wpea-product-category a {
    color: #666;
    text-decoration: none;
    background: #f1f1f1;
    padding: 3px 8px;
    border-radius: 3px;
    transition: all 0.3s;
}

.wpea-product-category a:hover {
    background: #e1e1e1;
    color: #333;
}

/* 购买按钮 */
.wpea-product-actions {
    margin-top: 20px;
}

.wpea-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #d63638;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}

.wpea-buy-btn:hover {
    background: #c52224;
    color: white;
}

/* 分页 */
.wpea-pagination {
    text-align: center;
    margin: 40px 0;
}

.wpea-pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.wpea-pagination .page-numbers:hover {
    background: #f1f1f1;
    border-color: #ccc;
}

.wpea-pagination .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.wpea-pagination .prev,
.wpea-pagination .next {
    background: #f9f9f9;
}

.wpea-pagination .prev:hover,
.wpea-pagination .next:hover {
    background: #f1f1f1;
}

/* 无商品提示 */
.wpea-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.wpea-no-products-icon {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.wpea-no-products h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #333;
}

/* 短代码样式 */
.wpea-shortcode-products {
    margin: 30px 0;
}

.wpea-shortcode-product {
    display: flex;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    background: white;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .wpea-shortcode-product {
        flex-direction: column;
    }
}

.wpea-shortcode-product .wpea-product-image {
    flex: 0 0 200px;
    padding-top: 200px;
}

@media (max-width: 768px) {
    .wpea-shortcode-product .wpea-product-image {
        flex: 0 0 auto;
        padding-top: 100%;
    }
}

.wpea-shortcode-product .wpea-product-info {
    flex: 1;
}

.wpea-shortcode-product .wpea-product-title {
    height: auto;
    -webkit-line-clamp: unset;
    margin-bottom: 15px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .wpea-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .wpea-filter-form {
        flex-direction: column;
    }
    
    .wpea-filter-group {
        min-width: 100%;
    }
    
    .wpea-pagination .page-numbers {
        padding: 6px 12px;
        margin: 0 3px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wpea-products-grid {
        grid-template-columns: 1fr;
    }
    
    .wpea-product-info {
        padding: 15px;
    }
    
    .wpea-product-title {
        font-size: 15px;
    }
    
    .wpea-current-price {
        font-size: 18px;
    }
}