/* RouteProductSection — 產品路由卡片區塊（T1）
   規格來源：Klook「熱門活動」實測值（圓角 12px、欄距 20px、hover 陰影 0 4px 20px #00000014、
   文字色 #212121／#757575、標籤底 #f5f5f5、骨架 0.8s linear infinite alternate #f5f5f5→#e6e6e6、箭頭 32px 圓）
   顏色沿用本站 token：--primary-color #3e3e3e、--secondary-color #e27513、--third-color #ed8323 */

.route-product-section {
    padding: 20px 0 40px;
}

.route-product-section .rp-head {
    text-align: center;
    margin-bottom: 18px;
}

/* 格線：欄數由元件 inline CSS var 控制（--rp-cols-sm/md/xl） */
.route-product-section .rp-track {
    display: grid;
    grid-template-columns: repeat(var(--rp-cols-sm, 2), minmax(0, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .route-product-section .rp-track {
        grid-template-columns: repeat(var(--rp-cols-md, 3), minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .route-product-section .rp-track {
        grid-template-columns: repeat(var(--rp-cols-xl, 4), minmax(0, 1fr));
    }
}

/* 卡片 */
.route-product-section .rp-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px #0000000f;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.route-product-section .rp-card:hover,
.route-product-section .rp-card:focus {
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 20px #00000014;
    transform: translateY(-2px);
}

.route-product-section .rp-card__img {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f5f5f5;
}

.route-product-section .rp-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.32s cubic-bezier(0.22, 0, 0.08, 1);
}

.route-product-section .rp-card:hover .rp-card__img img {
    transform: scale(1.04);
}

.route-product-section .rp-card__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    flex: 1;
}

.route-product-section .rp-card__title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #212121;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    word-break: break-word;
}

.route-product-section .rp-card__marks {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: #757575;
}

.route-product-section .rp-mark--rating i {
    color: var(--secondary-color, #e27513);
}

.route-product-section .rp-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 20px;
    overflow: hidden;
}

.route-product-section .rp-tag {
    background: #f5f5f5;
    color: #616161;
    border-radius: 6px;
    padding: 0 8px;
    font-size: 11.5px;
    line-height: 18px;
    white-space: nowrap;
}

.route-product-section .rp-card__price {
    margin-top: 2px;
    font-size: 16px;
    font-weight: 700;
    color: #212121;
}

/* 骨架卡（尺寸同真卡一致，避免載入後跳位） */
.route-product-section .rp-card--skeleton {
    box-shadow: none;
    pointer-events: none;
}

.route-product-section .rp-skel {
    background: #f5f5f5;
    border-radius: 6px;
    animation: rp-skel-pulse 0.8s linear infinite alternate;
}

.route-product-section .rp-skel--img {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 0;
}

.route-product-section .rp-skel--line {
    height: 14px;
}

.route-product-section .rp-skel--short {
    width: 60%;
}

.route-product-section .rp-skel--price {
    height: 18px;
    width: 42%;
    margin-top: 4px;
}

@keyframes rp-skel-pulse {
    from { background-color: #f5f5f5; }
    to { background-color: #e6e6e6; }
}

/* 單行橫滑 layout（手機大卡＋露出下一張，同 Klook 89.6% 一致） */
.route-product-section--scroll .rp-viewport {
    position: relative;
}

.route-product-section--scroll .rp-track {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px;
}

.route-product-section--scroll .rp-track::-webkit-scrollbar {
    display: none;
}

.route-product-section--scroll .rp-card {
    flex: 0 0 89.6%;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .route-product-section--scroll .rp-card {
        flex: 0 0 calc((100% - 40px) / 2.6);
    }
}

@media (min-width: 1200px) {
    .route-product-section--scroll .rp-card {
        flex: 0 0 calc((100% - 40px) / 3.4);
    }
}

/* 箭頭（Klook：32px 圓、#fff 底、1px #e6e6e6 邊） */
.route-product-section .rp-arrow {
    position: absolute;
    top: 50%;
    margin-top: -16px;
    z-index: 9;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e6e6e6;
    color: #757575;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.route-product-section .rp-arrow:hover {
    box-shadow: 0 4px 20px #00000014;
}

.route-product-section .rp-arrow--prev {
    left: 4px;
}

.route-product-section .rp-arrow--next {
    right: 4px;
}

/* 夠闊（≥1400px）先將箭頭放出容器外（同 Klook -42px 一致） */
@media (min-width: 1400px) {
    .route-product-section .rp-arrow--prev {
        left: -42px;
    }

    .route-product-section .rp-arrow--next {
        right: -42px;
    }
}

.route-product-section .rp-empty {
    text-align: center;
    color: #757575;
    padding: 24px 0;
    margin: 0;
}

/* ---------- 角標角標（route-product-config.php 的 badges：熱門／全新…）---------- */
.route-product-section .rp-card__badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 2;
}

.route-product-section .rp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    line-height: 18px;
    color: #fff;
    background: #ed8323;
    white-space: nowrap;
}

.route-product-section .rp-badge--hot { background: #ed8323; }

.route-product-section .rp-badge--new { background: #1a7f37; }

.route-product-section .rp-badge--festive { background: #b03030; }

@media (max-width: 767px) {
    .route-product-section .rp-card__badges {
        top: 6px;
        left: 6px;
        gap: 3px;
    }

    .route-product-section .rp-badge {
        font-size: 11px;
        line-height: 16px;
        padding: 1px 6px;
    }
}
