/* Recently Viewed Products 板块样式 */
/* 完全参照 Hot sale with discounts 板块样式 */

.product-section-recently-viewed {
    padding: 35px 0 40px;
    padding-bottom: 0 !important;
}

.product-section-recently-viewed .widget-title.style-3 {
    text-align: left;
    padding: 0;
    position: relative;
    margin-bottom: 20px;
}

.product-section-recently-viewed .product-collection {
    text-align: left;
}

.product-section-recently-viewed .swiper-container {
    text-align: left;
    overflow: visible;
}

.product-section-recently-viewed .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.product-section-recently-viewed .grid-item-mansory {
    flex-shrink: 0;
    margin-bottom: 20px;
}

/* PC端样式 (>= 768px) */
@media (min-width: 768px) {
    .product-section-recently-viewed .swiper-wrapper {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 15px;
    }
    
    .product-section-recently-viewed .grid-item-mansory {
        width: calc(25% - 12px); /* 四列布局，缩短宽度 */
        max-width: 220px; /* 减少最大宽度 */
        margin-right: 0;
    }
    
    /* 当只有一个产品时，确保左对齐 */
    .product-section-recently-viewed .swiper-wrapper:has(.grid-item-mansory:only-child) {
        justify-content: flex-start;
    }
    
    /* 标题在PC端左对齐 */
    .product-section-recently-viewed .widget-title.style-3 {
        text-align: left;
    }
    
    /* PC端隐藏分页器，因为使用网格布局 */
    .product-section-recently-viewed .swiper-pagination {
        display: none !important;
    }
}

/* 手机端样式 (< 768px) */
@media (max-width: 767px) {
    .product-section-recently-viewed .swiper-wrapper {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .product-section-recently-viewed .grid-item-mansory {
        width: 200px; /* 减少固定宽度 */
        min-width: 200px;
        margin-right: 0;
    }
    
    /* 标题在手机端靠左显示，并缩小 */
    .product-section-recently-viewed .widget-title.style-3 {
        text-align: left !important;
        margin-bottom: 15px !important;
    }
    
    /* 手机端标题字体缩小 */
    .product-section-recently-viewed .widget-title.style-3 .box-title {
        font-size: 16px !important;
        line-height: 1.3 !important;
    }
    
    .product-section-recently-viewed .widget-title.style-3 .title {
        font-size: 16px !important;
        font-weight: 600 !important;
    }
    
    /* 手机端滑动指示器 - 修复重复显示问题 */
    .product-section-recently-viewed .swiper-pagination {
        position: relative !important;
        bottom: 0 !important;
        margin-top: 20px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    /* 确保分页器点不重复 */
    .product-section-recently-viewed .swiper-pagination .swiper-pagination-bullet {
        margin: 0 4px !important;
        width: 8px !important;
        height: 8px !important;
        background: #ccc !important;
        opacity: 0.5 !important;
        border-radius: 50% !important;
        transition: all 0.3s ease !important;
    }
    
    .product-section-recently-viewed .swiper-pagination .swiper-pagination-bullet-active {
        background: #007bff !important;
        opacity: 1 !important;
        transform: scale(1.2) !important;
    }
    
    /* 隐藏可能重复的分页器 */
    .product-section-recently-viewed .swiper-pagination:not(:first-of-type) {
        display: none !important;
    }
    
    /* 确保只有一个分页器容器 */
    .product-section-recently-viewed .swiper-container .swiper-pagination {
        display: flex !important;
    }
    
    .product-section-recently-viewed .swiper-container .swiper-pagination ~ .swiper-pagination {
        display: none !important;
    }
}

/* 产品卡片样式 - 缩短尺寸 */
.product-section-recently-viewed .inner-top {
    background: #fff;
    border-radius: 6px; /* 减少圆角 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.08); /* 减少阴影 */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%; /* 确保不超出容器 */
}

.product-section-recently-viewed .inner-top:hover {
    transform: translateY(-3px); /* 减少悬停效果 */
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
}

/* 产品图片容器 - 缩短高度 */
.product-section-recently-viewed .product-top {
    position: relative;
    overflow: hidden;
    border-radius: 6px 6px 0 0;
}

.product-section-recently-viewed .product-image {
    width: 100%;
    height: 160px; /* 减少图片高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-section-recently-viewed .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-section-recently-viewed .inner-top:hover .product-image img {
    transform: scale(1.03); /* 减少缩放效果 */
}

/* 产品信息容器 - 减少内边距 */
.product-section-recently-viewed .product-bottom {
    padding: 12px; /* 减少内边距 */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 产品标题 - 调整字体大小和行高 */
.product-section-recently-viewed .product-title {
    color: #333;
    font-size: 13px; /* 减少字体大小 */
    font-weight: 600;
    line-height: 1.3; /* 减少行高 */
    margin-bottom: 8px; /* 减少下边距 */
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-section-recently-viewed .product-title:hover {
    color: #007bff;
}

/* 价格样式 - 调整字体大小 */
.product-section-recently-viewed .price-box {
    margin-top: auto;
}

.product-section-recently-viewed .price-regular {
    font-size: 16px; /* 减少字体大小 */
    font-weight: 700;
    color: #e74c3c;
}

.product-section-recently-viewed .price-regular span {
    color: inherit;
}

/* 滑动导航按钮 - 调整大小 */
.product-section-recently-viewed .swiper-button-next,
.product-section-recently-viewed .swiper-button-prev {
    display: flex;
    width: 36px; /* 减少按钮大小 */
    height: 36px;
    background: rgba(240, 240, 240, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    z-index: 10;
}

.product-section-recently-viewed .swiper-button-next:hover,
.product-section-recently-viewed .swiper-button-prev:hover {
    background: rgba(255,255,255,0.95);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transform: scale(1.03);
}

.product-section-recently-viewed .swiper-button-next:after,
.product-section-recently-viewed .swiper-button-prev:after {
    font-size: 14px; /* 减少箭头大小 */
    color: #666;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .product-section-recently-viewed .swiper-button-next,
    .product-section-recently-viewed .swiper-button-prev {
        width: 32px; /* 手机端更小的按钮 */
        height: 32px;
        background: rgba(255,255,255,0.95);
    }
    
    .product-section-recently-viewed .swiper-button-next:after,
    .product-section-recently-viewed .swiper-button-prev:after {
        font-size: 12px;
        color: #333;
    }
}

/* 确保样式优先级 */
.product-section-recently-viewed.suppermarket-new-arrivals {
    padding: 35px 0 40px !important;
    padding-bottom: 0 !important;
}

.product-section-recently-viewed .widget-title.style-3 {
    text-align: left !important;
    padding: 0 !important;
    position: relative !important;
    margin-bottom: 20px !important;
}

.product-section-recently-viewed .product-collection {
    text-align: left !important;
}

.product-section-recently-viewed .swiper-container {
    text-align: left !important;
    overflow: visible !important;
}

.product-section-recently-viewed .swiper-wrapper {
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

.product-section-recently-viewed .grid-item-mansory {
    flex-shrink: 0 !important;
    margin-bottom: 20px !important;
}

/* 额外调整：确保产品卡片不会过长 */
.product-section-recently-viewed .grid-item-mansory {
    max-width: 220px !important;
    min-width: 180px !important;
}

.product-section-recently-viewed .inner-top {
    max-height: 280px !important; /* 限制最大高度 */
    overflow: hidden !important;
}

/* 手机端标题特殊样式 */
@media (max-width: 767px) {
    .product-section-recently-viewed .widget-title.style-3 {
        text-align: left !important;
        margin-bottom: 15px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .product-section-recently-viewed .widget-title.style-3 .box-title {
        text-align: left !important;
        justify-content: flex-start !important;
    }
    
    .product-section-recently-viewed .widget-title.style-3 .title {
        text-align: left !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }
    
    /* 确保手机端标题容器左对齐 */
    .product-section-recently-viewed .container {
        text-align: left !important;
    }
    
    .product-section-recently-viewed .widget-title.style-3 {
        display: block !important;
        text-align: left !important;
    }
}

/* 分页器重复显示问题修复 */
.product-section-recently-viewed .swiper-pagination {
    /* 确保只有一个分页器显示 */
    display: flex !important;
    position: relative !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 20px auto 0 auto !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    z-index: 10 !important;
}

/* 隐藏重复的分页器 */
.product-section-recently-viewed .swiper-pagination + .swiper-pagination,
.product-section-recently-viewed .swiper-pagination ~ .swiper-pagination {
    display: none !important;
}

/* 确保分页器样式统一 */
.product-section-recently-viewed .swiper-pagination .swiper-pagination-bullet {
    margin: 0 4px !important;
    width: 8px !important;
    height: 8px !important;
    background: #ccc !important;
    opacity: 0.5 !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.product-section-recently-viewed .swiper-pagination .swiper-pagination-bullet-active {
    background: #007bff !important;
    opacity: 1 !important;
    transform: scale(1.2) !important;
}

.product-section-recently-viewed .swiper-pagination .swiper-pagination-bullet:hover {
    background: #007bff !important;
    opacity: 0.8 !important;
} 