/* 寵物外出用品跨平台比價系統 - 自訂樣式表 (相容 Bootstrap 5) */

:root {
    --platform-shopee: #ee4d2d;
    --platform-momo: #d80064;
    --platform-pchome: #0079c2;
    --platform-petstore: #10b981;
    --platform-petpetgo: #f97316;
    --platform-petchoice: #0d9488;
    --platform-maoup: #d97706;
    --platform-rickypet: #2563eb;
    --platform-petpark: #16a34a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
    color: #2d3748;
}

/* 平台專屬標籤顏色 */
.badge-shopee {
    background-color: var(--platform-shopee);
    color: #ffffff;
}
.badge-momo {
    background-color: var(--platform-momo);
    color: #ffffff;
}
.badge-pchome {
    background-color: var(--platform-pchome);
    color: #ffffff;
}
.badge-petstore {
    background-color: var(--platform-petstore);
    color: #ffffff;
}
.badge-petpetgo {
    background-color: var(--platform-petpetgo);
    color: #ffffff;
}
.badge-petchoice {
    background-color: var(--platform-petchoice);
    color: #ffffff;
}
.badge-maoup {
    background-color: var(--platform-maoup);
    color: #ffffff;
}
.badge-rickypet {
    background-color: var(--platform-rickypet);
    color: #ffffff;
}
.badge-petpark {
    background-color: var(--platform-petpark);
    color: #ffffff;
}

/* 商品卡片懸停效果 */
.product-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 0.75rem;
    overflow: hidden;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08) !important;
}

.product-img-wrapper {
    position: relative;
    height: 220px;
    background-color: #f8f9fa;
    overflow: hidden;
}

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

.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

/* 價差高亮標籤 */
.price-gap-tag {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

/* 平台比價條 */
.platform-price-pill {
    font-size: 0.82rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.platform-price-pill.is-lowest {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #065f46;
    font-weight: 700;
}

/* 通行密碼解鎖卡片 */
.gate-card {
    max-width: 460px;
    border-radius: 1rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 表格縮圖與無圖片佔位符 */
.product-thumb-container {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-thumb-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-image-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    color: #94a3b8;
    font-size: 0.65rem;
    text-align: center;
    user-select: none;
}

.no-image-fallback i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

/* 表格標頭可排序樣式 (Table Sorting Styles) */
.table-sort-link {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease-in-out;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    color: #1e293b;
    text-decoration: none !important;
}

.table-sort-link:hover {
    background-color: rgba(99, 102, 241, 0.1);
    color: #4f46e5 !important;
}

.table-sort-link:hover .sort-icon-idle {
    color: #4f46e5 !important;
    opacity: 1 !important;
}

.table-sort-link.is-active-sort {
    background-color: rgba(99, 102, 241, 0.15);
    color: #312e81 !important;
    font-weight: 700;
}

/* 快捷排序工具列微型按鈕 */
.quick-sort-pill {
    transition: all 0.15s ease;
    font-size: 0.78rem;
    font-weight: 500;
}

.quick-sort-pill:hover {
    transform: translateY(-1px);
}

/* ==================== 全站 RWD (Responsive Web Design) 專用優化 ==================== */

/* 隱藏滾動條但保持滑動功能 (Mobile Native-app Feeling) */
.hide-scrollbar {
    -ms-overflow-style: none; /* IE / Edge */
    scrollbar-width: none; /* Firefox */
}
.hide-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome / Safari / Opera */
}

/* 手機版橫向滑動工具列 */
.mobile-swipe-bar {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    padding-bottom: 0.25rem;
    padding-top: 0.15rem;
}

/* 手機版滑動提示條 */
.mobile-scroll-hint {
    background: linear-gradient(90deg, #e0e7ff 0%, #ede9fe 100%);
    color: #4338ca;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-bottom: 1px solid #c7d2fe;
}

/* 確保大表格在手機橫向滾動時不擠壓欄位內容 */
#comparisonTable {
    min-width: 1080px;
}

#detailListingsTable {
    min-width: 860px;
}

/* 平滑滾動與觸控彈性 */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* 手機端懸浮視圖切換器 (浮動捷徑) */
.floating-mobile-view-btn {
    position: fixed;
    bottom: 20px;
    right: 16px;
    z-index: 1040;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    border-radius: 50rem;
    padding: 0.55rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.floating-mobile-view-btn:active {
    transform: scale(0.95);
}

/* 針對小螢幕設備 (<576px / 手機直立) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .product-img-wrapper {
        height: 180px;
    }

    .product-thumb-container {
        width: 48px;
        height: 48px;
        min-width: 48px;
        border-radius: 6px;
    }

    /* 調整主要指標字體，防止在 375px 手機上折行破版 */
    .fs-responsive-kpi {
        font-size: 1.15rem !important;
    }

    /* 頂部快速操作按鈕優化 */
    .mobile-header-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .mobile-header-actions .btn-group,
    .mobile-header-actions .btn {
        width: 100%;
    }

    /* 麵包屑導航限制單行並可滑動 */
    .breadcrumb-mobile {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* 通行密碼解鎖頁面邊距 */
    .gate-card-mobile {
        border-radius: 1rem !important;
        margin: 0.5rem;
    }
}

/* 針對平板設備 (576px ~ 991.98px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .product-img-wrapper {
        height: 200px;
    }

    .fs-responsive-kpi {
        font-size: 1.35rem !important;
    }
}

/* 針對桌面設備 (>=992px) */
@media (min-width: 992px) {
    .fs-responsive-kpi {
        font-size: 1.5rem !important;
    }
}


