/* 产品目录样式重构 - 整合优化版 */

/* 容器样式 */
#product-swiper {
    direction: ltr;
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* 包装器样式 */
#product-swiper .swiper-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    transition: transform 0.3s ease;
}

/* 滑块基础样式 */
#product-swiper .swiper-slide {
    flex-shrink: 0;
    height: auto;
    display: block;
    float: none;
}

/* 桌面端样式 (>=1201px) */
@media (min-width: 1201px) {
    #product-swiper .swiper-slide {
        width: 330px;
    }
}

/* 平板端样式 (<=1200px) */
@media (max-width: 1200px) {
    #product-swiper .swiper-slide {
        width: 280px;
    }
}

/* 移动端样式 (<=768px) */
@media (max-width: 768px) {
    #product-swiper {
        width: 85%;
        max-width: 100%;
    }
    
    #product-swiper .swiper-slide {
        width: 100%;
    }
}

/* 导航按钮样式 */
.product-button-next,
.product-button-prev {
    display: flex;
    z-index: 10;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.product-button-next:hover,
.product-button-prev:hover {
    background-color: white;
}

.product-button-next {
    right: 10px;
}

.product-button-prev {
    left: 10px;
}

/* 分页器样式 */
#product-swiper .swiper-pagination {
    display: none;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
}

/* 产品卡片样式 */
#product-swiper .swiper-slide .img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

#product-swiper .swiper-slide .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

#product-swiper .swiper-slide:hover .img img {
    transform: scale(1.05);
}

#product-swiper .swiper-slide .info {
    padding: 15px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#product-swiper .swiper-slide .info .title {
    text-align: left;
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#product-swiper .swiper-slide .info .text {
    display: block;
    line-height: 1.5;
    font-size: 14px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
    height: 42px;
}

/* 添加文本渐变截断效果 */
#product-swiper .swiper-slide .info .text {
    position: relative;
}

#product-swiper .swiper-slide .info .text:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40%;
    height: 1.5em;
    background: linear-gradient(to right, transparent, white 100%);
    pointer-events: none;
}

/* 确保文本行数一致 */
#product-swiper .swiper-slide .info {
    display: flex;
    flex-direction: column;
    min-height: 120px;
}

/* 产品logo样式 */
#product-swiper .swiper-slide .product-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 4px;
    z-index: 2;
}

#product-swiper .swiper-slide .product-logo span {
    color: #0066cc;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    display: block;
}

/* 移动端优化 */
@media (max-width: 768px) {
    #product-swiper .swiper-slide .info .title {
        font-size: 14px;
    }
    
    #product-swiper .swiper-slide .info .text {
        font-size: 13px;
        -webkit-line-clamp: 3;
        height: 58.5px;
    }

    /* 移动端隐藏渐变效果 */
    #product-swiper .swiper-slide .info .text:after {
        display: none;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#product-swiper .swiper-slide {
    animation: fadeInUp 0.5s ease;
}