/**
 * 商城頁面樣式
 * /pages/products.php
 */

/* 全局變數 - 使用網站主色調 */
:root {
    --product-primary: var(--primary, var(--color-primary));
    --product-primary-dark: var(--primary-dark, var(--color-primary-dark));
    --product-bg: var(--bg-body, var(--bg-body));
    --text-secondary: var(--text-light, #999999);
    --border-color: rgba(170, 145, 119, 0.15);
}

body {
    background-color: var(--product-bg);
}

/* ─── 標題副標打字機效果 ─── */
.products-typewriter {
    min-height: 1.4em;
}

.products-typewriter-cursor {
    display: inline-block;
    margin-left: 1px;
    color: var(--product-primary);
    animation: products-typewriter-blink 0.8s step-end infinite;
}

@keyframes products-typewriter-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* 容器 */
.products-container {
    max-width: 1200px;
    margin: 0 auto;
    /* 與 services/cart 等頁面一致，預留導覽列高度與上方空間 */
    padding: 0;
}

@media (max-width: 767.98px) {
    .products-container {
        /* 手機版導覽列較矮，頂部間距略縮小 */
        padding: 100px 15px 20px;
    }
}

/* 商品卡片 - 簡約美業風格 */
.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--product-primary);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.15);
    transform: translateY(-2px);
}

/* 購買資格限制商品：灰階、無 hover 效果 */
.product-card.is-ineligible {
    filter: grayscale(0.65);
    opacity: 0.72;
    cursor: default;
}
.product-card.is-ineligible:hover {
    border-color: var(--border-color);
    box-shadow: none;
    transform: none;
}

/* 購買資格限制遮罩（覆蓋在圖片上） */
.product-ineligible-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #fff;
    text-align: center;
}
.product-ineligible-overlay .ineligible-icon {
    font-size: 22px;
}
.product-ineligible-overlay .ineligible-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* 首頁嚴選卡片：資格限制 */
.pc-card--ineligible {
    filter: grayscale(0.65);
    opacity: 0.72;
}
.pc-card--ineligible .pc-cart-btn {
    background: #bbb !important;
    color: #fff !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* 圖片容器 */
.product-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--product-bg);
    position: relative;
}

.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);
}

/* 標籤容器 - 優化多標籤排列 */
.product-badges-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
    pointer-events: none;
}

.product-badges-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
}

.product-badges-left,
.product-badges-right {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 48%;
}

.product-badges-left {
    justify-content: flex-start;
}

.product-badges-right {
    justify-content: flex-end;
}

/* 標籤基本樣式 */
.product-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.product-badge i {
    font-size: 9px;
    margin-right: 2px;
}

/* 折扣徽章 - 最高優先級（左上） */
.product-badge.discount {
    background: linear-gradient(135deg, var(--color-danger) 0%, #c82333 100%);
    color: #fff;
    font-size: 11px;
    padding: 5px 10px;
}

/* 期間限定徽章（左上） */
.product-badge.limited-time {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* 限量徽章（左下） */
.product-badge.limited-qty {
    background: rgba(220, 53, 69, 0.95);
    color: #fff;
    position: absolute;
    bottom: 8px;
    left: 8px;
}

/* 熱銷徽章（右上） */
.product-badge.hot {
    background: linear-gradient(135deg, var(--color-warning) 0%, #ff9800 100%);
    color: #fff;
}

/* 新品徽章（右上） */
.product-badge.new {
    background: linear-gradient(135deg, var(--color-success) 0%, #20c997 100%);
    color: #fff;
}

/* 推薦徽章（右上） */
.product-badge.recommended {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #fff;
}

/* 商品資訊 */
.product-card-body {
    padding: 20px;
}

/* 商品分類標籤 - 簡潔設計 */
.product-category-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 24px;
}

.product-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.product-category-tag i {
    font-size: 9px;
}

/* 主要分類標籤 */
.product-category-tag.primary {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.12) 0%, rgba(170, 145, 119, 0.08) 100%);
    color: var(--product-primary);
    border: 1px solid rgba(170, 145, 119, 0.2);
}

.product-card:hover .product-category-tag.primary {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.18) 0%, rgba(170, 145, 119, 0.12) 100%);
    border-color: rgba(170, 145, 119, 0.3);
}

/* 次要分類標籤（如果需要） */
.product-category-tag.secondary {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 10px;
    padding: 3px 8px;
}

/* 舊版相容 */
.product-category-breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.product-category {
    display: inline-block;
    background: rgba(170, 145, 119, 0.08);
    color: var(--product-primary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.product-price-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--product-primary);
    line-height: 1.2;
}

.product-original-price {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: line-through;
    line-height: 1.2;
}

/* 搜尋和排序區域 */
.product-controls {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.05);
}

@media (min-width: 768px) {
    .product-controls {
        padding: 14px 20px;
    }
}

.product-search-input {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    transition: all 0.3s ease;
    height: auto;
}

@media (min-width: 768px) {
    .product-search-input {
        padding: 6px 12px;
    }
}

.product-search-input:focus {
    border-color: var(--product-primary);
    box-shadow: 0 0 0 3px rgba(170, 145, 119, 0.1);
    outline: none;
}

.product-sort-select {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    height: auto;
}

@media (min-width: 768px) {
    .product-sort-select {
        padding: 6px 12px;
    }
}

.product-sort-select:hover {
    border-color: var(--product-primary);
}

/* 按鈕 */
.btn-product-primary {
    background: var(--product-primary);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 14px;
}

@media (min-width: 768px) {
    .btn-product-primary {
        padding: 6px 16px;
    }
}

.btn-product-primary:hover {
    background: var(--product-primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(170, 145, 119, 0.2);
}

/* 區塊標題 */
.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 8px;
}

/* ===== 側邊欄優雅設計 ===== */

/* 側邊欄卡片 - 精緻風格 */
.sidebar-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafaf9 100%);
    border: 1px solid rgba(170, 145, 119, 0.12);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 16px rgba(170, 145, 119, 0.08);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    box-shadow: 0 6px 20px rgba(170, 145, 119, 0.12);
    border-color: rgba(170, 145, 119, 0.18);
}

/* 側邊欄標題區域 - 優雅頭部 */
.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    padding: 24px 24px 20px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.05) 0%, rgba(170, 145, 119, 0.02) 100%);
    border-bottom: 1px solid rgba(170, 145, 119, 0.1);
    position: relative;
}

.sidebar-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    border-radius: 16px 0 0 0;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(170, 145, 119, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sidebar-title i {
    font-size: 16px;
    color: var(--product-primary);
}

/* 篩選區塊容器 */
.filter-section {
    padding: 20px 24px;
    margin: 0;
    border-bottom: 1px solid rgba(170, 145, 119, 0.08);
    transition: all 0.3s ease;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-section:hover {
    background: rgba(170, 145, 119, 0.02);
}

/* 篩選標題 - 精緻設計 */
.filter-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--product-primary-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.filter-title i {
    font-size: 13px;
    color: var(--product-primary);
    opacity: 0.8;
}

.filter-option {
    display: block;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.filter-option:hover {
    background: rgba(170, 145, 119, 0.05);
}

.filter-option input[type="radio"]:checked + span {
    color: var(--product-primary);
    font-weight: 600;
}

/* 響應式 */
@media (max-width: 767.98px) {
    .product-img-wrapper {
        height: 180px;
    }

    .product-card-body {
        padding: 16px;
    }

    .product-controls {
        padding: 16px;
    }
}

/* ===== 價格範圍滑桿 ===== */
.price-range-container {
    margin-bottom: 20px;
}

.price-range-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.05) 0%, rgba(170, 145, 119, 0.02) 100%);
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(170, 145, 119, 0.08);
}

.price-range-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.price-range-values {
    font-size: 13px;
    color: var(--product-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.price-range-slider-wrapper {
    position: relative;
    height: 40px;
    display: flex;
    align-items: center;
}

.price-range-track {
    position: absolute;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, rgba(170, 145, 119, 0.1) 0%, rgba(170, 145, 119, 0.15) 50%, rgba(170, 145, 119, 0.1) 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.price-range-progress {
    position: absolute;
    height: 5px;
    background: linear-gradient(90deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(170, 145, 119, 0.3);
}

.price-range-slider {
    position: relative;
    width: 100%;
}

.price-range-input {
    position: absolute;
    width: 100%;
    height: 4px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.price-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    cursor: pointer;
    pointer-events: auto;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(170, 145, 119, 0.3), 0 0 0 0 rgba(170, 145, 119, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(170, 145, 119, 0.4), 0 0 0 4px rgba(170, 145, 119, 0.1);
}

.price-range-input::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.5), 0 0 0 6px rgba(170, 145, 119, 0.15);
}

.price-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    cursor: pointer;
    pointer-events: auto;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(170, 145, 119, 0.3), 0 0 0 0 rgba(170, 145, 119, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.price-range-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(170, 145, 119, 0.4), 0 0 0 4px rgba(170, 145, 119, 0.1);
}

.price-range-input::-moz-range-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.5), 0 0 0 6px rgba(170, 145, 119, 0.15);
}

/* ===== 庫存進度條 ===== */
.product-stock-bar {
    margin-bottom: 8px;
}

.product-stock-bar .progress {
    background-color: rgba(170, 145, 119, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.product-stock-bar .progress-bar {
    transition: width 0.3s ease;
}

.product-stock-info {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-stock-info i {
    font-size: 10px;
}

.product-stock-info .text-danger {
    color: var(--color-danger) !important;
}

.product-stock-info .text-warning {
    color: var(--color-warning) !important;
}

.product-stock-info .text-success {
    color: var(--color-success) !important;
}

/* ===== 側邊欄分類篩選 - 優雅列表設計 ===== */

/* 分類列表容器 */
.category-filter-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 分類項目淡入動畫 */
.category-item-wrapper {
    animation: fadeInUp 0.4s ease backwards;
}

.category-item-wrapper:nth-child(1) { animation-delay: 0.05s; }
.category-item-wrapper:nth-child(2) { animation-delay: 0.1s; }
.category-item-wrapper:nth-child(3) { animation-delay: 0.15s; }
.category-item-wrapper:nth-child(4) { animation-delay: 0.2s; }
.category-item-wrapper:nth-child(5) { animation-delay: 0.25s; }
.category-item-wrapper:nth-child(6) { animation-delay: 0.3s; }
.category-item-wrapper:nth-child(7) { animation-delay: 0.35s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分類項目包裝器 */
.category-item-wrapper {
    display: flex;
    flex-direction: column;
}

/* 主分類項目 - 精緻設計 */
.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

/* 主分類懸停效果 - 優雅動畫 */
.category-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, var(--product-primary) 0%, transparent 100%);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.category-item:hover::before {
    width: 100%;
}

.category-item:hover {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.08) 0%, rgba(170, 145, 119, 0.04) 100%);
    border-color: rgba(170, 145, 119, 0.15);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.08);
}

/* 主分類選中狀態 - 優雅高亮 */
.category-item.active {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.15) 0%, rgba(170, 145, 119, 0.08) 100%);
    border-color: rgba(170, 145, 119, 0.25);
    box-shadow: 0 2px 12px rgba(170, 145, 119, 0.12);
}

.category-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    border-radius: 0 2px 2px 0;
}

.category-item.active .category-item-name {
    color: var(--product-primary);
    font-weight: 600;
}

/* 分類內容（左側） */
.category-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

/* 展開/收合箭頭 - 精緻設計 */
.category-expand-icon {
    font-size: 9px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0.6;
}

.category-expand-icon.expanded {
    transform: rotate(90deg);
    color: var(--product-primary);
    opacity: 1;
}

.category-item:hover .category-expand-icon {
    opacity: 1;
}

/* 分類圖標 - 精緻圓形背景 */
.category-item-icon {
    font-size: 13px;
    color: var(--product-primary);
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.12) 0%, rgba(170, 145, 119, 0.06) 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-item:hover .category-item-icon {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.18) 0%, rgba(170, 145, 119, 0.10) 100%);
    transform: scale(1.05);
}

.category-item.active .category-item-icon {
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(170, 145, 119, 0.3);
}

/* 分類名稱 */
.category-item-name {
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

/* 「全部商品」特殊樣式 */
.category-item-wrapper:first-child .category-item {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.04) 0%, rgba(170, 145, 119, 0.02) 100%);
    border: 1px solid rgba(170, 145, 119, 0.08);
}

.category-item-wrapper:first-child .category-item.active {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.18) 0%, rgba(170, 145, 119, 0.10) 100%);
    border-color: rgba(170, 145, 119, 0.3);
}

/* 商品數量 - 精緻徽章 */
.category-item-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.03) 100%);
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.category-item:hover .category-item-count {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.12) 0%, rgba(170, 145, 119, 0.08) 100%);
    border-color: rgba(170, 145, 119, 0.15);
}

.category-item.active .category-item-count {
    background: linear-gradient(135deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(170, 145, 119, 0.25);
}

/* 子分類列表 - 流暢展開動畫 */
.subcategory-list {
    display: none;
    flex-direction: column;
    gap: 3px;
    padding-left: 32px;
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease 0.1s,
                margin-top 0.3s ease;
}

.subcategory-list.expanded {
    display: flex;
    max-height: 600px;
    opacity: 1;
    margin-top: 6px;
}

/* 子分類項目淡入動畫 */
.subcategory-list.expanded .subcategory-item {
    animation: fadeInLeft 0.3s ease backwards;
}

.subcategory-list.expanded .subcategory-item:nth-child(1) { animation-delay: 0.05s; }
.subcategory-list.expanded .subcategory-item:nth-child(2) { animation-delay: 0.1s; }
.subcategory-list.expanded .subcategory-item:nth-child(3) { animation-delay: 0.15s; }
.subcategory-list.expanded .subcategory-item:nth-child(4) { animation-delay: 0.2s; }
.subcategory-list.expanded .subcategory-item:nth-child(5) { animation-delay: 0.25s; }
.subcategory-list.expanded .subcategory-item:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 子分類項目 - 精緻優雅設計 */
.subcategory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    border: 1px solid transparent;
    position: relative;
}

.subcategory-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 50%;
    background: linear-gradient(90deg, var(--product-primary) 0%, transparent 100%);
    transition: width 0.25s ease;
    opacity: 0.15;
    border-radius: 4px 0 0 4px;
}

.subcategory-item:hover {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.06) 0%, rgba(170, 145, 119, 0.03) 100%);
    border-color: rgba(170, 145, 119, 0.1);
    transform: translateX(2px);
}

.subcategory-item:hover::before {
    width: 3px;
}

.subcategory-item.active {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.12) 0%, rgba(170, 145, 119, 0.06) 100%);
    border-color: rgba(170, 145, 119, 0.2);
    box-shadow: 0 2px 6px rgba(170, 145, 119, 0.08);
}

.subcategory-item.active::before {
    width: 3px;
    opacity: 1;
    background: linear-gradient(180deg, var(--product-primary) 0%, var(--product-primary-dark) 100%);
}

.subcategory-item.active .subcategory-item-name {
    color: var(--product-primary);
    font-weight: 600;
}

/* 子分類名稱 */
.subcategory-item-name {
    font-size: 13px;
    color: var(--text-main);
    flex: 1;
    transition: all 0.2s ease;
}

/* 子分類數量 - 精緻徽章 */
.subcategory-item-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.03) 100%);
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
}

.subcategory-item:hover .subcategory-item-count {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.1) 0%, rgba(170, 145, 119, 0.06) 100%);
    border-color: rgba(170, 145, 119, 0.12);
}

.subcategory-item.active .subcategory-item-count {
    background: linear-gradient(135deg, rgba(170, 145, 119, 0.25) 0%, rgba(170, 145, 119, 0.15) 100%);
    color: var(--product-primary);
    border-color: rgba(170, 145, 119, 0.2);
    box-shadow: 0 1px 3px rgba(170, 145, 119, 0.15);
}

/* ─── 分類手風琴（不限深度遞迴，縮排由層級決定）─── */
.category-tree {
    /* 每多一層子分類，往內縮排的基準量；用 CSS 變數集中管理，避免各層寫死 */
    --indent-step: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* .category-item 現為連結，需移除連結預設樣式 */
.category-tree .category-item {
    text-decoration: none;
    color: inherit;
}

/* 葉節點（無子分類）的小圓點，取代展開箭頭佔位，維持左緣對齊 */
.category-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--product-primary);
    opacity: 0.35;
    flex-shrink: 0;
}

.category-item.active .category-item-dot,
.category-item:hover .category-item-dot {
    opacity: 0.9;
}

/* active 路徑上（非選中本身）的父節點：低調高亮，提示目前所在分支 */
.category-item.on-path .category-item-name {
    color: var(--product-primary);
    font-weight: 600;
}

/*
 * 遞迴縮排與層級縮小：
 * 每一層 .subcategory-list 都在前一層基礎上再往內縮 --indent-step，
 * 巢狀選擇器天然疊加，不需為每一層寫死 class。
 */
.category-tree .subcategory-list {
    padding-left: var(--indent-step);
    gap: 3px;
}

/* 越深層字級與內距略縮，維持視覺層次 */
.category-tree .subcategory-list .category-item {
    padding: 9px 12px;
}
.category-tree .subcategory-list .category-item-name {
    font-size: 13px;
}
.category-tree .subcategory-list .subcategory-list .category-item-name {
    font-size: 12.5px;
}
.category-tree .subcategory-list .category-item-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

/* 側邊欄價格範圍優化 */
.filter-section .price-range-container {
    margin-bottom: 0;
}

.filter-section .price-range-header {
    margin-bottom: 16px;
    justify-content: center;
}

.filter-section .price-range-label {
    display: none; /* 標題已在 filter-title 顯示 */
}

.filter-section .price-range-values {
    font-size: 15px;
    color: var(--product-primary);
    font-weight: 700;
    width: 100%;
    text-align: center;
}

/* 響應式設計 */
@media (max-width: 767.98px) {
    .sidebar-card {
        border-radius: 12px;
    }

    .sidebar-title {
        font-size: 16px;
        padding: 20px 20px 16px;
    }

    .filter-section {
        padding: 16px 20px;
    }

    .category-item {
        padding: 10px 12px;
    }

    .category-item-icon {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .category-item-name {
        font-size: 13px;
    }

    .category-item-count {
        font-size: 10px;
        padding: 3px 8px;
    }

    .subcategory-list {
        padding-left: 28px;
    }

    .subcategory-item {
        padding: 7px 10px;
    }

    .subcategory-item-name {
        font-size: 12px;
    }

    .subcategory-item-count {
        font-size: 10px;
        padding: 2px 6px;
    }

    .price-range-header {
        padding: 8px 12px;
    }

    .price-range-values {
        font-size: 13px;
    }

    .category-filter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .category-filter-card {
        padding: 10px;
        min-height: 80px;
    }

    .category-filter-icon {
        width: 32px;
        height: 32px;
    }

    .category-filter-icon i {
        font-size: 14px;
    }

    .category-filter-name {
        font-size: 12px;
    }

    .category-filter-count {
        font-size: 10px;
    }

    .subcategory-pill {
        font-size: 12px;
        padding: 5px 10px;
    }

    .subcategory-pill-count {
        font-size: 10px;
        min-width: 18px;
        height: 18px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .category-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .category-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 限時特賣區塊 - 蝦皮風格 ===== */

.flash-sale-section {
    background: linear-gradient(135deg, #fff5e6 0%, #ffe9cc 100%);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

/* 限時特賣頭部 */
.flash-sale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.flash-sale-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #ee4d2d;
}

.flash-sale-title i {
    font-size: 20px;
    color: var(--color-warning);
}

/* 簡潔倒數計時器 */
.flash-sale-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.countdown-timer {
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #ee4d2d;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(238, 77, 45, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* 橫向滾動商品列表 */
.flash-sale-products {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 隱藏滾動條但保持功能 */
.flash-sale-products::-webkit-scrollbar {
    height: 6px;
}

.flash-sale-products::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.flash-sale-products::-webkit-scrollbar-thumb {
    background: rgba(238, 77, 45, 0.3);
    border-radius: 4px;
}

.flash-sale-products::-webkit-scrollbar-thumb:hover {
    background: rgba(238, 77, 45, 0.5);
}

/* 限時特賣商品項目 */
.flash-sale-item {
    flex: 0 0 160px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.flash-sale-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--product-primary);
}

/* 商品圖片 */
.flash-sale-item-img {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    background: #f5f5f5;
}

.flash-sale-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.flash-sale-item:hover .flash-sale-item-img img {
    transform: scale(1.05);
}

/* 折扣標籤 */
.flash-sale-discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ee4d2d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(238, 77, 45, 0.3);
}

/* 商品資訊 */
.flash-sale-item-info {
    padding: 10px;
}

/* 價格區域 */
.flash-sale-item-price {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.flash-sale-item-price .sale-price {
    font-size: 16px;
    font-weight: 700;
    color: #ee4d2d;
}

.flash-sale-item-price .original-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}

/* 商品名稱 */
.flash-sale-item-name {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* 每筆倒數計時 */
.flash-item-timer {
    font-size: 11px;
    color: #888;
    font-variant-numeric: tabular-nums;
}
.flash-item-timer.urgent {
    color: #ee4d2d;
    font-weight: 600;
}
.flash-item-timer.ended {
    color: #bbb;
}

/* 庫存進度條 */
.flash-sale-stock {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-bar {
    width: 100%;
    height: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.stock-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-warning) 0%, #ff9800 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.stock-text {
    font-size: 10px;
    color: #666;
    text-align: center;
}

/* 響應式設計 */
@media (max-width: 767.98px) {
    .flash-sale-section {
        padding: 12px;
        border-radius: 8px;
    }

    .flash-sale-header {
        margin-bottom: 12px;
    }

    .flash-sale-title {
        font-size: 16px;
    }

    .flash-sale-title i {
        font-size: 18px;
    }

    .countdown-timer {
        font-size: 14px;
        padding: 5px 10px;
    }

    .flash-sale-item {
        flex: 0 0 140px;
    }

    .flash-sale-item-img {
        height: 140px;
    }

    .flash-sale-item-info {
        padding: 8px;
    }

    .flash-sale-item-price .sale-price {
        font-size: 14px;
    }
}

/* === 缺貨商品遮罩 === */
.product-card.is-sold-out .product-img-wrapper img {
    filter: grayscale(60%);
}

.product-sold-out-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.product-sold-out-label {
    background: rgba(255, 255, 255, 0.92);
    color: #555;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 5px 18px;
    border-radius: 30px;
}

/* ── 新版服務風格篩選面板 ── */
/* 桌機版：欄位本身透明，讓頁面底色透出，才能與白色卡片形成對比 */
#prodFilterPanel {
    background: transparent;
}
/* 行動版：左滑抽屜才需要白底 */
@media (max-width: 991px) {
    #prodFilterPanel {
        background: #fff;
        position: fixed;
        top: 0;
        left: -110%;
        bottom: 0;
        width: min(85vw, 320px);
        z-index: 10000;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: left 0.3s;
        padding: 20px 0 80px;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }
    #prodFilterPanel.open {
        left: 0;
    }
    #prodFilterPanel .filter-panel {
        box-shadow: none;
        border: none;
        border-radius: 0;
    }
}
/* 行動版遮罩 */
.services-filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.services-filter-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
/* 搜尋按鈕 */
.filter-search-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #AA9177);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
/* 右側結果區 */
.services-results-wrap {
    padding-left: 0;
}
@media (min-width: 992px) {
    .services-results-wrap {
        padding-left: 28px;
    }
}
/* 排序列 */
.services-sort-bar {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #aaa;
}
.services-results-count {
    font-size: 13px;
    color: #aaa;
}
/* filter-option link 樣式 */
a.filter-option {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    font-size: 14px;
    transition: background 0.15s;
    cursor: pointer;
}
a.filter-option:hover { background: #faf8f5; }
a.filter-option.active { color: var(--primary, #AA9177); font-weight: 600; }
a.filter-option.active .filter-option-dot {
    border-color: var(--primary, #AA9177);
    background: var(--primary, #AA9177);
}
/* filter-chip link 樣式 */
a.filter-chip {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
a.filter-chip.active {
    background: var(--primary, #AA9177);
    color: #fff;
    border-color: var(--primary, #AA9177);
}
/* mobile toolbar */
.mobile-products-toolbar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 0 14px;
    border-bottom: 1px solid rgba(170,145,119,0.12);
    margin-bottom: 16px;
}
@media (max-width: 991px) {
    .mobile-products-toolbar { display: flex; }
}
.mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: #fff;
    border: 1.5px solid rgba(170,145,119,0.3);
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    min-height: 44px;
}
.mobile-filter-btn:hover {
    border-color: var(--primary, #AA9177);
    color: var(--primary, #AA9177);
    background: rgba(170,145,119,0.06);
}

/* ══════════════════════════════════════════════════════
   商城頁面 header 間距調整
   products.php 用 <section> tag，technicians.php 用 <div>
   所以 section.services-ecom-wrap 只作用於商城頁
   ══════════════════════════════════════════════════════ */
section.services-ecom-wrap .services-ecom-header {
    margin-bottom: 8px !important;
}
section.services-ecom-wrap > nav {
    padding-bottom: 0 !important;
    margin-bottom: 2px !important;
}

/* ══════════════════════════════════════════════════════
   Products 側邊欄 — 參照 technicians 正確結構修正
   結構：padding:20px / overflow:visible / border-radius:16px
   差異：頂部品牌色邊框、左邊框 accent、方形 chips
   ══════════════════════════════════════════════════════ */

/* 面板：與 technicians 相同結構，以頂部色邊框作為商城頁識別 */
#prodFilterPanel .filter-panel {
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(170,145,119,0.2);
    border-top: 4px solid #AA9177;
    box-shadow: 0 4px 20px rgba(170,145,119,0.08);
    overflow: visible;
    position: sticky;
    top: 90px;
}

/* 移除 ::before 色條（已改用 border-top，不需要） */
#prodFilterPanel .filter-panel::before {
    display: none;
}

/* 篩選區塊：與 technicians 一致的分隔方式 */
#prodFilterPanel .filter-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(170,145,119,0.12);
    padding: 0 0 16px;
}
#prodFilterPanel .filter-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* 篩選標題：略小、顏色較淡以示區別 */
#prodFilterPanel .filter-section-title {
    font-size: 11px;
    letter-spacing: 1px;
    color: #999;
}

/* Category 選項：左邊框 accent 取代圓點 */
#prodFilterPanel a.filter-option {
    border-left: 3px solid transparent;
    border-radius: 8px;
    padding: 8px 10px 8px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    font-size: 14px;
    color: var(--text-secondary, #666);
    transition: all 0.15s;
    gap: 0;
}
#prodFilterPanel a.filter-option:hover {
    background: var(--service-bg, #f8f7f5);
    color: var(--text-main, #1a1a1a);
    border-left-color: rgba(170,145,119,0.4);
}
#prodFilterPanel a.filter-option.active {
    background: rgba(170,145,119,0.1);
    color: var(--primary, #AA9177);
    font-weight: 600;
    border-left-color: var(--primary, #AA9177);
}

/* 隱藏圓點（改用左邊框） */
#prodFilterPanel .filter-option-dot {
    display: none;
}

/* 數量 badge */
#prodFilterPanel .filter-option-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    background: rgba(170,145,119,0.12);
    color: #aaa;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}
#prodFilterPanel a.filter-option.active .filter-option-count {
    background: rgba(170,145,119,0.2);
    color: var(--primary, #AA9177);
}

/* Filter Chips：方形（technicians 是 20px 藥丸） */
#prodFilterPanel a.filter-chip {
    border-radius: 6px;
}

/* 行動版：抽屜內不需要色邊框 */
@media (max-width: 991.98px) {
    #prodFilterPanel .filter-panel {
        border-top: 1px solid rgba(170,145,119,0.2);
        border-radius: 0;
        top: 0;
    }
}

/* ── 梯次型限時特賣：即將開始 Banner ── */
.upcoming-session-banner {
    background: linear-gradient(135deg, #fff3eb 0%, #ffe8d6 100%);
    border: 1px solid rgba(238, 77, 45, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
}
.upcoming-session-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.upcoming-session-name {
    font-weight: 600;
    color: #333;
}
.upcoming-session-time {
    color: #888;
    font-size: 12px;
}
.upcoming-countdown {
    margin-left: auto;
    color: #ee4d2d;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── 梯次型限時特賣：商品詳情徽章（products 頁共用） ── */
.flash-sale-session-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ee4d2d 0%, #ff6b3d 100%);
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}
.flash-sale-session-badge i {
    font-size: 12px;
}
.flash-sale-remaining {
    font-size: 12px;
    opacity: 0.9;
}
.flash-session-end-time {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    opacity: 0.9;
}

/* ── 庫存條（stock bar）── */
.stock-bar {
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}
.stock-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 2px;
}
.stock-text {
    font-size: 10px;
    color: var(--color-primary);
    font-weight: 600;
}
}

/* ── FSS Strip（品牌風格橫幅）── */
.fss-strip {
    background: var(--bg-surface);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.fss-strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 11px 16px;
}
.fss-strip-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-on-primary);
}
.fss-bolt {
    font-size: 17px;
    color: var(--color-warning);
    filter: drop-shadow(0 0 4px rgba(255,193,7,0.6));
}
.fss-title-text {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.fss-head-clock {
    background: rgba(0,0,0,0.15);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-on-primary);
    font-family: var(--font-number, monospace);
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 1px;
}
.fss-colon { opacity: 0.6; margin: 0 1px; }
.fss-viewall {
    color: rgba(255,255,255,0.88);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    transition: opacity 0.15s;
}
.fss-viewall:hover { opacity: 0.7; color: var(--text-on-primary); }
.fss-viewall i { font-size: 9px; }
/* 橫向滾動列 */
.fss-scroll-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 14px 14px;
    background: var(--color-primary-light);
}
.fss-scroll-row::-webkit-scrollbar { display: none; }
/* 商品卡 */
.fss-card {
    flex: 0 0 144px;
    scroll-snap-align: start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color-light);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: var(--shadow-xs);
}
.fss-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fss-card-img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-body);
}
.fss-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.28s;
}
.fss-card:hover .fss-card-img img { transform: scale(1.05); }
/* 折扣角標 */
.fss-badge {
    position: absolute;
    top: 0; left: 0;
    background: var(--color-primary);
    color: var(--text-on-primary);
    font-size: 10px; font-weight: 700;
    padding: 3px 7px;
    border-radius: 0 0 8px 0;
    display: flex; align-items: center; gap: 2px;
    letter-spacing: 0.02em;
}
.fss-badge i { font-size: 8px; color: var(--color-warning); }
/* 卡片資訊 */
.fss-card-body { padding: 8px 10px 10px; }
.fss-card-name {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 30px; margin-bottom: 5px;
    letter-spacing: 0.02em;
}
.fss-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-danger);
    font-family: var(--font-number, monospace);
    line-height: 1.1;
}
.fss-original {
    font-size: 10px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-bottom: 5px;
    font-family: var(--font-number, monospace);
}
.fss-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px; overflow: hidden;
    margin-top: 5px; margin-bottom: 3px;
}
.fss-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 2px;
}
.fss-hot { font-size: 10px; color: var(--color-primary); font-weight: 600; letter-spacing: 0.02em; }
/* 下一場提示 */
.fss-upcoming-chip {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    background: var(--bg-body);
    border-top: 1px solid var(--border-color-light);
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    letter-spacing: 0.02em;
}
.fss-upcoming-chip i { color: var(--color-primary); }
.fss-upcoming-chip strong { color: var(--text-primary); }
#upcomingCountdown, #homeUpcomingCountdown {
    color: var(--color-primary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-number, monospace);
    margin-left: 4px;
}
@media (max-width: 480px) {
    .fss-card { flex: 0 0 122px; }
    .fss-price { font-size: 16px; }
    .fss-title-text { font-size: 14px; }
    .fss-scroll-row { padding: 10px 10px; }
}
