/**
 * ALA Category Archive Styles
 * 产品分类列表页样式
 * 
 * Responsive design for 375px, 1440px, and 2560px
 * Based on Figma designs
 * 
 * @package WoodMart
 * @version 1.0.0
 */

/* ========================================
   Container & Layout
   ======================================== */

.ala-category-archive {
    width: 100%;
    background: #fff;
}

.ala-container {
    /* 
     * 使用 clamp() 实现按比例缩放
     * 375px 屏幕：344px (91.73%)
     * 1440px 屏幕：1440px (100%)
     * 2560px 屏幕：2140px (83.59%)
     * 
     * 计算公式：clamp(最小值, 线性插值, 最大值)
     * 线性插值公式：min + (max - min) * (viewport - min_viewport) / (max_viewport - min_viewport)
     */
    max-width: clamp(344px, calc(344px + (1440 - 344) * (100vw - 375px) / (1440 - 375)), 1440px);
    margin: 0 auto;
    padding: 0 20px;
}

/* 超大屏幕（2560px+）单独处理 */
@media (min-width: 2560px) {
    .ala-container {
        /* 2560px 屏幕：2140px，继续按比例缩放 */
        max-width: clamp(1440px, calc(1440px + (2140 - 1440) * (100vw - 1440px) / (2560 - 1440)), 2140px);
    }
}
/* ========================================
   Breadcrumb Navigation
   ======================================== */

.ala-breadcrumb-wrapper {
    padding: 20px 0;
    background: #f9f9f9;
}

.ala-breadcrumb {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.ala-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ala-breadcrumb a:hover {
    color: #333;
}

.ala-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.ala-breadcrumb .current {
    color: #333;
    font-weight: 500;
}

/* 移动端面包屑 */
@media (max-width: 767px) {
    .ala-breadcrumb {
        font-size: 12px;
    }
    
    .ala-breadcrumb .separator {
        margin: 0 4px;
    }
}

/* ========================================
   Category Header
   ======================================== */

.ala-category-header {
    padding: 40px 0 30px;
    text-align: left;
}

.ala-category-title {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin: 0 0 15px;
    line-height: 1.3;
}

.ala-category-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    max-width: 800px;
    margin: 0;
}

/* 平板端标题 */
@media (max-width: 1023px) {
    .ala-category-header {
        padding: 30px 0 20px;
    }
    
    .ala-category-title {
        font-size: 28px;
    }
    
    .ala-category-description {
        font-size: 15px;
    }
}

/* 移动端标题 */
@media (max-width: 767px) {
    .ala-category-header {
        padding: 20px 0 15px;
    }
    
    .ala-category-title {
        font-size: 24px;
    }
    
    .ala-category-description {
        font-size: 14px;
    }
}

/* ========================================
   Products Section
   ======================================== */

.ala-products-section {
    padding: 20px 0 60px;
}

/* ========================================
   Product Grid - 响应式网格布局
   ======================================== */

.ala-category-products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 桌面端：5列 */
    gap: 20px;
    width: 100%;
    margin: 0 auto;
}

/* 平板端：3列 */
@media (max-width: 1439px) {
    .ala-category-products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* 移动端：2列 */
@media (max-width: 767px) {
    .ala-category-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* 小屏幕移动端 */
@media (max-width: 374px) {
    .ala-category-products-grid {
        gap: 10px;
    }
}

/* ========================================
   Product Card Adjustments
   确保产品卡片在网格中正确显示
   ======================================== */

.ala-category-products-grid .ala-product-card {
    width: 100%;
    margin: 0; /* 移除任何默认边距 */
}

/* ========================================
   No Products Message
   ======================================== */

.ala-no-products {
    text-align: center;
    padding: 60px 20px;
}

.ala-no-products p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* ========================================
   Pagination - 暂时隐藏但已实现
   ======================================== */

.ala-pagination-wrapper {
    margin-top: 40px;
    /* display: none; - 通过内联样式隐藏 */
}

.ala-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ala-pagination .page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ala-pagination .page-number:hover {
    background: #f5f5f5;
    border-color: #999;
}

.ala-pagination .page-number.current {
    background: #333;
    color: #fff;
    border-color: #333;
    cursor: default;
}

.ala-pagination .page-ellipsis {
    padding: 0 5px;
    color: #999;
}

.ala-pagination .page-number.prev,
.ala-pagination .page-number.next {
    font-weight: 500;
}

/* 移动端分页 */
@media (max-width: 767px) {
    .ala-pagination {
        gap: 6px;
    }
    
    .ala-pagination .page-number {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ========================================
   Filter Bar (预留，可后续添加)
   ======================================== */

.ala-filter-bar {
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}

.ala-filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* ========================================
   Responsive Utilities
   ======================================== */

/* 确保图片响应式 */
.ala-category-products-grid img {
    max-width: 100%;
    height: auto;
}

/* 清除浮动 */
.ala-category-archive::after,
.ala-container::after {
    content: "";
    display: table;
    clear: both;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .ala-breadcrumb-wrapper,
    .ala-pagination-wrapper {
        display: none;
    }
    
    .ala-category-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
