/* Products Page Specific Styles */
.products-page {
    /* 确保products页面不受has-fixed-header类影响 */
    padding-top: 0 !important;
}


/* products页面不再需要header-spacer */

/* header 收起时，占位=0，内容自然上移填充 */
.products-page.header-collapsed .header-spacer{
  height: 0;
}

/* Products Banner */
.products-banner {
    color: var(--white);
    position: relative;
    z-index: 1;
    padding-top: var(--header-h); /* 为固定header留出空间 */
    overflow: hidden;
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
}

.products-banner img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.products-banner .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.products-banner h2 {
    width: 394px;
    height: 101px;
    font-family: Poppins, Poppins;
    font-weight: bold;
    font-size: 72px;
    color: #FFFFFF;
    line-height: 108px;
    text-align: left;
    font-style: normal;
    margin-bottom: 5px;
}

.breadcrumb {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 18px;
    color: #FFFFFF;
    line-height: 27px;
    text-align: left;
    opacity: 0.8;
}

.breadcrumb a {
    color: #FFFFFF;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.breadcrumb span {
    margin: 0 5px;
}

.breadcrumb span:first-child {
    margin-left: 0;
}

/* Products Section */
.products-section {
    padding: 30px 0;
    background-color: #F7F7F7;
}

.products-layout {
    display: flex;
    gap: 40px;
}

/* Left Sidebar */
.products-sidebar {
    width: 310px;
    flex-shrink: 0;
}

.category-section,
.popular-section {
    background: var(--white);
    border-radius: 20px;
    padding: 20px;
    width: 310px;
    margin-bottom: 33px;

    box-shadow: 0px 10px 15px 0px rgba(0,0,0,0.04);
    border: 1px solid #EDEDED;
}

.category-section h3,
.popular-section h3 {
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 20px;
    color: #001C33;
    line-height: 30px;
    text-align: left;
    margin-bottom: 33px;
    text-transform: uppercase;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 5px;
    position: relative;
}

.category-item-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}



.category-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--light-gray);
    color: var(--txt-black);
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-right: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--white);
}

.category-toggle:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.category-toggle.expanded {
    background: var(--btn-blue-hover);
    color: var(--white);
    transform: scale(1.05);
}

.category-item {
    display: block;
    padding: 8px 8px 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 16px;
    color: var(--txt-black);
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    flex: 1;
    margin-left: 0;
}

.category-item::before {
    content: "";
    /* 定位 */
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    /* 尺寸 */
    width: 6px;
    height: 6px;
    /* 形状/颜色 */
    border-radius: 50%;
    background: #A8ABB2;
    /* 防止被压缩或放大 */
    flex-shrink: 0;
}


.category-item.active {
/*    background-color: var(--btn-blue);*/
    color: var(--btn-blue);
}

.category-item:hover {
    background-color: var(--light-gray);
    color: var(--txt-black);
}

/* Subcategory */
.subcategory-container {
    position: static;
    background: transparent;
    padding: 0;
    margin-top: 6px;
    margin-left: 20px;
    border: none;
    display: none;
}

.category-item-wrapper:hover .subcategory-container {
    display: block;
}

.subcategory-item {
    display: block;
    padding: 6px 8px;
    text-decoration: none;
    color: var(--txt-black);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: 4px;
    border-radius: 4px;
}

.subcategory-item:last-child {
    margin-bottom: 0;
}

.subcategory-item:hover {
    background-color: var(--light-gray);
    color: var(--txt-black);
}

.subcategory-item.active {
    color: var(--btn-blue);
    font-weight: 500;
}

/* Image Animation Classes - 已移除动画 */
.fade-in {
    opacity: 1;
}

/* Popular Products */
.popular-products {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.popular-product-item:hover {
    background-color: var(--white);
    /* 移除阴影效果 */
}

.popular-product-image {
    width: 90px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 1;
    cursor: pointer;
}

.popular-product-item:hover .popular-product-image img {
    transform: scale(1.1);
}

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

.popular-product-title {
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 14px;
    color: #001C33;
    line-height: 20px;
    text-align: left;
    overflow: hidden;
    /*text-overflow: ellipsis;
    white-space: nowrap;*/

    display: -webkit-box;         /* 关键：设置伸缩盒子 */
    -webkit-box-orient: vertical; /* 垂直排列 */
    -webkit-line-clamp: 5;        /* 限制为 5 行 */
    overflow: hidden;             /* 超出隐藏 */
    text-overflow: ellipsis;      /* 结尾显示 … */
}

/* Right Content */
.products-content {
    flex: 1;
    min-width: 0;
}

.content-header {
    border-bottom: 2px solid var(--light-gray);
}



.content-breadcrumb {
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 20px;
    color: #001C33;
    line-height: 30px;
    text-align: left;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-breadcrumb a {
    color: #5C5C66;
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-breadcrumb a:hover {
    color: var(--txt-black);
}

.content-breadcrumb span {
    color: var(--txt-black);
}

.content-breadcrumb .separator {
    color: #5C5C66;
    margin: 0 4px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 250px);
    grid-template-rows: repeat(3, 345px);
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

/* 左侧产品列表 - 1列6行 */
.products-sidebar .products-grid {
    grid-template-columns: 250px;
    grid-template-rows: repeat(6, 345px);
    gap: 15px;
    justify-content: flex-start;
    margin-bottom: 20px;
}

.products-sidebar .product-card {
    width: 250px;
    height: 345px;
}

.products-sidebar .product-image {
    width: 250px;
    height: 250px;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
/*    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);*/
    transition: all 0.3s ease;
    cursor: pointer;
    width: 250px;
    height: 345px;
}

.product-card:hover {
    /* 移除阴影效果 */
}

.product-image {
    width: 250px;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 1;
    cursor: pointer;
}

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

.product-info {
    padding: 20px;
}

.product-title {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 16px;
    color: #001C33;
    line-height: 25px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 50px;
    max-height: 50px; /* 确保最多显示两行 */
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--txt-gray);
    background: var(--white);
    border: 1px solid var(--light-gray);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-item:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.pagination-item.active {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-item.disabled:hover {
    background-color: var(--white);
    color: var(--txt-gray);
    border-color: var(--light-gray);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--txt-gray);
}

/* Go to page styles */
.pagination-goto {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    padding: 10px 15px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--light-gray);
}

.pagination-goto span {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--txt-gray);
    white-space: nowrap;
}

.pagination-input {
    width: 60px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
}

.pagination-input:focus {
    border-color: var(--primary-blue);
}

.pagination-goto-btn {
    padding: 6px 12px;
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-goto-btn:hover {
    background: var(--btn-blue-hover);
}

/* 1440px-1920px 范围优化 */
@media (min-width: 1441px) and (max-width: 1920px) {
    .products-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 40px;
    }
    
    .products-layout {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .products-grid {
        grid-template-columns: repeat(4, 250px);
        grid-template-rows: repeat(3, 345px);
        justify-content: center;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .products-sidebar .products-grid {
        grid-template-columns: 250px;
        justify-content: flex-start;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .products-sidebar {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .products-banner {
        height: 200px;
    }
    
    .products-banner h1 {
        font-size: 32px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .pagination {
        gap: 8px;
        flex-direction: column;
        align-items: center;
    }
    
    .pagination-item {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .pagination-goto {
        margin-left: 0;
        justify-content: center;
        width: 100%;
        max-width: 300px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Image Animation Classes */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-animate {
    animation: imageExpand 1s ease-out forwards;
}

@keyframes imageExpand {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth transitions for all images */
.product-image img,
.popular-product-image img {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* Error Message Styles */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--light-gray);
    border-radius: 8px;
    margin: 20px 0;
}

.error-message p {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: var(--txt-gray);
    margin-bottom: 20px;
}

.error-message .btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.error-message .btn:hover {
    background-color: var(--btn-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(11, 133, 230, 0.3);
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 60px 20px;
    background: var(--light-gray);
    border-radius: 8px;
    margin: 20px 0;
}

.no-products p {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    color: var(--txt-gray);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 250px);
        grid-template-rows: repeat(4, 345px);
    }
    
    .products-sidebar .products-grid {
        grid-template-columns: 250px;
        grid-template-rows: repeat(6, 345px);
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 250px);
        grid-template-rows: repeat(6, 345px);
    }
    
    .products-sidebar .products-grid {
        grid-template-columns: 250px;
        grid-template-rows: repeat(6, 345px);
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 250px;
        grid-template-rows: repeat(12, 345px);
    }
    
    .products-sidebar .products-grid {
        grid-template-columns: 250px;
        grid-template-rows: repeat(6, 345px);
    }
    
    .product-card {
        width: 100%;
        max-width: 250px;
    }
    
    .product-image {
        width: 100%;
        max-width: 250px;
    }
}
