/* --- FAQ Section 基礎 --- */
.faq-section {
    padding: 40px 0;
    background-color: #FDFDFD; /* 極淡的背景色，或純白 #fff */
}

.faq-main-title {
    font-size: 32px;
    font-weight: bold;
    color: #0E1618;
    letter-spacing: 2px;
}

/* --- Tabs 樣式設計 --- */
.faq-tabs-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-bottom: 1px solid #ddd; /* 預設底部灰線 */
}

.nav-tabs .nav-link {
    border: none;
    color: #666;
    font-size: 18px;
    font-weight: 500;
    padding: 15px 0;
    background: transparent;
    position: relative;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #000;
    border: none;
}

/* Active 狀態：文字變黑，底部出現顏色條 */
.nav-tabs .nav-link.active {
    color: #000;
    font-weight: bold;
    background: transparent;
}

/* 底部顏色條 (使用偽元素) */
.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: -1px; /* 蓋住原本的灰線 */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

/* Equol Tab 激活時變青檸綠 (參考截圖) */
#equol-tab.active::after {
    background-color: #B4E800; 
}

/* Equelle Tab 激活時變灰色或粉色 (視乎設計，這裡設為深灰以示區別，或用粉色 #D7385E) */
#equelle-tab.active::after {
    background-color: #999; 
}

/* --- Accordion (手風琴) 樣式 --- */
.faq-item {
    background: #fff;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

/* 問題按鈕 (Header) */
.faq-question-btn {
    width: 100%;
    text-align: left;
    background: #fff;
    border: none;
    padding: 25px 30px;
    font-size: 18px;
    font-weight: 500;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: color 0.3s ease;
}

/* 按鈕 Hover 效果 */
.faq-question-btn:hover {
    color: #D7385E; /* Hover 變粉色 */
}

/* --- +/- Icon 動畫設計 --- */
.toggle-icon {
    position: relative;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 橫線 (永遠存在) */
.toggle-icon::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: #D7385E; /* 粉紅色 */
    transition: transform 0.3s ease;
}

/* 直線 (組成 + 號的那一豎) */
.toggle-icon::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 14px;
    background-color: #D7385E;
    transition: transform 0.3s ease;
    
    /* 重點修改 1：
       預設狀態 (即係打開左/Active 狀態)，這條線要轉 90 度訓低，
       同橫線重疊，視覺上變成減號 (-) */
    transform: rotate(90deg);
}

/* 重點修改 2：
   當按鈕有 .collapsed class (即係未打開/收埋左) 
   直線要轉番直 (0deg)，同橫線組成加號 (+) */
   .faq-question-btn.collapsed .toggle-icon::after {
    transform: rotate(0deg);
}

/* (選用效果) 讓橫線在切換時也轉動，動畫會更生動 */
.faq-question-btn:not(.collapsed) .toggle-icon::before {
    transform: rotate(180deg);
}

/* --- 答案內容區 --- */
.faq-answer-body {
    padding: 20px 30px 20px 30px;
    font-size: 15px;
    color: #666;
    line-height: 1.8;
    border-top: 1px dashed #ddd; /* 展開後的虛線分隔 */
    margin-top: -1px; /* 讓虛線貼緊按鈕 */
}

/* 收起時隱藏 border-top，避免看到一條線 */
.collapse:not(.show) .faq-answer-body {
    border-top: none; 
}

.faq-answer-body p {
    margin-bottom: 0;
}

.answer-notes {
    font-size: 14px;
    color:#9A9A9A;
}

/* --- 手機版適配 --- */
@media (max-width: 991px) {
    .faq-section {
        padding: 40px 10px;
    }

    /* 1. 強制 Tab 容器不換行 */
    .faq-tabs-wrapper .nav-tabs {
        display: flex;
        flex-wrap: nowrap !important; /* 關鍵：禁止換行 */
        width: 100%;
    }

    /* 2. 強制每個 Tab 項目佔 50% 寬度 */
    .faq-tabs-wrapper .nav-item {
        width: 50%;        
        flex: 0 0 50%;     /* Flex 屬性：不放大、不縮小、基礎寬度 50% */
        max-width: 50%;
    }

    /* 3. 調整 Tab 內的文字大小與間距，確保放得落 */
    .nav-tabs .nav-link {
        font-size: 15px;   /* 字體稍微調細，避免太逼 */
        padding: 12px 5px; /* 左右 padding 減少 */
        white-space: nowrap; /* 防止文字換行 */
        width: 100%;       /* 確保點擊範圍佔滿 */
    }

    /* 修正手機版 Tab 底部顏色條的位置 */
    .nav-tabs .nav-link::after {
        bottom: 0;
    }

    .faq-main-title {
        font-size: 26px;
        margin-bottom: 30px !important;
    }

    /* Tab 在手機版保持並排，字體稍微調小 */
    .nav-tabs .nav-link {
        font-size: 16px;
        padding: 12px 0;
    }

    /* FAQ Item 內距調整 */
    .faq-question-btn {
        padding: 20px;
        font-size: 15px;
        line-height: 1.5;
    }

    .faq-answer-body {
        padding: 20px;
    }

    /* Icon 稍微縮小防止擠壓文字 */
    .toggle-icon {
        flex-shrink: 0; /* 防止 Icon 被擠扁 */
        margin-left: 15px;
    }
}