/* ranking.css - 强制商品名称三行显示，高度一致 */
.ranking-section {
    padding: 40px 0;
    background-color: transparent;
}

.ranking-section .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 分类标签 */
.ranking-section .ranking-cat-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.ranking-section .ranking-cat-list .rounded-btn {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid #333;
    border-radius: 30px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Noto Sans JP', sans-serif;
    transition: all 0.3s ease;
    cursor: pointer;
    background: transparent;
}

.ranking-section .ranking-cat-list .rounded-btn.active,
.ranking-section .ranking-cat-list .rounded-btn:hover {
    background: #333;
    color: #fff;
}

/* Swiper容器 */
.ranking-swiper {
    padding: 20px 0 40px;
    position: relative;
}

.ranking-swiper .swiper-slide {
    width: 280px;
    background: #fff;
    border: 1px solid #e6e6e6;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: auto;
}

.ranking-swiper .swiper-slide:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 商品图片容器 */
.product-img-container {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    flex-shrink: 0;
}

.product-img-container__img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.product-img-container__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-img-container__img:hover img {
    transform: scale(1.05);
}

/* 排名数字 */
.rank-number {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Roboto Condensed', sans-serif;
    z-index: 5;
}

/* 标签图标 */
.iconList {
    display: block;
    margin: 0 10px 10px;
    flex-shrink: 0;
}

.iconList .ico {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    color: #fff;
    border-radius: 3px;
}

.iconList .ico.ico3 {
    background: #ff6b6b;
}

/* 商品信息容器 - 固定高度 */
.item-txt-wrap {
    padding: 0 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100px;
}

/* 商品名称 - 强制三行显示，超出省略 */
.item-txt {
    display: block;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
    font-family: 'Noto Serif JP', serif;
    text-align: center;
    margin-bottom: 8px;
    
    /* 强制三行显示 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    
    /* 固定高度确保三行 */
    min-height: 58px;
    max-height: 58px;
}

/* 价格区域 */
.item-price {
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-top: auto;
}

.price-tax {
    font-size: 10px;
    color: #666;
    margin-left: 2px;
    font-weight: normal;
}

/* Swiper导航按钮 */
.swiper-button-prev,
.swiper-button-next {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 16px;
    color: #333;
}

.swiper-button-prev {
    left: 0;
}

.swiper-button-next {
    right: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .ranking-section {
        padding: 30px 0;
    }
    .ranking-section .ranking-cat-list {
        gap: 8px;
        margin-bottom: 30px;
    }
    .ranking-section .ranking-cat-list .rounded-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
    .ranking-swiper .swiper-slide {
        width: 220px;
    }
    .item-txt {
        font-size: 12px;
        min-height: 54px;
        max-height: 54px;
    }
    .item-price {
        font-size: 13px;
    }
    .swiper-button-prev,
    .swiper-button-next {
        width: 30px;
        height: 30px;
    }
    .swiper-button-prev:after,
    .swiper-button-next:after {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ranking-swiper .swiper-slide {
        width: 180px;
    }
    .item-txt {
        font-size: 11px;
        min-height: 49px;
        max-height: 49px;
    }
    .item-price {
        font-size: 12px;
    }
}

/* 加载动画 */
.loading-spinner {
    text-align: center;
    padding: 50px;
}

.loading-spinner span {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255,255,255,0.9);
    border-radius: 5px;
}

.no-products {
    text-align: center;
    padding: 50px;
    color: #666;
}

.no-categories {
    text-align: center;
    padding: 100px 20px;
    color: #666;
    font-size: 16px;
}