/* 公共商品卡片样式 - 用于首页和商品分类页面 */

/* 商品展示容器 */
.img_box {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    justify-items: center;
    align-items: stretch;
    margin: 30px auto 0 auto;
    width: 1200px;
}

/* 商品卡片样式 */
.product-item.new-style {
    background: #fff;
    border-radius: 8px 8px 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    width: 220px;
    padding: 24px 0px 0 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: box-shadow .2s;
    border: 1px solid #1769AA;
}

.product-item.new-style:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    border-color: #2196f3;
}

.product-img-wrap {
    width: 160px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.product-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-title {
    width: 100%;
    background: #1769aa;
    color: #fff;
    font-size: 18px;
    text-align: center;
    padding: 12px 0 10px 0;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: background .2s;
}

.product-item.new-style:hover .product-title {
    background: #2196f3;
}

/* 分类标题栏样式 */
.category-title-bar {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    background: linear-gradient(90deg, #93d7f7 0%, #96e0f3 100%);
    padding: 0 24px;
    height: 48px;
    border-radius: 8px 8px 0 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(252,182,159,0.10);
}

.category-title-center {
    text-align: center;
    color: #222;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    font-style: italic;
}

.category-more {
    justify-self: end;
    color: #2196f3;
    font-size: 15px;
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}

.category-more:hover {
    color: #1769aa;
    text-decoration: underline;
}

/* 商品轮播样式 */
#category-product-list .swiper {
    width: 100%;
    height: auto;
    margin-top: 2px;
    padding: 2px 0 40px 0;
}

#category-product-list .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: auto;
}

#category-product-list .swiper-slide .product-link {
    text-decoration: none;
    width: 100%;
    display: flex;
}

#category-product-list .swiper-button-next,
#category-product-list .swiper-button-prev {
    width: 30px;
    height: 30px;
    background: rgba(23, 105, 170, 0.8);
    border-radius: 50%;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

#category-product-list .swiper:hover .swiper-button-next,
#category-product-list .swiper:hover .swiper-button-prev {
    opacity: 1;
    pointer-events: auto;
}

#category-product-list .swiper-button-next:after,
#category-product-list .swiper-button-prev:after {
    font-size: 12px;
    font-weight: bold;
}

#category-product-list .swiper-pagination {
    bottom: 0;
}

#category-product-list .swiper-pagination-bullet {
    background: #1769aa;
    opacity: 0.5;
}

#category-product-list .swiper-pagination-bullet-active {
    opacity: 1;
    background: #2196f3;
}

/* 链接样式 */
a {
    text-decoration: none;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .img_box {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        padding: 0 10px;
    }
    
    .product-item.new-style {
        width: 150px;
        padding: 16px 0px 0 0px;
    }
    
    .product-img-wrap {
        width: 100px;
    }
    
    .product-title {
        font-size: 14px;
        padding: 8px 0 6px 0;
    }
    
    #category-product-list .swiper {
        padding: 10px 0;
    }
    
    #category-product-list .swiper-button-next,
    #category-product-list .swiper-button-prev {
        width: 25px;
        height: 25px;
    }
    
    #category-product-list .swiper-button-next:after,
    #category-product-list .swiper-button-prev:after {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .img_box {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-item.new-style {
        width: 120px;
        padding: 12px 0px 0 0px;
    }
    
    .product-img-wrap {
        width: 80px;
    }
    
    .product-title {
        font-size: 12px;
        padding: 6px 0 4px 0;
    }
}
