.product-ranking-section {
    --background: transparent;
}

.product-ranking-section .ranking-container {
    /* container */
}

/* Section Header */
.product-ranking-section .section-header {
    margin-bottom: 20px;
}

.product-ranking-section .section-title {
    margin: 0 0 8px 0;
    color: #333;
    line-height: 1.3;
}

.product-ranking-section .section-subtitle {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Tab Navigation */
.product-ranking-section .tab-navigation-wrapper {
    position: relative;
}

.product-ranking-section .tab-navigation-placeholder {
    display: none;
}

.product-ranking-section .tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    transition: box-shadow 0.3s ease;
}

.product-ranking-section .tab-navigation.is-sticky {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 10;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.product-ranking-section .tab-navigation.is-sticky+.tab-navigation-placeholder {
    display: block;
}

.product-ranking-section .tab-item {
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.product-ranking-section .tab-item:hover {
    color: #333;
}

/* Product Grid */
.product-ranking-section .tab-content {
    display: none;
}

.product-ranking-section .tab-content.active {
    display: block;
}

.product-ranking-section .product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 5px;
}

/* PC Slider Mode */
.product-ranking-section.slider-mode .product-grid-wrapper,
.product-ranking-section.mobile-slider-mode .product-grid-wrapper {
    position: relative;
}

.product-ranking-section.slider-mode .product-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 20px;
    padding: 20px 0;
}

.product-ranking-section.slider-mode .product-grid::-webkit-scrollbar {
    display: none;
}

.product-ranking-section.slider-mode .product-card {
    flex: 0 0 calc((100% - 80px) / 5);
    min-width: calc((100% - 80px) / 5);
}

/* Slider Navigation Arrows */
.product-ranking-section .slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: .7;
}

.product-ranking-section .slider-nav:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-ranking-section .slider-nav.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.product-ranking-section .slider-nav-prev {
    left: -20px;
}

.product-ranking-section .slider-nav-next {
    right: -20px;
}

.product-ranking-section .slider-nav svg {
    width: 20px;
    height: 20px;
    fill: #333;
}

/* Product Card */
.product-ranking-section .product-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.product-ranking-section .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Ranking Badge */
.product-ranking-section .ranking-badge {
    position: absolute;
    top: -19px;
    left: 2px;
    width: 30px;
    height: 30px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.product-ranking-section .ranking-badge.top-3 {
    background: #ffd700;
    color: #333;
}

.product-ranking-section .ranking-badge.rank-1 {
    background: #ffd700;
}

.product-ranking-section .ranking-badge.rank-2 {
    background: #c0c0c0;
}

.product-ranking-section .ranking-badge.rank-3 {
    background: #cd7f32;
}

/* Product Image */
.product-ranking-section .product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
}

.product-ranking-section .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.product-ranking-section .product-card:hover .product-image img {
    transform: scale(1);
}

/* Product Info */
.product-ranking-section .product-info {
    padding: 12px;
}

.product-ranking-section .product-title {
    font-size: var(--product-title-font-size, 14px);
    font-weight: var(--product-title-font-weight, normal);
    line-height: 1.4;
    color: var(--product-title-color, #454545);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: var(--product-title-lines, 2);
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: auto;
}

.product-ranking-section .product-title a {
    color: inherit;
    text-decoration: none;
}

.product-ranking-section .product-price {
    font-size: var(--product-price-font-size, 16px);
    font-weight: var(--product-price-font-weight, bold);
    color: #e74c3c;
    align-items: baseline;
}

.product-ranking-section .product-price .only-price {
    font-size: var(--product-price-font-size, 16px);
    font-weight: var(--product-price-font-weight, bold);
    color: #000;
}

.product-ranking-section .product-price .compare-price,
.product-ranking-section .product-price .tax-text {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: normal;
}

.product-ranking-section .product-price .tax-text {
    font-size: 12px;
    margin-left: 5px;
    text-decoration: none;
}


/* More Button */
.product-ranking-section .more-button {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
    padding: 12px 24px;
    background-color: rgb(var(--color-button-background));
    color: rgb(var(--color-button-text));
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.product-ranking-section .more-button:hover {
    background-color: rgb(var(--color-button-background));
    color: rgb(var(--color-button-text));
    opacity: 0.9;
    text-decoration: none;
}

.product-ranking-section .more-button:empty {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .product-ranking-section .ranking-container {
        padding: 0 15px;
    }

    .product-ranking-section .section-header {
        margin-bottom: 15px;
    }

    .product-ranking-section .section-title {
        /* font-size: clamp(18px, 5vw, 24px) !important; */
    }

    .product-ranking-section .section-subtitle {
        /* font-size controlled by typography class */
    }

    .product-ranking-section .tab-navigation {
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .product-ranking-section .tab-navigation::-webkit-scrollbar {
        display: none;
    }

    .product-ranking-section .tab-item {
        padding: 8px 20px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .product-ranking-section .product-grid,
    .product-ranking-section.slider-mode .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        overflow-x: visible;
    }

    /* 移动端左右滑动模式 */
    .product-ranking-section.mobile-slider-mode .product-grid {
        display: flex;
        grid-template-columns: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 12px;
        padding-bottom: 4px;
        padding-top:20px;
    }

    .product-ranking-section.mobile-slider-mode .product-grid::-webkit-scrollbar {
        display: none;
    }

    .product-ranking-section.mobile-slider-mode .product-grid .product-card {
        flex: 0 0 calc((100% - 12px) / 1.8);
        min-width: calc((100% - 12px) / 1.8);
        width: calc((100% - 12px) / 1.8);
        scroll-snap-align: start;
        transform: unset;
        box-shadow: unset;
    }

    .product-ranking-section.slider-mode .product-card {
        flex: none;
        /* min-width: auto; */
        transform: unset;
        box-shadow: unset;
    }

    .product-ranking-section .product-card:hover,
    .product-ranking-section .product-card:hover .product-image img {
        transform: unset;
        box-shadow: unset;
    }

    .product-ranking-section .slider-nav {
        display: none;
    }

    /* 移动端滑动模式：显示左右箭头 */
    .product-ranking-section.mobile-slider-mode .slider-nav {
        display: flex;
        width: 30px;
        height: 30px;
    }

    .product-ranking-section.mobile-slider-mode .slider-nav svg {
        width: 16px;
        height: 16px;
    }

    .product-ranking-section.mobile-slider-mode .slider-nav-prev {
        left: 4px;
    }

    .product-ranking-section.mobile-slider-mode .slider-nav-next {
        right: 4px;
    }

    /* 到达首/尾时隐藏对应箭头 */
    .product-ranking-section.mobile-slider-mode .slider-nav.disabled {
        display: none;
    }

    .product-ranking-section .product-title {
        font-size: calc(var(--product-title-font-size, 14px) - 1px);
    }

    .product-ranking-section .product-price {
        font-size: calc(var(--product-title-font-size, 14px) - 1px);
    }

    .product-ranking-section .product-price .only-price {
        font-size: calc(var(--product-price-font-size, 16px) - 3px);
    }

    .product-ranking-section .product-price .compare-price,
    .product-ranking-section .product-price .tax-text {
        font-size: 11px;
    }

    .product-ranking-section .ranking-badge {
        width: 25px;
        height: 25px;
        font-size: 11px;
        top: -16px;
        left: 2px;
    }

    .product-ranking-section .more-button {
        font-size: 14px;
        padding: 10px 20px;
        margin: 20px auto 0;
    }
}

@media (max-width: 480px) {
    .product-ranking-section .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .product-ranking-section .product-info {
        padding: 10px;
    }
}

/* Quick Add (加购) */
.product-ranking-section .pr-quick-add-modal {
    position: static;
}

.product-ranking-section .pr-quick-add {
    position: absolute;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    list-style: none;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: .7;
}

.product-ranking-section .pr-quick-add::-webkit-details-marker {
    display: none;
}

.product-ranking-section .pr-quick-add:hover {
    transform: scale(1.08);
}

.product-ranking-section .pr-quick-add svg {
    width: 17px;
    height: 17px;
    color: #29252c;
}

.product-ranking-section .pr-quick-add.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.product-ranking-section .pr-quick-add .icon-loading {
    display: none;
}

.product-ranking-section .pr-quick-add.loading {
    pointer-events: none;
}

.product-ranking-section .pr-quick-add.loading .icon-quick-add {
    display: none;
}

.product-ranking-section .pr-quick-add.loading .icon-loading {
    display: block;
}

/* 四角位置 */
.product-ranking-section .pr-quick-add--top-left {
    top: 8px;
    left: 8px;
}

.product-ranking-section .pr-quick-add--top-right {
    top: 8px;
    right: 8px;
}

.product-ranking-section .pr-quick-add--bottom-left {
    bottom: 8px;
    left: 8px;
}

.product-ranking-section .pr-quick-add--bottom-right {
    bottom: 8px;
    right: 8px;
}

@media (max-width: 768px) {
    .product-ranking-section .pr-quick-add {
        width: 32px;
        height: 32px;
    }

    .product-ranking-section .pr-quick-add svg {
        width: 15px;
        height: 15px;
    }
}