:root {
    --primary-color: #005bac; /* POC Medical 藍色 */
    --secondary-color: #f8f9fa;
    --text-color: #333333;
    --text-light: #6c757d;
    --font-main: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.7;
}

/* Navbar 調整 */
.navbar {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 0.8rem 0; /*稍微調整上下間距*/
    background: #fff;
}

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

/* Logo 專用設定 */
.logo-img {
    height: 55px; /* 電腦版高度，可依實際視覺調整 */
    width: auto;  /* 寬度自動，保持比例 */
    transition: all 0.3s ease;
}

/* 手機版調整 */
@media (max-width: 991.98px) {
    .logo-img {
        height: 45px; /* 手機版稍微縮小，避免撐破導覽列 */
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* 確保下拉選單在懸停時顯示 (Desktop only) - 選擇性功能 */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 600px; /* 固定高度 */
    overflow: hidden;
}

.hero-slide {
    height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* 遮罩讓文字更清楚 */
.hero-slide::before {
    content: '';
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 100%);
}

.hero-caption {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    padding-left: 20px;
}

.hero-caption h1 {
    font-weight: 700;
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Product Cards */
.product-card {
    border: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-img-wrap {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fcfcfc;
    padding: 20px;
}

.product-img-wrap img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.product-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 30px;
    border-radius: 50px;
    border: 2px solid var(--primary-color);
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* Navbar 調整 */
.navbar {
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 0.8rem 0; /*稍微調整上下間距*/
    background: #fff;
}

.navbar-brand {
    padding: 0;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

/* Logo 專用設定 */
.logo-img {
    height: 55px; /* 電腦版高度，可依實際視覺調整 */
    width: auto;  /* 寬度自動，保持比例 */
    transition: all 0.3s ease;
}

/* 手機版調整 */
@media (max-width: 991.98px) {
    .logo-img {
        height: 45px; /* 手機版稍微縮小，避免撐破導覽列 */
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: none;
    }
}

/* 確保下拉選單在懸停時顯示 (Desktop only) - 選擇性功能 */
@media (min-width: 992px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}


/* --- 修復手機版面問題 --- */

/* 1. 防止水平捲軸導致內容偏移 */
body, html {
    overflow-x: hidden;
    width: 100%;
}

/* 2. Banner 文字在手機版要縮小並置中 */
@media (max-width: 768px) {
    .hero-caption h1 {
        font-size: 2rem !important; /* 縮小標題字體 */
        line-height: 1.2;
    }
    
    .hero-caption .lead {
        font-size: 1rem !important;
        display: block !important; /* 確保副標題顯示，但字體變小 */
        margin-bottom: 1rem !important;
    }
    
    .hero-slide {
        height: 400px; /* 手機版 Banner 高度可以稍微改矮一點，以免佔據太多空間 */
    }
    
    /* 修正 Banner 文字靠左被切掉的問題 */
    .hero-caption {
        padding-left: 15px;  /* 增加左邊內距 */
        padding-right: 15px;
        text-align: center;  /* 手機版建議置中，視覺比較平衡 */
    }
    
    /* 修正按鈕在手機版可能被切掉 */
    .hero-caption .btn {
        width: auto;
        min-width: 120px;
    }
}

/* 3. 修正分類圖示 (豬/牛) 的間距，避免太寬被切掉 */
.product-shortcut-col {
    padding-left: 5px !important;
    padding-right: 5px !important;
}


/* 圓形 Icon 容器 */
.icon-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* 滑鼠移過去的效果 */
.d-flex:hover .icon-box {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Line 按鈕專用顏色 */
.btn-success {
    background-color: #00B900; /* Line 官方綠色 */
    border-color: #00B900;
}
.btn-success:hover {
    background-color: #009900;
    border-color: #009900;
}

/* Google Map 區塊 */
.map-section iframe {
    display: block; /* 消除 iframe 下方預設間距 */
    filter: grayscale(20%); /* 可選：讓地圖稍微灰階一點，更有質感 */
}

/* --- Inner Page Banner --- */
.page-header {
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 0;
}

/* 遮罩讓文字清楚 */
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); 
}

.page-header .container {
    position: relative;
    z-index: 2;
}

/* --- Bank Card Styles --- */
.bank-card {
    transition: transform 0.3s ease;
    border-left: 4px solid transparent !important;
}

.bank-card:hover {
    transform: translateY(-5px);
}

/* 第一張卡片 hover 變藍色 */
.col-md-6:nth-child(2) .bank-card:hover {
    border-left-color: var(--primary-color) !important;
}

/* 第二張卡片 hover 變綠色 (第一銀行的顏色) */
.col-md-6:nth-child(3) .bank-card:hover {
    border-left-color: #007f3e !important;
}

/* 字體優化 */
.font-monospace {
    letter-spacing: 1px;
}

/* 1. 頂部 Hero 區塊：增加高度與視差滾動感 */
.about-hero {
    height: 60vh; /* 佔據螢幕高度 60% */
    min-height: 400px;
    background-attachment: fixed; /* 視差滾動效果 */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.about-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(0,91,172,0.8), rgba(0,0,0,0.4)); /* 漸層遮罩 */
}
.about-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}
.about-hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 2. 關於內容區塊：雜誌風格錯位排版 */
.about-section {
    position: relative;
    overflow: hidden;
}
/* 裝飾性背景字 */
.bg-decor-text {
    position: absolute;
    top: -50px;
    left: -50px;
    font-size: 10rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    line-height: 1;
    z-index: 0;
    pointer-events: none;
}

.image-frame {
    position: relative;
    z-index: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.15); /* 深度陰影 */
}
.image-frame img {
    transition: transform 0.7s ease;
}
.image-frame:hover img {
    transform: scale(1.05);
}

/* 3. 聯絡資訊卡片：玻璃擬態 (Glassmorphism) */
.contact-glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,91,172,0.15);
    padding: 3rem;
    position: relative;
    overflow: hidden;
}
.contact-glass-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 5px; height: 100%;
    background: var(--primary-color);
}

/* 4. 銀行卡片：擬真信用卡質感 */
.bank-card-premium {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border-top: 1px solid #eee;
}
.bank-card-premium:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,91,172,0.1);
}
/* 金色裝飾線 */
.bank-card-premium::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 80px; height: 80px;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 193, 7, 0.1) 50%);
    border-radius: 0 0 15px 0;
}
.bank-account-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.4rem;
    color: var(--primary-color);
    background: rgba(0,91,172,0.05);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
}

/* --- 經銷品牌頁面專用樣式 --- */

/* 1. Hero 區塊 (共用於內頁) */
.about-hero {
    height: 50vh;
    min-height: 350px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* 視差滾動關鍵 */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.about-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,55,100,0.7));
}
.about-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}
.about-hero-title {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* 2. 品牌卡片 (Brand Card) */
.brand-card {
    background: #fff;
    border-radius: 15px;
    border: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03); /* 輕柔陰影 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 彈性動畫 */
    position: relative;
    overflow: hidden;
}

.brand-card:hover {
    transform: translateY(-10px); /* 上浮效果 */
    box-shadow: 0 20px 40px rgba(0,91,172,0.15); /* 加深陰影 */
}

/* 序號裝飾 */
.brand-index {
    position: absolute;
    top: -15px;
    left: -10px;
    font-size: 5rem;
    font-weight: 900;
    color: rgba(0,0,0,0.03);
    line-height: 1;
    pointer-events: none;
    font-family: 'Arial', sans-serif;
}

/* 國家標籤 */
.country-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    border: 1px solid #eee;
    z-index: 2;
}

/* Logo 容器 */
.brand-logo-wrapper {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #fff, #fcfcfc);
    border-bottom: 1px solid #f0f0f0;
    padding: 20px;
}

.brand-logo-img {
    max-width: 70%;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(100%); /* 預設灰階 */
    opacity: 0.6;
    transition: all 0.4s ease;
}

.brand-card:hover .brand-logo-img {
    filter: grayscale(0%); /* 懸停變彩色 */
    opacity: 1;
    transform: scale(1.1);
}

/* 產品標籤 (Tag Pill) */
.product-tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f1f5f9;
    color: #495057;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.product-tag:hover {
    background-color: var(--primary-color); /* 假設您有定義這個變數 */
    color: #fff;
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0,91,172,0.2);
}

/* 底部裝飾條 */
.brand-card-bar {
    height: 4px;
    width: 0%;
    background: var(--primary-color);
    transition: width 0.4s ease;
}
.brand-card:hover .brand-card-bar {
    width: 100%;
}

/* 背景大字裝飾 */
.bg-decor-text {
    position: absolute;
    font-size: 10vw;
    font-weight: 900;
    color: rgba(0,0,0,0.02);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

/* --- 保固查詢頁面專屬樣式 --- */

/* 查詢工具容器：模擬應用程式介面 */
.warranty-console {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 91, 172, 0.1);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
}

/* 頂部裝飾條 (模擬視窗標題列) */
.warranty-console-header {
    background: #f8f9fa;
    padding: 15px 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}
.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
}
.window-dot.red { background-color: #ff5f56; }
.window-dot.yellow { background-color: #ffbd2e; }
.window-dot.green { background-color: #27c93f; }

/* iframe 區域 */
.warranty-frame-wrapper {
    position: relative;
    width: 100%;
    /* 設定最小高度，確保內容不被截斷 */
    min-height: 500px; 
    background: #fff;
}

.warranty-frame-wrapper iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

/* 步驟指引卡片 */
.step-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    height: 100%;
    transition: transform 0.3s ease;
}
.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}
.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* --- 首頁專屬樣式 (Home Page) --- */

/* 1. 全螢幕 Hero Banner */
.home-hero-section {
    position: relative;
    height: 85vh; /* 佔據螢幕 85% 高度，更有氣勢 */
    min-height: 600px;
    background-color: #000;
}
.home-hero-slide {
    height: 85vh;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
}
/* 漸層遮罩：讓文字更清楚，且增加氛圍 */
.home-hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
}
.home-hero-caption {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

/* 2. 懸浮分類卡片 (Overlap Cards) */
.category-overlap-section {
    position: relative;
    margin-top: -100px; /* 關鍵：往上負邊距，蓋住 Banner */
    z-index: 10;
    padding-bottom: 4rem;
}
.cat-card-modern {
    background: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); /* 深度陰影 */
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    border-bottom: 4px solid transparent;
}
.cat-card-modern:hover {
    transform: translateY(-15px);
    border-bottom-color: var(--primary-color);
}
.cat-icon-box {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}
.cat-card-modern:hover .cat-icon-box {
    background: var(--primary-color);
    color: #fff;
}

/* 3. 產品卡片微調 */
.product-card-premium {
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}
.product-card-premium:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.08) !important;
    border-color: transparent;
}

/* 4. 視差數據條 (Parallax Stripe) */
.parallax-stripe {
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 6rem 0;
    color: #fff;
}
.parallax-stripe::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 55, 100, 0.85); /* 深藍色遮罩 */
}
/* --- 5. 關於我們圖片堆疊 (高質感層次版) --- */

.about-img-stack {
    position: relative;
    /* 為了讓絕對定位的小圖不被切掉，這裡預留一些空間 */
    padding-bottom: 50px; 
    padding-left: 20px; 
    margin-right: 20px; /* 右邊留點白 */
}

/* 主要大圖 */
.about-img-main {
    width: 85%; /* 不佔滿，留空間給小圖 */
    margin-left: auto; /* 靠右對齊 */
    display: block;
    border-radius: 20px;
    /* 輕微的陰影 */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1; /* 在下層 */
    object-fit: cover;
    aspect-ratio: 4/3; /* 強制比例，避免圖片太長或太短 */
}

/* 裝飾小圖 */
.about-img-decor {
    position: absolute;
    bottom: 0;      /* 定位在底部 */
    left: 0;        /* 定位在左側 */
    width: 50%;     /* 寬度佔容器的一半 */
    border-radius: 15px;
    z-index: 2;     /* 在上層 */
    
    /* [關鍵] 粗白色邊框，製造切割感 */
    border: 10px solid #fff; 
    
    /* [關鍵] 深度陰影，製造懸浮感 */
    box-shadow: 20px 20px 40px rgba(0,0,0,0.2); 
    
    object-fit: cover;
    aspect-ratio: 1/1; /* 正方形或 4:3 皆可 */
}

/* 背景點點裝飾 (增加氛圍) */
.about-bg-shape {
    position: absolute;
    top: -30px;
    right: -30px; /* 在大圖的右上角 */
    width: 200px;
    height: 200px;
    /* 點點圖案 */
    background-image: radial-gradient(#005bac 2px, transparent 2px);
    background-size: 20px 20px;
    opacity: 0.2;
    z-index: 0; /* 最底層 */
}

/* RWD 手機版調整 */
@media (max-width: 768px) {
    .about-img-stack {
        padding: 0;
        margin: 0;
        margin-bottom: 30px;
    }
    .about-img-main {
        width: 100%; /* 手機版大圖佔滿 */
        margin-left: 0;
    }
    .about-img-decor {
        width: 45%;
        bottom: -20px; /* 手機版稍微往下突出一點 */
        left: -10px;
        border-width: 5px; /* 手機版邊框細一點 */
    }
}

/* --- 產品與購物頁面樣式 --- */

/* 1. 側邊欄分類 (Sidebar Category) */
.shop-sidebar .card {
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 12px;
}
.shop-sidebar .list-group-item {
    border: none;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: #555;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.shop-sidebar .list-group-item:hover,
.shop-sidebar .list-group-item.active {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}
.shop-sidebar .badge {
    background-color: #eee;
    color: #777;
}

/* 2. 產品卡片 (Product Card) */
.product-grid-card {
    border: 1px solid #eee;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-grid-card:hover {
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transform: translateY(-5px);
    border-color: transparent;
}

.product-image-container {
    position: relative;
    height: 220px;
    background: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f8f9fa;
}
.product-image-container img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}
.product-grid-card:hover .product-image-container img {
    transform: scale(1.08);
}

/* 懸浮按鈕群 (Quick Actions) */
.product-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}
.product-grid-card:hover .product-actions {
    opacity: 1;
    transform: translateX(0);
}
.btn-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    border: 1px solid #eee;
    transition: all 0.2s;
}
.btn-action:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 購物車 Offcanvas */
.offcanvas-cart {
    width: 400px;
}
.cart-item-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* --- 產品詳情頁面專屬樣式 (Product Detail) --- */

/* 1. 產品畫廊 (Gallery) */
.product-gallery-sticky {
    position: sticky;
    top: 100px; /* 滾動時固定在左側 */
}
.main-image-frame {
    border: 1px solid #f0f0f0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1/1; /* 正方形比例 */
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
}
.main-image-frame img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.main-image-frame:hover img {
    transform: scale(1.05);
}

/* 縮圖列表 */
.thumb-list {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}
.thumb-item {
    width: 70px;
    height: 70px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    flex-shrink: 0;
}
.thumb-item.active, .thumb-item:hover {
    border-color: var(--primary-color);
    opacity: 1;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* 2. 產品資訊區 (Info) */
.product-info-wrap h1 {
    font-weight: 800;
    color: #222;
    line-height: 1.3;
}
.product-model-badge {
    background: #f8f9fa;
    color: #666;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}
.price-area {
    margin: 20px 0;
    padding: 20px;
    background: #f8faff;
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}
.action-buttons .btn {
    padding: 12px 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 3. 產品規格 Tabs (Modern Tabs) */
.nav-pills-custom .nav-link {
    color: #666;
    background: #fff;
    border: 1px solid #eee;
    margin-right: 10px;
    border-radius: 50px;
    padding: 10px 25px;
    transition: all 0.3s;
}
.nav-pills-custom .nav-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0, 91, 172, 0.3);
}
.tab-content-box {
    background: #fff;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    line-height: 1.8;
}
/* 修正後台編輯器內容樣式 */
.tab-content-box img {
    max-width: 100%;
    height: auto !important;
    border-radius: 8px;
    margin: 10px 0;
}

/* 4. 相關產品 (Related) */
.related-card {
    border: none;
    transition: transform 0.3s;
}
.related-card:hover {
    transform: translateY(-5px);
}
.related-img-wrap {
    height: 180px;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

/* --- 強制修正後台編輯器內容樣式 --- */

.editor-content {
    overflow-x: hidden; /* 防止內容撐開導致橫向卷軸 */
    color: #333;
    line-height: 1.8;
}

/* 讓圖片自適應 */
.editor-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 10px 0;
}

/* 強制讓編輯器的 Grid 在手機上變成 100% 寬 */
.editor-content .content, 
.editor-content .item-inner {
    width: 100% !important;
    min-width: 100% !important;
    padding: 0 !important;
    display: block !important;
}

/* 修正字體大小，避免手機版字太大 */
.editor-content h4, 
.editor-content h5 {
    font-family: inherit !important;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .editor-content * {
        font-size: 16px !important; /* 手機版強制統一字級，避免過大 */
    }
    
    /* 修正 row 的邊距 */
    .editor-content .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* --- Premium Footer Styles --- */
.footer-premium {
    background-color: #111; /* 比 bg-dark 更深，更有質感 */
    color: #aaa;
    font-size: 0.9rem;
    position: relative;
}

.footer-premium h5 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    font-size: 1.1rem;
}

/* 連結樣式優化 */
.footer-link {
    display: block;
    color: #999;
    text-decoration: none;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.footer-link:hover {
    color: var(--primary-color); /* 懸停變品牌色 */
    transform: translateX(5px); /* 輕微右移效果 */
}

.footer-link i {
    font-size: 0.8rem;
    margin-right: 8px;
    opacity: 0.5;
    transition: opacity 0.3s;
}
.footer-link:hover i {
    opacity: 1;
}

/* 社交圖示按鈕 */
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    margin-right: 10px;
    transition: all 0.3s;
    text-decoration: none;
}
.social-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

/* 訂閱輸入框 */
.footer-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 50px;
    padding: 10px 20px;
}
.footer-input:focus {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
    box-shadow: none;
    color: #fff;
}

/* 回到頂部按鈕 */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none; /* 預設隱藏 */
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
    transition: all 0.3s;
}
#backToTop:hover {
    background: #004485; /* 深一點的品牌色 */
    transform: translateY(-5px);
}

/* --- 會員中心專屬樣式 (Member Center) --- */

/* 1. 外框卡片 */
.member-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    overflow: hidden;
    height: 100%;
}

/* 2. 標題區域 */
.member-header {
    background: #fff;
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}
.member-header h5 {
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* 3. 左側導覽列 */
.member-sidebar-profile {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(to bottom, #fff, #fcfcfc);
    border-bottom: 1px solid #f0f0f0;
}
.avatar-circle {
    width: 90px;
    height: 90px;
    background: #f0f2f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: #adb5bd;
}

/* 選單項目 */
.member-menu .list-group-item {
    border: none;
    padding: 15px 25px;
    color: #666;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}
.member-menu .list-group-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}
.member-menu .list-group-item.active {
    background-color: #eef5ff; /* 淺藍色背景 */
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 700;
}
.member-menu .list-group-item i {
    width: 25px; /* 固定寬度讓文字對齊 */
}

/* 4. 表單與唯讀欄位優化 */
.form-control-readonly {
    background-color: #f8f9fa;
    border-color: #eee;
    color: #6c757d;
    cursor: not-allowed;
}

/* --- 最新消息列表 (News List) --- */
.news-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 91, 172, 0.1);
}

.news-img-wrap {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img-wrap img {
    transform: scale(1.1);
}

/* 日期標籤 */
.news-date-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    line-height: 1.2;
    color: #333;
}
.news-date-day { font-size: 1.2rem; font-weight: 800; display: block; color: var(--primary-color); }
.news-date-month { font-size: 0.75rem; text-transform: uppercase; font-weight: 600; }

.news-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制兩行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-summary {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1; /* 讓按鈕置底 */
}

/* --- 文章內頁 (Article Detail - CKEditor Fixes) --- */
.article-container {
    max-width: 900px; /* 最佳閱讀寬度 */
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

/* CKEditor 內容重置樣式 */
.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #333;
    overflow-wrap: break-word;
}

/* 強制修正圖片 RWD */
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 20px 0;
    display: block;
}

/* 修正影片 */
.article-content iframe, 
.article-content video {
    max-width: 100%;
    margin: 20px 0;
}

/* 修正表格 RWD */
.article-content table {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}
/* 若表格太寬，加上卷軸 */
.table-responsive-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* 引用區塊 */
.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin: 20px 0;
    color: #555;
    font-style: italic;
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
}

/* 手機版適配 */
@media (max-width: 768px) {
    .article-container {
        padding: 25px 20px;
        border-radius: 0;
        box-shadow: none;
    }
    .article-content {
        font-size: 1rem;
    }
}

/* --- 新聞內頁專屬樣式 (News Detail) --- */

/* 1. 閱讀容器：限制寬度以提升閱讀舒適度 */
.article-container {
    max-width: 900px; /* 最佳閱讀寬度，避免單行字太長 */
    margin: 0 auto;
    background: #fff;
    padding: 60px; /* 寬鬆的內距 */
    border-radius: 20px;
    box-shadow: 0 10px 60px rgba(0,0,0,0.03); /* 極淡的深層陰影 */
}

/* 2. 文章標頭 */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}
.article-title {
    font-size: 2rem;
    font-weight: 800;
    color: #222;
    line-height: 1.4;
    margin-bottom: 1rem;
}
.article-meta {
    color: #888;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

/* 3. CKEditor 內容強制響應式 (核心關鍵) */
.article-body {
    font-size: 1.1rem;
    line-height: 1.9; /* 較高的行高，閱讀不費力 */
    color: #444;
    overflow-wrap: break-word; /* 防止長網址撐破版面 */
}

/* 強制圖片 RWD */
.article-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    margin: 20px auto;
    display: block;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* 強制影片 RWD */
.article-body iframe, 
.article-body video, 
.article-body embed {
    max-width: 100%;
    margin: 20px auto;
    display: block;
}

/* 強制表格 RWD (加上捲軸) */
.article-body table {
    width: 100% !important;
    max-width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    display: block; /* 讓表格可捲動 */
    overflow-x: auto;
}

/* 清除編輯器產生的 inline-style 干擾 */
.article-body p {
    margin-bottom: 1.5rem;
}
.article-body h2, .article-body h3, .article-body h4 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #000;
}

/* 引用區塊樣式優化 */
.article-body blockquote {
    border-left: 5px solid var(--primary-color);
    background: #f9f9f9;
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    color: #555;
    border-radius: 0 10px 10px 0;
}

/* 4. 底部導航卡片 */
.nav-article-card {
    display: block;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: all 0.3s ease;
    height: 100%;
    text-decoration: none;
}
.nav-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}
.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #aaa;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}
.nav-title {
    font-weight: 700;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 手機版微調 */
@media (max-width: 768px) {
    .article-container {
        padding: 30px 20px;
        border-radius: 0;
        box-shadow: none;
    }
    .article-title {
        font-size: 1.6rem;
    }
    .article-body {
        font-size: 1rem;
    }
}

/* --- 修正編輯器內容排版 (強制美化) --- */

.editor-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #555;
    text-align: justify; /* 左右對齊，增加專業感 */
}

/* 1. 隱藏所有多餘的換行標籤 */
.editor-content br {
    display: none;
}

/* 2. 隱藏空的段落 */
.editor-content p:empty {
    display: none;
}

/* 3. 設定標題樣式 (專業感) */
.editor-content h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #222;
    margin-top: 25px;
    margin-bottom: 15px;
    padding-left: 12px;
    border-left: 4px solid var(--primary-color); /* 左側藍色線條 */
    line-height: 1.4;
    display: block; /* 確保標題獨佔一行 */
}
/* 第一個標題不要上方間距 */
.editor-content h4:first-child {
    margin-top: 0;
}

/* 4. 設定內文段落間距 */
.editor-content p {
    margin-bottom: 15px;
    display: block;
}

/* 5. 設定列表樣式 */
.editor-content ul, .editor-content ol {
    margin-bottom: 20px;
    padding-left: 25px; /* 確保項目符號不會跑出去 */
}
.editor-content li {
    margin-bottom: 8px;
}

/* --- 404 錯誤頁面專屬樣式 --- */
.error-page-section {
    min-height: 70vh; /* 確保在短螢幕上也有足夠高度 */
    display: flex;
    align-items: center;
    background: radial-gradient(circle at center, #fff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

/* 背景裝飾圖案 (讓畫面不單調) */
.error-bg-decor {
    position: absolute;
    font-size: 20rem;
    font-weight: 900;
    color: rgba(0, 91, 172, 0.03); /* 極淡的品牌色 */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.error-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), #2a5298);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 1rem;
    text-shadow: 0 10px 30px rgba(0, 91, 172, 0.15);
}

.error-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
}

.error-desc {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 按鈕群組 */
.error-actions .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}
.error-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 手機版微調 */
@media (max-width: 768px) {
    .error-code { font-size: 5rem; }
    .error-title { font-size: 1.5rem; }
}


/* --- Footer 內的編輯器內容修正 --- */
.footer-premium .editor-content {
    color: #aaa; /* 淺灰色，適合深底 */
    font-size: 0.95rem;
}

.footer-premium .editor-content h1,
.footer-premium .editor-content h2,
.footer-premium .editor-content h3,
.footer-premium .editor-content h4,
.footer-premium .editor-content h5,
.footer-premium .editor-content h6 {
    color: #fff; /* 標題改為白色 */
    border-left-color: var(--primary-color); /* 維持左側藍線 */
}

.footer-premium .editor-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-premium .editor-content a:hover {
    color: #fff;
    text-decoration: underline;
}

/* --- 首頁輪播牆優化 (支援影片) --- */

/* 影片容器：確保高度與圖片模式一致 */
.hero-video-container {
    height: 85vh;
    min-height: 600px;
    width: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* 強制 iframe 滿版填滿 */
.hero-video-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: auto; /* 允許使用者點擊播放/暫停 */
}

/* 影片模式下的文字層 (可選：若要在影片上疊字) */
.hero-video-caption {
    position: absolute;
    bottom: 10%;
    left: 5%;
    z-index: 10;
    pointer-events: none; /* 讓點擊穿透文字，才按得到影片 */
}

/* --- 強制修正編輯器內的影片 RWD --- */
.editor-content iframe, 
.editor-content video, 
.editor-content embed {
    max-width: 100%;       /* 寬度不超過螢幕 */
    height: auto;          /* 高度自動 */
    aspect-ratio: 16/9;    /* 強制保持 16:9 比例 */
    display: block;
    margin: 20px auto;     /* 置中 */
    border-radius: 8px;    /* 圓角 */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}   

/* --- 高級產品標籤樣式 (Premium Badges) --- */

.pro-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 50px; /* 膠囊狀 */
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: none;
    z-index: 2;
}

/* 滑鼠移過時稍微放大 */
.product-grid-card:hover .pro-badge {
    transform: scale(1.05);
}

/* 流光動畫效果 */
.pro-badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg);
    animation: shine 3s infinite; /* 3秒掃過一次 */
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; } /* 快速掃過 */
    100% { left: 200%; } /* 停留一段時間 */
}

/* 1. HOT 熱銷 (紅橙漸層 + 發光) */
.badge-hot-premium {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.4); /* 紅色光暈 */
}

/* 2. NEW 新品 (青綠漸層 + 清新感) */
.badge-new-premium {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.4); /* 綠色光暈 */
}

/* 3. SALE 特價 (黑金漸層 + 尊爵感) */
.badge-sale-premium {
    background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
    color: #000 !important; /* 金色背景配黑字比較清楚 */
    box-shadow: 0 4px 15px rgba(255, 210, 0, 0.5); /* 金色光暈 */
}

/* 圖片載入動畫 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

/* 當圖片載入完成後，JS 會加上 loaded 類別 (需配合下方 JS) */
img.loaded {
    opacity: 1;
}

/* --- 全螢幕搜尋 (Full Screen Search) --- */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 30, 60, 0.95); /* 深藍色半透明背景 */
    backdrop-filter: blur(5px); /* 毛玻璃效果 */
    z-index: 9999; /* 確保在最上層 */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

/* 顯示狀態 */
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 內容容器動畫 */
.search-overlay .search-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}
.search-overlay.active .search-container {
    transform: scale(1);
}

/* 巨大輸入框 */
.search-input {
    background: transparent;
    border: none;
    border-bottom: 3px solid rgba(255,255,255,0.5);
    border-radius: 0;
    color: #fff;
    font-size: 2.5rem; /* 超大字體 */
    font-weight: 700;
    padding: 15px 60px 15px 0; /* 右邊留位給按鈕 */
    box-shadow: none !important;
    transition: border-color 0.3s;
}

.search-input:focus {
    background: transparent;
    color: #fff;
    border-bottom-color: #fff;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.3);
    font-weight: 300;
}

/* 送出箭頭按鈕 */
.btn-submit-search {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    opacity: 0.5;
    transition: all 0.3s;
}
.btn-submit-search:hover {
    opacity: 1;
    transform: translateY(-50%) translateX(5px); /* 懸停右移 */
}

/* 關閉按鈕 (右上角) */
.btn-close-search {
    position: absolute;
    top: 40px;
    right: 40px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: transform 0.3s;
}
.btn-close-search:hover {
    opacity: 1;
    transform: rotate(90deg); /* 旋轉效果 */
}

/* --- 產品列表平滑換頁特效 --- */

/* 1. 淡入動畫 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* 2. Loading 遮罩 (讀取中顯示) */
#product-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#product-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Header Dropdown 動畫優化 (Desktop Only) --- */

@media (min-width: 992px) {
    
    /* 1. 定義動畫關鍵影格 */
    @keyframes dropdownFadeInUp {
        from {
            opacity: 0;
            transform: translate3d(0, 15px, 0); /* 從下方 15px 處開始 */
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0); /* 回到原位 */
        }
    }

    /* 2. 滑鼠移入 (Hover) 時觸發顯示 */
    .navbar .nav-item.dropdown:hover .dropdown-menu {
        display: block; /* 讓它顯示 */
        animation: dropdownFadeInUp 0.3s ease forwards; /* 執行 0.3秒 動畫 */
    }

    /* 3. 下拉選單本體美化 */
    .navbar .dropdown-menu {
        display: none; /* 預設隱藏 */
        margin-top: 10px; /* 與導覽列保持一點距離 */
        border: none; /* 移除預設邊框 */
        border-radius: 12px; /* 圓角 */
        box-shadow: 0 10px 40px rgba(0,0,0,0.1); /* 高質感擴散陰影 */
        padding: 10px 0; /* 內距 */
    }

    /* 4. 選單項目 Hover 效果 */
    .navbar .dropdown-item {
        padding: 10px 20px;
        transition: all 0.2s;
        position: relative;
    }
    
    .navbar .dropdown-item:hover {
        background-color: #f8f9fa; /* 淺灰背景 */
        color: var(--primary-color); /* 文字變品牌色 */
        padding-left: 25px; /* 輕微右移效果 */
    }
    
    /* 5. [關鍵技巧] 透明橋接層 (Invisible Bridge) */
    /* 這能防止滑鼠移開文字、還沒碰到選單時，選單就消失了 */
    .navbar .nav-item.dropdown::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 20px; /* 向下延伸 20px 的感應區 */
        transform: translateY(100%);
        z-index: 100;
    }
}