/* 产品分类页面样式 */
.product-category-container {
    padding: max(2vw, 30px) 0;
    background-color: #fff;
}

/* 产品分类卡片网格 */
.product-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--post-gap);
}

/* 产品分类卡片样式 */
.product-category-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all var(--animation-duration) ease;
}

.product-category-card:hover {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.category-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.category-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--animation-duration) ease;
}

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

.category-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--theme-color);
    opacity: 0.1;
}
.category-content h2 {
    font-size: var(--widget-title-p-1-fs);
    color: var(--theme-p-color);
    margin: 0 0 12px;
    font-weight: 700;
}

.category-content p {
    font-size: var(--widget-title-p-3-fs);
    color: #666;
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-categories {
        grid-template-columns: 1fr;
    }
}

.product-category-layout {
    display: grid;
    grid-template-columns: max(320px, 18vw) 1fr;
    gap: max(2vw, 30px);
}

/* 左侧分类导航 */
.category-sidebar {
    /* padding: max(1.5vw, 20px); */
    height: fit-content;
}

.category-sidebar h2 {
    font-size: var(--widget-title-p-3-fs);
    font-weight: 600;
    color: #333;
    padding-bottom: 20px;
    position: relative;
}

.category-sidebar h2:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background-color: var(--theme-color);
    width: 80px;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list > li {
    padding: max(1.2vw, 20px) 0;
    border-top: 1px solid #eee;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInCategories 0.6s ease forwards;
}

.category-list > li:nth-child(1) { animation-delay: 0.1s; }
.category-list > li:nth-child(2) { animation-delay: 0.2s; }
.category-list > li:nth-child(3) { animation-delay: 0.3s; }
.category-list > li:nth-child(4) { animation-delay: 0.4s; }
.category-list > li:nth-child(5) { animation-delay: 0.5s; }
.category-list > li:nth-child(6) { animation-delay: 0.6s; }
.category-list > li:nth-child(7) { animation-delay: 0.7s; }
.category-list > li:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideInCategories {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.category-list > li > a  {
    color: #000;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    text-decoration: none;
    transition: all var(--animation-duration) ease;
    font-size: var(--widget-title-p-4-fs);
}
.category-list a img {
    width: 16px;
    height: 16px;
    margin-right: 16px;
}
.category-list li.active > a,
.category-list a:hover {
    color: var(--theme-color);
}
.category-list li.active > a img,
.category-list a:hover img {
    filter: var(--svg-filter-color);
}
.toggle-submenu {
    width: 16px;
    height: 16px;
    position: relative;
    cursor: pointer;
}

.toggle-submenu:before,
.toggle-submenu:after {
    content: '';
    position: absolute;
    background-color: var(--theme-color);
    transition: all var(--animation-duration) ease;
}

.toggle-submenu:before {
    width: 2px;
    height: 10px;
    top: 3px;
    left: 7px;
}

.toggle-submenu:after {
    width: 10px;
    height: 2px;
    top: 7px;
    left: 3px;
}

.category-list li.active > a .toggle-submenu:before {
    transform: rotate(90deg);
}

.subcategory-list {
    list-style: none;
    padding-left: 32px;
    margin: max(1.2vw, 20px) 0 0;
    display: none;
    border-top: 1px solid #eee;
}

.category-list li.active > .subcategory-list {
    display: block;
    animation: expandSubcategories 0.4s ease-out;
}

.subcategory-list li {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInSubcategories 0.4s ease forwards;
}

.subcategory-list li:nth-child(1) { animation-delay: 0.1s; }
.subcategory-list li:nth-child(2) { animation-delay: 0.15s; }
.subcategory-list li:nth-child(3) { animation-delay: 0.2s; }
.subcategory-list li:nth-child(4) { animation-delay: 0.25s; }
.subcategory-list li:nth-child(5) { animation-delay: 0.3s; }

@keyframes expandSubcategories {
    from {
        max-height: 0;
        opacity: 0;
    }
    to {
        max-height: 500px;
        opacity: 1;
    }
}

@keyframes fadeInSubcategories {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 展开/收起图标动画 */
.toggle-submenu:before {
    transition: transform 0.3s ease;
}

.category-list li.active > a .toggle-submenu:before {
    transform: rotate(90deg);
}

.subcategory-list a {
    font-size: var(--widget-title-p-4-fs);
    margin: max(1.2vw, 20px) 0;
}
.subcategory-list a:last-child {
    margin-bottom: 0;
}

/* 响应式调整 */
@media (max-width: 991px) {
    .product-category-layout {
        grid-template-columns: 1fr;
    }
}

/* Banner样式 */
.category-banner {
    position: relative;
    padding: max(3vw, 40px) 0;
    color: #fff;
    min-height: max(21vw, 300px);
    overflow: hidden;
}

.category-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: none;
}

.category-banner .banner-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-banner .banner-content {
    position: relative;
    z-index: 2;
}
.category-banner h1 {
    font-size: max(2.4vw, var(--widget-title-h2-fs));
    font-weight: 700;
    margin: 0 0 max(1vw, 15px);
    color: var(--theme-p-color);
}
.category-banner h1 span {
    color: var(--theme-color);
}

.category-banner p {
    font-size: var(--widget-title-p-3-fs);
    max-width: 800px;
    line-height: 1.6;
    color: var(--theme-p-color);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .category-banner {
        padding: max(2vw, 30px) 0;
    }
    
    .category-banner h1 {
        font-size: var(--section-title-mobile-fs);
    }
    
    .category-banner p {
        font-size: var(--widget-title-p-3-fs);
    }
    .custom-product-card-image img {
        width: 80px;
        height: 80px;
    }
}