﻿/* =============================================
   SITE.CSS - Main Stylesheet
   ============================================= */

/* Root Variables */
:root {
    --primary: #0d6efd;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* Base */
body {
    font-family: 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', -apple-system, sans-serif;
    color: #333;
    background-color: #f8f9fa;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}

/* Product Card */
.product-card {
    border-radius: var(--border-radius) !important;
    overflow: hidden;
    transition: all 0.2s ease;
}
.product-card .card-img-top {
    transition: transform 0.3s ease;
}
.product-card:hover .card-img-top {
    transform: scale(1.03);
}
.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Category Card */
.category-card {
    border-radius: var(--border-radius) !important;
    transition: all 0.2s ease;
}
/* S8 佈景：hover 底色吃店家主色（同樣有 color-mix fallback） */
.category-card:hover {
    background-color: #e8f0fe !important;
    background-color: color-mix(in srgb, var(--shop-primary, #0d6efd) 10%, #ffffff) !important;
}

/* Navbar
   ⚡ S32：導覽列改成深色（見 _Layout 的 .site-navbar 註解與下方 S32 區段），
   原本那條 1px 淺灰底線在深色上看不見、也跟佈景輸出的品牌色帶重疊，已移除。 */
.navbar-brand {
    font-size: 1.5rem !important;
}

/* Cart Badge */
#cartCount {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Forms */
/* S8 佈景：焦點框吃店家主色。
   ⚠ 兩行 box-shadow 是刻意的 fallback：舊瀏覽器不認得 color-mix() 會整行丟掉，
      留在前面那行 rgba 就會生效；認得的瀏覽器則用後面那行覆蓋。 */
.form-control:focus, .form-select:focus {
    border-color: var(--shop-primary, var(--primary));
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--shop-primary, #0d6efd) 22%, transparent);
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
}
/* ⚠⚠ S8 佈景：這一段以前是寫死的紫色漸層，導致「每一家店的主要按鈕長得一模一樣」。⚠⚠
   原因不是層疊順序（佈景 <style> 確實排在 site.css 之後），而是 CSS 是「逐屬性」比較的：
   ThemeService.BuildCss 對 .btn-primary 只設定了 --bs-btn-bg 這類自訂屬性，
   從來沒有再寫一次 background/background-image，所以這裡的 background 簡寫
   （它同時定案了 background-color 與 background-image）永遠是最終贏家。
   改成直接吃 --shop-primary / --shop-primary-dark 之後，漸層質感保留，但每家店各自不同。

   ⚠ var() 的第二個參數是後備值：後台 Areas/Admin 與 Areas/Platform 不載入 site.css，
     而前台以外若因故沒有輸出佈景變數，按鈕會退回原本的紫色，不會變成透明。 */
.btn-primary {
    background: linear-gradient(135deg, var(--shop-primary, #667eea), var(--shop-primary-dark, #764ba2));
    border: none;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: linear-gradient(135deg, var(--shop-primary-dark, #5a67d8), var(--shop-primary-dark, #6b3fa0));
    border: none;
}
/* 危險色吃佈景的輔助色 --shop-accent。
   ⚠ 佈景沒有「輔助色的深色版」這個欄位，所以 hover 用 filter 壓暗，
      不另外要求後端多存一個顏色。 */
.btn-danger {
    background: linear-gradient(135deg, #f12711, #f5af19);
    background: var(--shop-accent, #f12711);
    border: none;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background: linear-gradient(135deg, #d4200e, #e09a0f);
    background: var(--shop-accent, #d4200e);
    filter: brightness(0.9);
}

/* Hero Banner */
.hero-banner {
    overflow: hidden;
}

/* Card shadows
   ⚡ S32：.shadow-sm 改吃佈景變數 --shop-shadow（ThemeService.BuildCss 依店家的 CardShadow 設定輸出
   none／預設／strong）。以前這裡寫死 var(--shadow) 又帶 !important，結果是店家在後台把卡片陰影
   關掉或調強，前台所有 shadow-sm 的卡片完全沒反應。 */
.card {
    border-radius: var(--border-radius) !important;
}
.shadow-sm {
    box-shadow: var(--shop-shadow, var(--shadow)) !important;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Breadcrumb */
.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
}

/* Badge adjustments */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Order Status Colors */
.status-pending { color: #f59e0b; }
.status-paid { color: #3b82f6; }
.status-processing { color: #8b5cf6; }
.status-shipped { color: #6366f1; }
.status-completed { color: #10b981; }
.status-cancelled { color: #ef4444; }

/* Sticky header scroll */
.sticky-top {
    z-index: 1020;
}

/* Footer */
footer a:hover {
    color: white !important;
    text-decoration: underline !important;
}

/* Pagination */
.page-link {
    border-radius: 6px !important;
    margin: 0 2px;
}
.page-item.active .page-link {
    background: var(--primary);
}

/* Alert */
.alert {
    border-radius: 10px;
    border: none;
}
.alert-success { background-color: #d1fae5; color: #065f46; }
.alert-danger { background-color: #fee2e2; color: #7f1d1d; }

/* Checkout Steps */
.checkout-step {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}


/* ═══ ⚡ 第三批：商品頁縮圖列（Views/Product/Detail.cshtml 的 .product-thumbs） ═══
   圖一多手機上會擠成一團，改成單列橫向捲動；被選中的縮圖加佈景主色外框
   （一律走 CSS 變數，每家店配色不同，不能寫死品牌色）。 */
.product-thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
}

.product-thumbs .thumbnail-img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    flex: 0 0 auto;
    cursor: pointer;
    border: 2px solid #dee2e6;
}

.product-thumbs .thumbnail-img.thumb-selected {
    border-color: var(--shop-primary, #0d6efd);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--shop-primary, #0d6efd) 25%, transparent);
}


/* ═══ ⚡ 第五批：前台會員「我的回饋」頁（Views/Account/Rewards.cshtml） ═══
   餘額卡左側用佈景主色描邊（一律走 CSS 變數，每家店配色不同，不能寫死品牌色）。 */
.reward-balance-card {
    border-left: .25rem solid var(--shop-primary, #0d6efd);
}

.reward-balance-card .reward-balance-amount {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

/* 等級 badge 稍微放大一點，店家自訂底色由 inline style 帶入 */
.reward-tier-badge {
    font-size: .9rem;
}

/* 375px 手機：餘額數字縮小一階，避免兩張卡的數字撐爆卡片 */
@media (max-width: 575.98px) {
    .reward-balance-card .reward-balance-amount {
        font-size: 1.4rem;
    }
}


/* ═══ ⚡ S14：商品頁評價與問答（Views/Product/_ProductReviews.cshtml、_ProductQuestions.cshtml、
   Views/Review/*.cshtml） ═══
   星等一律用純文字 ★☆（不用圖示字型）；評價／問答內容是純文字，換行靠 white-space: pre-line
   （不是 Html.Raw——那是商品描述才有的待遇，理由見 Models/Domain/ProductReview.cs）。 */
.review-stars {
    color: #f5a623;
    letter-spacing: .05em;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1;
}

.review-stars .review-star-empty {
    color: #d0d4d9;
}

.review-stars-lg {
    font-size: 1.5rem;
}

.review-average-number {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1;
}

/* 1~5 星分佈長條圖：純 CSS，寬度由 inline style 帶百分比 */
.review-dist-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr 2.5rem;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
}

.review-dist-track {
    height: .5rem;
    background: #e9ecef;
    border-radius: .25rem;
    overflow: hidden;
}

.review-dist-fill {
    height: 100%;
    background: #f5a623;
    border-radius: .25rem;
}

/* 純文字內容：保留使用者輸入的換行，過長的英數字串強制折行，避免撐開版面 */
.review-plain-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    margin-bottom: 0;
}

.review-item + .review-item {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* 評價附圖縮圖：手機上單列橫向捲動，跟 .product-thumbs 同一套作法 */
.review-images {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
}

.review-images img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

/* 店家回覆／回答：左側用佈景主色描邊（走 CSS 變數，每家店配色不同，不能寫死品牌色） */
.review-reply {
    border-left: .25rem solid var(--shop-primary, #0d6efd);
    background: #f8f9fa;
    padding: .75rem 1rem;
    border-radius: 0 .375rem .375rem 0;
}

/* 寫評價表單的星等選擇器：radio 藏起來、label 顯示 ★，純 CSS 沒有 JS。
   ⚠ HTML 裡的順序要「5 到 1」倒著放，才能用 ~ 兄弟選擇器把「選中那顆之後（也就是視覺上左邊）」
     的星星一起點亮；再用 flex-direction: row-reverse 把視覺順序轉回 1 到 5。 */
.rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: .15rem;
}

.rating-input input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.rating-input label {
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    color: #d0d4d9;
}

.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #f5a623;
}

.rating-input input:focus-visible + label {
    outline: 2px solid var(--shop-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: .25rem;
}

/* ═══ ⚡ S29：前台部落格（Views/Blog/Index.cshtml、Detail.cshtml） ═══ */

/* 列表卡片：封面固定 16:9 裁切，沒封面的卡片高度由內文決定 */
.blog-card-cover {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f8f9fa;
}
.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.blog-card:hover .blog-card-cover img {
    transform: scale(1.03);
}
.blog-card-cover-sm {
    aspect-ratio: 4 / 3;
}
/* 標題用了 Bootstrap 的 stretched-link 讓整張卡片可點；
   卡片裡的分類標籤要能獨立點擊，得浮在 stretched-link 的覆蓋層之上 */
.blog-card .badge {
    position: relative;
    z-index: 2;
}
.blog-card-excerpt {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 分類選單目前項目：跟佈景主色一致（.active 由 Bootstrap 上色，這裡只調 badge） */
.blog-category-menu .list-group-item.active .badge {
    background: #fff;
}

/* 內頁：店家在後台用基本 HTML 寫的內容，這裡把常見元素的排版補齊。
   ⚠ 內容已在寫入時淨化，這裡只管樣式，不做任何過濾。 */
.blog-post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}
.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: .5rem;
}
.blog-post-content h2,
.blog-post-content h3 {
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: .75rem;
}
.blog-post-content p {
    margin-bottom: 1.1rem;
}
.blog-post-content blockquote {
    border-left: .25rem solid var(--shop-primary, #0d6efd);
    padding: .5rem 1rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0 .5rem .5rem 0;
}
.blog-post-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}
.blog-post-content th,
.blog-post-content td {
    border: 1px solid #dee2e6;
    padding: .5rem .75rem;
}
.blog-post-cover img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}


/* ═══════════════════════════════════════════════════════════════════
   ⚡ S32：前台視覺語言（往 Trustpilot 靠：大量留白、卡片化、強烈字級層次、
   乾淨白底＋深色導覽列、星等做成視覺焦點）
   ═══════════════════════════════════════════════════════════════════
   ⚠⚠⚠ 配色一律走佈景變數，不寫死任何品牌色。ThemeService.BuildCss 輸出的變數：
       --shop-primary / --shop-primary-dark / --shop-accent / --shop-body-bg / --shop-footer-bg /
       --shop-font / --shop-radius / --shop-shadow / --shop-container
     每家店各自設定；這一段只決定「用哪個變數放在哪裡」，顏色本身由店家的佈景決定。
   ⚠ var() 第二個參數是後備值：前台以外或佈景 CSS 沒輸出時仍有正常外觀。
   ⚠ 這裡只搬視覺語言，不搬 Trustpilot 的資訊架構——版面結構（搜尋、分類、商品格、規格選擇）一律不動。 */

:root {
    /* 星等色塊的顏色：預設等於店家主色（Trustpilot 的星星就是它的品牌色）。
       店家想用金黃色星星可以在「自訂 CSS」覆寫 --shop-rating。 */
    --shop-rating: var(--shop-primary, #0d6efd);
    /* 星等「空」色塊：淺灰，不隨佈景變（它的意思是「沒有」，不該帶品牌色）。 */
    --shop-rating-empty: #dcdce6;
    /* 卡片細邊框：純白底（例如「信賴綠」預設方案的 BodyBackground=#FFFFFF）配白卡片時，
       卡片邊界要靠這條線，不然整個版面會扁掉（IThemeService 對 BodyBackground 的註解講過這個坑）。 */
    --shop-card-border: rgba(0, 0, 0, .07);
}

/* ── 深色導覽列：底色走佈景「頁尾底色」（＝這家店的品牌深色），跟頁尾首尾呼應。
      ⚠ 一定要 !important：_Layout 保留了 Bootstrap 的 bg-dark 當後備，它本身帶 !important。 */
.site-navbar {
    background-color: var(--shop-footer-bg, #212529) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.site-navbar .navbar-brand {
    letter-spacing: .01em;
}
.site-navbar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, .85);
}
.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus {
    color: #fff;
}
/* 頁首 compact 選車器沒選車時是 btn-outline-secondary（灰字灰框），在深色底上幾乎看不見；
   同一個元件也用在商品頁淺色的提示條裡，所以只在導覽列裡改成淺色。 */
.site-navbar .vehicle-compact .btn-outline-secondary {
    color: rgba(255, 255, 255, .85);
    border-color: rgba(255, 255, 255, .35);
}
.site-navbar .vehicle-compact .btn-outline-secondary:hover,
.site-navbar .vehicle-compact .btn-outline-secondary:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .6);
}
/* 搜尋列：桌機佔 40%，摺疊成手機選單時滿版（以前 inline 寫死 40%，手機上只剩一小截）。 */
.site-search {
    width: 100%;
    margin-block: .5rem;
}
.site-search .form-control {
    border-color: transparent;
}
@media (min-width: 992px) {
    .site-search {
        width: 40%;
        margin-block: 0;
    }
}

/* ── 大量留白：主內容區上下拉開、區塊之間的距離加大。 */
.site-main {
    padding-block: .5rem 3rem;
}
@media (min-width: 992px) {
    .site-main {
        padding-block: 1rem 4rem;
    }
}
.site-footer {
    /* 頁尾跟主內容之間再多一點距離（原本 mt-5） */
    margin-top: 4rem !important;
}

/* ── 卡片化：白底、細邊框、佈景圓角與陰影一致。
      ⚠ .product-card 在 partial 裡帶了 border-0（!important），要覆蓋得用 !important，
        所以這裡只對 .product-card 動手，不改全站 .card。 */
.product-card {
    background-color: #fff;
    border: 1px solid var(--shop-card-border) !important;
    border-radius: var(--shop-radius, var(--border-radius)) !important;
}
.product-card .card-body {
    padding: 1rem 1.1rem 1.2rem;
}
.product-card .card-title {
    font-size: 1rem;
    line-height: 1.4;
}
/* 次要資訊（分類名、售出數）明顯小而淡 */
.product-card .card-body > small.text-muted,
.product-card .text-muted.small {
    font-size: .78rem;
    letter-spacing: .01em;
}
/* ── 商品頁字級層次：標題明顯大而粗、簡短說明明顯小而淡 */
.product-title {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
}
@media (min-width: 768px) {
    .product-title {
        font-size: 2.1rem;
    }
}
.product-short-desc {
    font-size: .95rem;
    line-height: 1.6;
    margin-top: .25rem;
}
/* 手機（~400px）：數量框與兩顆按鈕會折行，兩顆按鈕各自滿版 */
@media (max-width: 575.98px) {
    .product-buy-row .btn-lg {
        flex: 1 1 100%;
    }
}

/* ── 星等評分（Views/Shared/_RatingStars.cshtml）
      Trustpilot 做法：每顆星是一個「實心色塊」承載白色星星，不是一排細線條圖示。
      顏色走 --shop-rating（預設＝店家主色）；半顆星＝色塊左半實色、右半淡色。 */
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: inherit;
    line-height: 1;
    vertical-align: middle;
}
.rating-star-boxes {
    display: inline-flex;
    gap: 2px;
}
.rating-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    border-radius: 2px;
    color: #fff;
    background-color: var(--shop-rating-empty);
    font-size: 1em;
}
.rating-star .bi {
    font-size: .78em;
    line-height: 1;
}
.rating-star-full {
    background-color: var(--shop-rating);
}
/* 半顆：左半實色、右半淡色，白星壓在上面就能看出「4.5 不是 4 也不是 5」 */
.rating-star-half {
    background-image: linear-gradient(90deg, var(--shop-rating) 50%, var(--shop-rating-empty) 50%);
}
.rating-stars-value {
    font-weight: 700;
    color: #212529;
}
.rating-stars-count {
    color: #6c757d;
}
/* 商品卡片用：小一號，跟價格之間留一點距離 */
.rating-stars-sm {
    font-size: .95rem;
    margin-bottom: .45rem;
}
.rating-stars-sm .rating-stars-value,
.rating-stars-sm .rating-stars-count {
    font-size: .85rem;
}
/* 商品頁標題下方用：大一號，做成視覺焦點；可點（連到 #reviews） */
.rating-stars-lg {
    font-size: 1.5rem;
    margin: .35rem 0 .75rem;
}
.rating-stars-lg .rating-star-boxes {
    gap: 3px;
}
.rating-stars-lg .rating-star {
    border-radius: 3px;
}
.rating-stars-lg .rating-stars-value {
    font-size: 1.25rem;
}
.rating-stars-lg .rating-stars-count {
    font-size: .95rem;
}
a.rating-stars:hover .rating-stars-value,
a.rating-stars:focus .rating-stars-value {
    text-decoration: underline;
}

/* =============================================================================
   ⚡⚡⚡ S35 新區塊：滿版主橫幅（BlockFullBleedHero）／分類磚跑馬燈（BlockCategoryTileCarousel）／
   編輯精選卡片（BlockEditorialCards）。
   ⚠ 這三種區塊「本來就是 Nike 形狀」，classic 與 minimal 兩種版型都會用到（店家自己從首頁編輯加的），
     所以放在永遠會載入的 site.css，不放 storefront-minimal.css。沒有兩套外觀，只保證兩種版型都不爆版。
   ⚠ 這一段只有新的 .sf-fbh／.sf-tiles／.sf-editorial／.sf-pill 選擇器，不碰任何既有規則，
     既有 9 種區塊在 classic 底下的輸出逐字不變。
   ⚠ 顏色走佈景變數：pill 按鈕預設吃 --shop-primary（極簡黑方案就是 #111 ⇒ 全黑 pill）。
   ============================================================================= */

/* ── 共用：pill 按鈕 ─────────────────────────────────────────────────────── */
.sf-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .6rem 1.35rem;
    border: 1.5px solid var(--shop-primary, #111);
    border-radius: 999px;
    background: var(--shop-primary, #111);
    color: #fff;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}
.sf-pill:hover,
.sf-pill:focus-visible {
    color: #fff;
    opacity: .82;
    text-decoration: none;
}
.sf-pill:focus-visible {
    outline: 2px solid var(--shop-primary, #111);
    outline-offset: 3px;
}
.sf-pill-outline {
    background: transparent;
    color: var(--shop-primary, #111);
}
.sf-pill-outline:hover,
.sf-pill-outline:focus-visible {
    background: var(--shop-primary, #111);
    color: #fff;
    opacity: 1;
}

/* ── 滿版主橫幅 ──────────────────────────────────────────────────────────── */
.sf-fbh {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}
.sf-fbh-sm { min-height: 320px; }
.sf-fbh-md { min-height: 460px; }
.sf-fbh-lg { min-height: 600px; }
.sf-fbh-full { min-height: calc(100vh - 140px); }
/* 有圖時底部壓一層漸層，文字才讀得到（Nike 的主視覺文字也是壓在圖的下緣） */
.sf-fbh-has-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .45) 100%);
    pointer-events: none;
}
.sf-fbh-inner {
    position: relative;
    display: flex;
    padding-block: 3rem;
}
.sf-fbh-center .sf-fbh-inner { justify-content: center; text-align: center; }
.sf-fbh-left .sf-fbh-inner { justify-content: flex-start; text-align: left; }
.sf-fbh-right .sf-fbh-inner { justify-content: flex-end; text-align: right; }
.sf-fbh-content {
    max-width: 720px;
}
.sf-fbh-sub {
    margin: 0 0 .5rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: .02em;
    opacity: .9;
}
.sf-fbh-title {
    margin: 0 0 1.25rem;
    font-size: clamp(2.25rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.01em;
}
.sf-fbh-btn {
    border-color: transparent;
    font-size: 1.05rem;
    padding: .7rem 1.5rem;
}
.sf-fbh-btn:hover,
.sf-fbh-btn:focus-visible {
    opacity: .85;
}
@media (max-width: 575.98px) {
    .sf-fbh-sm { min-height: 260px; }
    .sf-fbh-md { min-height: 360px; }
    .sf-fbh-lg { min-height: 440px; }
    .sf-fbh-full { min-height: calc(100vh - 120px); }
    .sf-fbh-inner { padding-block: 2rem; }
}

/* ── 分類磚跑馬燈 ─────────────────────────────────────────────────────────── */
.sf-tiles {
    padding-block: 3rem;
}
.sf-tiles-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.sf-tiles-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 500;
}
.sf-tiles-nav {
    display: flex;
    gap: .5rem;
}
.sf-tiles-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #e5e5e5;
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color .15s ease, opacity .15s ease;
}
.sf-tiles-btn:hover { background: #cacacb; }
.sf-tiles-btn:disabled { opacity: .35; cursor: default; }
.sf-tiles-btn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
/* 軌道：自己的 overflow-x（刻意可橫向捲），不撐出頁面的水平捲軸；捲軸隱藏（Nike 也是） */
.sf-tiles-track {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: .25rem;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.sf-tiles-track::-webkit-scrollbar { display: none; }
.sf-tiles-track.sf-dragging { cursor: grabbing; scroll-snap-type: none; }
.sf-tiles-track:focus-visible { outline: 2px solid #111; outline-offset: 4px; }
.sf-tile {
    position: relative;
    flex: 0 0 auto;
    width: clamp(220px, 28vw, 340px);
    scroll-snap-align: start;
    text-decoration: none;
    color: #111;
}
.sf-tile-media {
    position: relative;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    overflow: hidden;
}
.sf-tile-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .35s ease;
    pointer-events: none;
}
@media (hover: hover) {
    .sf-tile:hover .sf-tile-media img { transform: scale(1.04); }
}
.sf-tile-noimg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #bdbdbd;
}
/* 名稱：疊在磚的左下角的白色 pill（Nike 的分類磚就是這個樣子） */
.sf-tile-name {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    padding: .45rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-weight: 500;
    font-size: .95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
    max-width: calc(100% - 2rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sf-tile:focus-visible { outline: none; }
.sf-tile:focus-visible .sf-tile-name { outline: 2px solid #111; outline-offset: 2px; }
@media (max-width: 575.98px) {
    .sf-tiles { padding-block: 2rem; }
    .sf-tile { width: 68vw; }
}

/* ── 編輯精選卡片 ─────────────────────────────────────────────────────────── */
.sf-editorial {
    padding-block: 3rem;
}
.sf-editorial-title {
    margin: 0 0 1.25rem;
    font-size: 1.5rem;
    font-weight: 500;
}
.sf-editorial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem .75rem;
}
@media (min-width: 768px) {
    .sf-editorial-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sf-editorial-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sf-editorial-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
    .sf-editorial-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sf-editorial-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.sf-editorial-media {
    display: block;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    overflow: hidden;
}
.sf-editorial-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
@media (hover: hover) {
    .sf-editorial-card:hover .sf-editorial-media img { transform: scale(1.03); }
}
.sf-editorial-body {
    padding: 1rem 0 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
}
.sf-editorial-sub {
    margin: 0;
    font-size: .9rem;
    color: #707072;
}
.sf-editorial-heading {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.3;
}
.sf-editorial-btn {
    margin-top: .5rem;
    padding: .5rem 1.15rem;
    font-size: .95rem;
}
@media (max-width: 575.98px) {
    .sf-editorial { padding-block: 2rem; }
    .sf-editorial-media { aspect-ratio: 4 / 3; }
}
.sf-editorial-noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdbdbd;
    font-size: 2.5rem;
}
