/**
 * 5JYC 商品列表页面自定义样式 - 工品一号风格 v2
 * 优化：产品名称截断、价格突出、分类栏美化
 */

/* ========== 产品网格布局 ========== */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 15px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* ========== 产品卡片 ========== */
ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

ul.products li.product:hover {
    border-color: #1890ff !important;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.15) !important;
    transform: translateY(-2px) !important;
}

/* ========== 产品图片 ========== */
ul.products li.product .astra-shop-thumbnail-wrap,
ul.products li.product a.woocommerce-LoopProduct-link {
    width: 100% !important;
    display: block !important;
}

ul.products li.product img {
    height: 160px !important;
    object-fit: contain !important;
    padding: 15px !important;
    background: #f9f9f9 !important;
    transition: transform 0.3s ease !important;
    width: 100% !important;
}

ul.products li.product:hover img {
    transform: scale(1.08) !important;
}

/* ========== 隐藏分类标签 ========== */
ul.products li.product .ast-woo-product-category {
    display: none !important;
}

/* ========== 产品信息区域 ========== */
ul.products li.product .astra-shop-summary-wrap {
    padding: 12px !important;
}

/* ========== 产品标题 - 截取2行 ========== */
ul.products li.product .woocommerce-loop-product__title {
    font-size: 13px !important;
    color: #333 !important;
    line-height: 1.5 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-height: 39px !important;
    max-height: 39px !important;
    font-weight: 500 !important;
}

ul.products li.product .woocommerce-loop-product__title a,
ul.products li.product .woocommerce-loop-product__title a:hover {
    text-decoration: none !important;
    color: inherit !important;
}

/* ========== 产品价格 ========== */
ul.products li.product .price {
    font-size: 16px !important;
    color: #e4393c !important;
    font-weight: 700 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
    display: block !important;
    line-height: 1.3 !important;
}

ul.products li.product .price .woocommerce-Price-currencySymbol {
    font-size: 14px !important;
    vertical-align: top !important;
    margin-right: 1px !important;
}

ul.products li.product .price del {
    color: #999 !important;
    font-size: 12px !important;
    font-weight: 400 !important;
}

ul.products li.product .price ins {
    text-decoration: none !important;
    color: #e4393c !important;
}

/* ========== 隐藏加入购物车按钮 ========== */
ul.products li.product .button,
ul.products li.product .add_to_cart_button,
ul.products li.product .product_type_simple,
ul.products li.product .product_type_variable {
    display: none !important;
}

/* ========== 隐藏屏幕阅读器文字 ========== */
ul.products li.product .screen-reader-text {
    display: none !important;
}

/* ========== 页面标题 ========== */
.page-title,
.woocommerce-products-header__title {
    font-size: 24px !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid #1890ff !important;
}

/* ========== 面包屑 ========== */
.woocommerce-breadcrumb {
    font-size: 13px !important;
    color: #999 !important;
    margin-bottom: 15px !important;
}

.woocommerce-breadcrumb a {
    color: #1890ff !important;
    text-decoration: none !important;
}

/* ========== 排序和结果计数 ========== */
.woocommerce-result-count {
    font-size: 13px !important;
    color: #666 !important;
    margin-bottom: 15px !important;
}

.woocommerce-ordering select {
    padding: 8px 12px !important;
    border: 1px solid #d9d9d9 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    color: #333 !important;
    background: #fff !important;
    cursor: pointer !important;
    outline: none !important;
}

.woocommerce-ordering select:focus {
    border-color: #1890ff !important;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2) !important;
}

/* ========== 分页 ========== */
.woocommerce-pagination {
    margin-top: 30px !important;
    margin-bottom: 20px !important;
}

.woocommerce-pagination ul.page-numbers {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-pagination ul.page-numbers li {
    display: inline-block !important;
}

.woocommerce-pagination ul.page-numbers li span,
.woocommerce-pagination ul.page-numbers li a {
    display: inline-block !important;
    min-width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    text-align: center !important;
    padding: 0 12px !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    color: #666 !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
    background: #fff !important;
}

.woocommerce-pagination ul.page-numbers li span.current,
.woocommerce-pagination ul.page-numbers li a:hover {
    border-color: #1890ff !important;
    background: #1890ff !important;
    color: #fff !important;
}

/* ========== 左侧分类栏美化 ========== */
.woocommerce-sidebar,
.ast-left-sidebar,
.widget-area {
    margin-right: 20px !important;
}

.woocommerce-sidebar .widget,
.ast-left-sidebar .widget,
.widget-area .widget {
    background: #fff !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 20px !important;
}

/* 分类小工具标题 */
.woocommerce-sidebar .widgettitle,
.ast-left-sidebar .widgettitle,
.widget-area .widgettitle,
.widget-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    padding-bottom: 12px !important;
    margin-bottom: 15px !important;
    border-bottom: 2px solid #1890ff !important;
    position: relative !important;
}

.woocommerce-sidebar .widgettitle::after,
.widget-area .widgettitle::after {
    content: '' !important;
    position: absolute !important;
    bottom: -2px !important;
    left: 0 !important;
    width: 40px !important;
    height: 2px !important;
    background: #1890ff !important;
}

/* 分类列表 */
.woocommerce-sidebar ul,
.ast-left-sidebar ul,
.widget-area ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-sidebar ul li,
.ast-left-sidebar ul li,
.widget-area ul li {
    padding: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.woocommerce-sidebar ul li:last-child,
.ast-left-sidebar ul li:last-child,
.widget-area ul li:last-child {
    border-bottom: none !important;
}

/* 分类链接 */
.woocommerce-sidebar ul li a,
.ast-left-sidebar ul li a,
.widget-area ul li a {
    display: flex !important;
    align-items: center !important;
    padding: 10px 8px !important;
    color: #555 !important;
    font-size: 14px !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
}

.woocommerce-sidebar ul li a:hover,
.ast-left-sidebar ul li a:hover,
.widget-area ul li a:hover {
    background: #e6f7ff !important;
    color: #1890ff !important;
    padding-left: 12px !important;
}

/* 当前分类高亮 */
.woocommerce-sidebar ul li.current-cat a,
.ast-left-sidebar ul li.current-cat a,
.widget-area ul li.current-cat a {
    background: #1890ff !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.woocommerce-sidebar ul li.current-cat a:hover,
.ast-left-sidebar ul li.current-cat a:hover,
.widget-area ul li.current-cat a:hover {
    background: #1678db !important;
    color: #fff !important;
    padding-left: 8px !important;
}

/* 分类计数 */
.woocommerce-sidebar .count,
.ast-left-sidebar .count,
.widget-area .count {
    background: #f5f5f5 !important;
    color: #999 !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
    border-radius: 10px !important;
    margin-left: auto !important;
}

.woocommerce-sidebar li.current-cat .count,
.ast-left-sidebar li.current-cat .count,
.widget-area li.current-cat .count {
    background: rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
}

/* ========== 响应式适配 ========== */
@media (max-width: 1200px) {
    ul.products {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 992px) {
    ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    ul.products li.product img {
        height: 120px !important;
        padding: 10px !important;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 12px !important;
        min-height: 36px !important;
        max-height: 36px !important;
    }

    ul.products li.product .price {
        font-size: 14px !important;
    }

    .woocommerce-sidebar,
    .ast-left-sidebar {
        margin-right: 0 !important;
        margin-bottom: 20px !important;
    }

    .woocommerce-ordering {
        margin-top: 15px !important;
    }
}

@media (max-width: 480px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    ul.products li.product img {
        height: 100px !important;
    }

    ul.products li.product .astra-shop-summary-wrap {
        padding: 8px !important;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 11px !important;
        min-height: 33px !important;
        max-height: 33px !important;
    }

    ul.products li.product .price {
        font-size: 13px !important;
    }
}
