/**
 * Category Sidebar Styles
 * 产品分类页面侧边栏样式
 * 
 * @package Astra Child - IceBag
 * @version 2.0.0
 */

/* ============================================
   两栏布局容器
   ============================================ */
.products-archive-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    padding: 20px 0;
    align-items: flex-start;
}

/* ============================================
   左侧栏目
   ============================================ */
.products-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
}

/* ============================================
   右侧主内容区
   ============================================ */
.products-main-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - 310px);
}

/* ============================================
   侧边栏小部件通用样式
   ============================================ */
.sidebar-widget {
    background: #fff;
    margin-bottom: 25px;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
}

/* 小部件标题栏 */
.widget-title-bar {
    background: #1e73be;
    padding: 12px 15px;
}

.widget-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ============================================
   Categories 模块样式
   ============================================ */
.categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.categories-list > li {
    border-bottom: 1px solid #e5e5e5;
}

.categories-list > li:last-child {
    border-bottom: none;
}

.categories-list > li > a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.categories-list > li > a:hover,
.categories-list > li.current-cat > a {
    background: #f8f9fa;
    color: #1e73be;
}

.categories-list > li.current-cat > a {
    font-weight: 600;
    border-left: 3px solid #1e73be;
}

.categories-list > li > a em {
    font-style: normal;
}

/* 子分类样式 */
.sub-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fafafa;
}

.sub-categories li {
    border-top: 1px solid #e5e5e5;
}

.sub-categories li a {
    display: block;
    padding: 10px 15px 10px 30px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
}

.sub-categories li a:before {
    content: "›";
    position: absolute;
    left: 18px;
    color: #999;
}

.sub-categories li a:hover,
.sub-categories li.current-cat a {
    color: #1e73be;
    background: #f0f0f0;
}

.sub-categories li a em {
    font-style: normal;
}

/* ============================================
   Popular Products 模块样式
   ============================================ */
.popular-products-list {
    list-style: none;
    margin: 0;
    padding: 10px;
}

.popular-product-item {
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
}

.popular-product-item:last-child {
    border-bottom: none;
}

.popular-product-item figure {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
}

.popular-product-item .product-thumb {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    border-radius: 3px;
    border: 1px solid #e5e5e5;
    background: #f0f0f0;
}

.popular-product-item .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-product-item .no-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.popular-product-item figcaption {
    flex: 1;
    min-width: 0;
}

.popular-product-item figcaption a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: block;
}

.popular-product-item figcaption a:hover {
    color: #1e73be;
}

/* ============================================
   产品网格样式 - 电脑端一行3个
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.products-grid .product-item {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.products-grid .product-item .ast-article-inner {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
    height: 100%;
}

.products-grid .product-item .ast-article-inner:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.products-grid .product-item .post-thumb-img-content {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.products-grid .product-item .post-thumb-img-content a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.products-grid .product-item .post-thumb-img-content img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.products-grid .product-item .entry-content-wrapper {
    padding: 15px;
}

.products-grid .product-item .cat-links {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
}

.products-grid .product-item .cat-links a {
    color: #1e73be;
    text-decoration: none;
}

.products-grid .product-item .entry-title {
    font-size: 15px;
    line-height: 1.4;
    margin: 0 0 10px;
}

.products-grid .product-item .entry-title a {
    color: #333;
    text-decoration: none;
}

.products-grid .product-item .entry-title a:hover {
    color: #1e73be;
}

.products-grid .product-item .entry-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.products-grid .product-item .entry-excerpt p {
    margin: 0;
}

/* ============================================
   页面标题样式
   ============================================ */
.products-main-content .page-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #1e73be;
}

.products-main-content .page-title {
    font-size: 28px;
    color: #333;
    margin: 0;
}

/* ============================================
   分页样式
   ============================================ */
.products-main-content .pagination,
.products-main-content .nav-links {
    margin-top: 30px;
    text-align: center;
}

.products-main-content .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.products-main-content .page-numbers:hover,
.products-main-content .page-numbers.current {
    background: #1e73be;
    border-color: #1e73be;
    color: #fff;
}

/* ============================================
   无产品提示
   ============================================ */
.no-products {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 5px;
    color: #666;
}

/* ============================================
   响应式布局 - 平板端
   ============================================ */
@media (max-width: 1024px) {
    .products-archive-wrapper {
        gap: 20px;
    }
    
    .products-sidebar {
        width: 250px;
        min-width: 250px;
    }
    
    .products-main-content {
        width: calc(100% - 270px);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ============================================
   响应式布局 - 手机端（一行1个产品）
   ============================================ */
@media (max-width: 768px) {
    .products-archive-wrapper {
        flex-direction: column;
        gap: 25px;
    }
    
    .products-sidebar {
        width: 100%;
        min-width: 100%;
        order: 2;
    }
    
    .products-main-content {
        order: 1;
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .products-main-content .page-title {
        font-size: 24px;
    }
    
    .products-grid .product-item .entry-title {
        font-size: 16px;
    }
}

/* ============================================
   小屏幕手机
   ============================================ */
@media (max-width: 480px) {
    .products-main-content .page-title {
        font-size: 20px;
    }
    
    .widget-title-bar {
        padding: 10px 12px;
    }
    
    .widget-title {
        font-size: 13px;
    }
    
    .categories-list > li > a {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .sub-categories li a {
        padding: 8px 12px 8px 25px;
        font-size: 12px;
    }
    
    .popular-product-item .product-thumb {
        width: 60px;
        height: 60px;
    }
    
    .popular-product-item figcaption a {
        font-size: 12px;
    }
}
