/**
 * WooCommerce 通用产品样式
 * 用于：产品分类页、商店页
 * 文件位置: /wp-content/themes/njbohang-themes/css/woocommerce-common.css
 */

/* ==================== 产品网格 ==================== */
.products {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    list-style: none;
    margin: 30px;/* 修改这里：上边距30px，右边距0，下边距0，左边距0 */
    padding: 0;
	clear: both;  /* ← 添加这一行，清除浮动 */
}

@media (min-width: 640px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 产品卡片 */
.product {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #eef2ff;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #c7d2fe;
}

.product a {
    text-decoration: none;
}

/* 产品图片 - 使用默认比例 */
.product img {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product:hover img {
    transform: scale(1.02);
}

.woocommerce-loop-product__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 12px 16px 0;
    margin: 0;
    line-height: 1.4;
}

.price {
    display: block;
    padding: 8px 16px;
    color: #4f46e5;
    font-weight: bold;
    font-size: 1.125rem;
}

.button {
    display: inline-block;
    margin: 8px 16px 16px;
    padding: 8px 20px;
    background: #4f46e5;
    color: white;
    border-radius: 30px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.button:hover {
    background: #4338ca;
    transform: translateY(-2px);
}

/* ==================== 排序和结果计数 ==================== */
.woocommerce-result-count {
    float: left;
    color: #64748b;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.woocommerce-ordering {
    float: left;
   	margin-left: 20px; /* 与结果计数保持间距 */
}

.woocommerce-ordering select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #1e293b;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.woocommerce-ordering select:focus {
    border-color: #4f46e5;
}

/* 清除浮动 */
.woocommerce-notices-wrapper + .woocommerce-result-count,
.woocommerce-notices-wrapper + .woocommerce-ordering {
    margin-top: 0;
}

/* ==================== 分页样式 ==================== */
.woocommerce-pagination {
    clear: both;
    margin-top: 40px;
    text-align: center;
}

.woocommerce-pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.woocommerce-pagination .page-numbers li {
    display: inline-block;
    margin: 0;
}

.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: inline-block;
    min-width: 40px;
    height: 40px;
    line-height: 40px;
    padding: 0 12px;
    text-align: center;
    border-radius: 8px;
    background: white;
    color: #4f46e5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.woocommerce-pagination .page-numbers a:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.woocommerce-pagination .page-numbers .current {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.woocommerce-pagination .page-numbers .dots {
    background: transparent;
    border: none;
    color: #94a3b8;
}

/* 上一页/下一页箭头样式 */
.woocommerce-pagination .page-numbers .prev,
.woocommerce-pagination .page-numbers .next {
    font-size: 16px;
    padding: 0 16px;
}

/* ==================== 无产品提示 ==================== */
.woocommerce-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: #64748b;
}

/* ==================== 响应式调整 ==================== */
@media (max-width: 768px) {
    .woocommerce-result-count,
    .woocommerce-ordering {
        float: none;
        text-align: center;
        margin-bottom: 16px;
    }
    
    .woocommerce-ordering select {
        width: 100%;
        max-width: 280px;
    }
    
    .woocommerce-pagination .page-numbers a,
    .woocommerce-pagination .page-numbers span {
        min-width: 36px;
        height: 36px;
        line-height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }
}