/* static/css/style.css */

/* 使用 Google Fonts */
body {
    font-family: 'Noto Sans TC', sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#products-page {
    flex: 1;
}

/* 為了讓 fixed-top navbar 不會遮擋內容 */
section, header {
    padding-top: 100px; /* 根據你的 navbar 高度調整 */
    padding-bottom: 80px;
}

/* 主視覺區塊樣式 */
/* 縮小主視覺區塊的高度 */
.hero-section {
    position: relative;
    height: 60vh; /* 調整為視窗高度的 60%，或任何您覺得合適的數值 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('/static/images/back.jpg') no-repeat center center/cover;
    box-shadow: inset 0 0 0 2000px rgba(0, 0, 0, 0.5); 
}

#back-to-top-btn.at-bottom {
    position: absolute;
    bottom: auto; /* 重設 fixed 的底部定位 */
    top: -80px; /* 將按鈕放在頁尾上方，這個值需要根據您的頁尾高度調整 */
  }

/* 調整導覽列連結的 active 狀態顏色 */
.navbar-dark .navbar-nav .nav-link.active {
    color: #ffffff; /* Active 狀態的文字顏色 */
    font-weight: bold;
}

.navbar-dark .navbar-nav .nav-link {
    transition: color 0.3s ease-in-out;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: #f8f9fa;
}

/* 調整按鈕顏色 (可選) */
.btn-primary {
    background-color: #0d6efd; /* Bootstrap 預設藍色 */
    border-color: #0d6efd;
    transition: background-color 0.3s, border-color 0.3s;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* --- 優化「關於我們」區塊的文字排版 --- */

/* --- 風格一：現代專業感 About 區塊樣式 --- */
#about .about-content {
    padding-right: 1rem; /* 讓文字和圖片間有點空隙 */
}

#about .about-content .text-primary {
    color: #0d6efd !important; /* Bootstrap 預設藍色，可換成您的品牌色 */
    font-weight: 700;
    letter-spacing: 1px;
}

#about .about-content .short-hr {
    width: 80px;
    height: 3px;
    background-color: #0d6efd; /* 同上，可換成您的品牌色 */
    border: 0;
    opacity: 1;
    margin-bottom: 2rem;
}

#about .about-content p {
    font-size: 1.05rem;
    line-height: 1.8;
}

#about .about-content .custom-blockquote {
    border-left: 4px solid #0d6efd; /* 引用區塊的左側線條 */
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: #f8f9fa; /* 淡淡的背景色 */
    font-style: italic;
    font-size: 1.1rem;
    font-weight: 500;
}

#about .shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

/* --- 服務項目 Section (新版網格樣式) --- */
.service-item {
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease-in-out;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.service-icon {
    font-size: 2.8rem; /* 圖示大小 */
    color: #0d6efd;   /* 圖示顏色，可換成您的品牌色 */
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #343a40;
}
/* --- 產品總覽 Section (主頁灰色按鈕樣式) --- */
.product-overview-item {
    display: block;
    padding: 1rem;
    text-align: center;
    background-color: #e9ecef;
    color: #495057;
    font-weight: 700;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-overview-item:hover {
    background-color: #0d6efd;
    color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* --- 產品介紹系統頁面 (products.html) 樣式 --- */
.product-nav-pills .category-header {
    color: #212529;
    font-weight: 700;
    text-align: left;
    background-color: transparent;
    border-radius: 0;
    opacity: 1;
    cursor: default;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.product-nav-pills .nav-link {
    text-align: left;
    color: #495057;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
}

.product-nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: #ffffff;
}

.product-nav-pills .nav-link:not(.category-header):not(.active):hover {
    background-color: #f8f9fa;
}

.product-detail-content {
    padding-left: 1.5rem;
}

.product-detail-content h3 {
    font-weight: 700;
    color: #343a40;
}
.product-detail-content h4 {
    font-weight: 700;
    color: #495057;
    margin-top: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.product-detail-content .spec-list {
    padding-left: 1.5rem;
    list-style-position: inside;
}

.product-detail-content .spec-list li {
    margin-bottom: 0.5rem;
}

.product-menu .list-group-item.parent {
    font-weight: bold;
    color: #333;
    background-color: #f8f9fa; /* 父層選項加個底色 */
    border-bottom: 1px solid #ddd;
}

.product-menu .list-group-item.parent.active {
    background-color: #0d6efd; /* 點選父層時的顏色 */
    color: white;
    border-color: #0d6efd;
}

/* 子選項樣式 */
.product-menu .sub-item {
    padding-left: 2.5rem; /* 子選項內縮 */
    font-size: 0.95em;
    border: none;
    border-bottom: 1px solid #eee;
}

.product-menu .list-group-item-action {
    border-radius: 0;
}

/* 當子選項被選中(active)時的樣式 */
.product-menu .sub-item.active {
    background-color: #e9ecef;
    color: #0d6efd;
    font-weight: bold;
}

/* 移除 Bootstrap Collapse 的預設邊框 */
.product-menu .collapse, .product-menu .collapsing {
    border: none;
}

/* 右側產品內容區 */
#product-content .tab-pane {
    padding: 1rem;
}

#product-content h3 {
    color: #0d6efd;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#product-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #343a40;
}

.card-hover {
    transition: transform .2s, box-shadow .2s;
}
.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-menu .list-group-item.parent {
    font-weight: bold;
    color: #333;
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.product-menu .list-group-item.parent.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* 左側選單：子選項 */
.product-menu .sub-item {
    padding-left: 2.5rem; /* 子選項內縮 */
    font-size: 0.95em;
    border: none;
    border-bottom: 1px solid #eee;
}

.product-menu .list-group-item-action {
    border-radius: 0;
}

.product-menu .sub-item.active {
    background-color: #e9ecef;
    color: #0d6efd;
    font-weight: bold;
}

/* 移除 Bootstrap Collapse 的預設邊框 */
.product-menu .collapse, .product-menu .collapsing {
    border: none;
}

/* 右側產品內容區通用樣式 */
#product-content .tab-pane {
    padding: 1rem;
}

#product-content h3 {
    color: #0d6efd;
    font-weight: bold;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem; /* 增加下方間距 */
}

#product-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #343a40;
    font-weight: bold;
}

#product-content h5 {
    font-weight: bold;
    color: #495057;
}
.brands-grid {
    display: grid;
    /* 建立三欄，每欄寬度相等 */
    grid-template-columns: repeat(3, 1fr); 
    /* 設定欄與欄之間的間距 */
    gap: 20px; 
    /* 讓圖片在小螢幕上可以自動換行 */
    flex-wrap: wrap; 
    justify-content: center;
    align-items: center;
}

/* 平板尺寸 (寬度大於 768px)，一行 3 個 */
@media (min-width: 768px) {
    .brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 電腦螢幕 (寬度大於 992px)，一行 4 個 */
@media (min-width: 992px) {
    .brands-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 576px) {
    .brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.brand-item {
    background-color: #ffffff;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* 確保連結本身沒有底線 */
}

.brand-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.brand-item img {
    max-width: 80%; /* 讓圖片最大寬度為外層容器的 80%，可以自行調整百分比 */
    height: auto;   /* 高度設為 auto，讓圖片能等比例縮放 */
    filter: grayscale(100%); 
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.brand-item:hover img {
    filter: grayscale(0%); /* 滑鼠移上去時變回彩色 */
    opacity: 1;
}

/* --- 回到頂端按鈕 (修正置中問題) --- */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1030;
    
    /* 外觀設定 */
    width: 50px;
    height: 50px;
    font-size: 1.8rem;

    /* --- ↓↓↓ 關鍵修改：使用 Flexbox 來達成完美置中 ↓↓↓ --- */
    display: flex;
    align-items: center;     /* 垂直置中 */
    justify-content: center; /* 水平置中 */
    padding: 0;              /* 移除 Bootstrap 按鈕預設的內距，避免干擾 */
    /* --- ↑↑↑ 修改到此為止 ↑↑↑ --- */

    /* 預設隱藏 (淡入淡出效果) */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

#main-nav .navbar-brand {
    padding-top: 0.2rem;    /* 稍微減少 Logo 連結的頂部內距 */
    padding-bottom: 0.2rem; /* 稍微減少 Logo 連結的底部內距 */
}
#main-nav {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
  
  /* 調整 Logo 圖片大小 */
.navbar-logo-img {
    height: 60px;
    width: auto;
}
  
  /* 調整導覽列連結的字體大小 */
#main-nav .nav-link {
    font-size: 1.1rem; /* 增大字體以配合變大的導覽列 */
}