/* ========================================
   常見問題 (QA) 頁面專用樣式
   符合傳家香品牌視覺 (赤陶紅、暖金色)
   ======================================== */

/* ── 全域與共同樣式 ── */
.qa-page-wrapper {
  font-family: var(--font-primary);
  color: var(--color-dark);
  background-color: var(--color-white);
  width: 100%;
}

.qa-container {
  max-width: 800px; /* QA 列表不需要太寬，這樣閱讀起來更舒服 */
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Hero Banner (簡潔橫幅) ── */
.qa-hero {
  margin-top: var(--header-height);
  position: relative;
  width: 100%;
  height: 240px;
  background: linear-gradient(135deg, #D04E22 0%, #E25B2A 50%, #C4A77D 100%); /* 品牌橘紅漸層金 */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qa-hero-overlay {
  display: none; /* 移除 overlay，讓漸層背景直接顯示 */
}

.qa-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qa-hero-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  animation: qaFadeDown 0.6s ease forwards;
  letter-spacing: 2px;
}

.qa-hero-line {
  width: 200px;
  height: 1px;
  background: var(--color-white);
  animation: qaLineExpand 0.6s ease 0.2s forwards;
  transform: scaleX(0);
}

.qa-hero-subtitle {
  font-size: 15px;
  color: var(--color-white);
  text-align: center;
  opacity: 0;
  animation: qaFadeUp 0.5s ease 0.4s forwards;
  letter-spacing: 1px;
}

/* ── 搜尋區塊 ── */
.qa-search-section {
  padding: 40px 0 20px;
  background-color: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
}

.qa-search-box {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-white);
  border: 1px solid var(--color-gold);
  border-radius: 4px; /* 品牌方正風格，非大圓角 */
  padding: 15px 20px 15px 50px;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.qa-search-box:focus-within {
  border-color: var(--color-gold-deep);
  box-shadow: 0 6px 20px rgba(183,169,131,0.15);
}

.qa-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold);
}

.qa-search-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 16px;
  color: var(--color-dark);
  background: transparent;
}
.qa-search-input::placeholder {
  color: var(--color-text-light);
}

/* 熱門搜尋 */
.qa-hot-searches {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
}

.qa-hot-tags-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qa-hot-label {
  font-size: 13px;
  color: var(--color-text-secondary);
}

.qa-hot-tag {
  font-size: 13px;
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.qa-hot-tag:hover {
  background: var(--color-gold);
  color: var(--color-white);
  border-color: var(--color-gold);
}

/* ── 主要內容區域 ── */
.qa-main-content {
  padding: 50px 0 80px;
  background-color: var(--color-white);
}

.qa-result-count {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  text-align: right;
}

.qa-count-number {
  color: var(--color-gold-deep);
  font-weight: 500;
}

/* ── 手風琴列表 (Accordion) ── */
.qa-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 60px;
}

.qa-accordion-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-gold); /* 左側裝飾線 */
  transition: all 0.3s ease;
  overflow: hidden; /* 為了高度動畫 */
}

.qa-accordion-item:hover {
  border-color: var(--color-gold-deep);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.qa-accordion-item.is-open {
  border-left-color: #E05026; /* 展開時變成赤陶紅 */
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

.qa-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  cursor: pointer;
  user-select: none;
  background-color: var(--color-white);
  transition: background-color 0.3s;
}

.qa-accordion-item.is-open .qa-accordion-header {
  background-color: var(--color-bg-light); /* 展開時標題列微亮 */
}

.qa-question-wrap {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.qa-question-number {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--color-gold);
  font-weight: 700;
  opacity: 0.5;
}

.qa-badge-hot {
  background-color: #E05026; /* 赤陶紅 */
  color: var(--color-white);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.qa-question-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: var(--color-dark);
  line-height: 1.4;
}

.qa-toggle-icon {
  color: var(--color-gold);
  flex-shrink: 0;
  margin-left: 15px;
  transition: color 0.3s;
}

.qa-accordion-item:hover .qa-toggle-icon {
  color: #E05026;
}

/* 旋轉動畫 */
.qa-icon-v {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.qa-accordion-item.is-open .qa-icon-v {
  transform: rotate(90deg);
  opacity: 0;
}
.qa-accordion-item.is-open .qa-toggle-icon {
  color: #E05026;
}

.qa-accordion-body {
  height: 0;
  overflow: hidden;
  transition: height 0.4s ease;
}

/* JavaScript 會控制這個的高度，這裡加上一個 padding 內部容器 */
.qa-accordion-content-inner {
  padding: 0 25px 25px 25px;
  background-color: var(--color-bg-light);
  border-top: 1px dashed var(--color-border);
}

.qa-accordion-content-inner p {
  margin: 15px 0 0 0;
  font-size: 15px;
  color: var(--color-text-footer);
  line-height: 1.8;
}

/* ── 搜尋無結果 ── */
.qa-no-results {
  text-align: center;
  padding: 60px 20px;
  background: var(--color-bg-light);
  border: 1px dashed var(--color-border);
  margin-bottom: 60px;
  border-radius: 4px;
}

.qa-no-results svg {
  margin-bottom: 15px;
  opacity: 0.5;
}

.qa-no-results-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-dark);
  margin-bottom: 8px;
}

.qa-no-results-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ── 您可能也想知道 (Suggestions) ── */
.qa-suggestions {
  margin-top: 60px;
  border-top: 1px solid var(--color-border);
  padding-top: 50px;
}

.qa-suggestions-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--color-dark);
}

.qa-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.qa-suggestion-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  padding: 30px 25px;
  text-decoration: none;
  color: var(--color-dark);
  transition: all 0.3s ease;
  border-radius: 4px;
  align-items: center;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  width: 100%;
}

.qa-suggestion-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-gold);
  box-shadow: 0 8px 25px rgba(183, 169, 131, 0.15);
  background-color: var(--color-white);
}

.qa-suggestion-icon {
  margin-bottom: 20px;
  width: 50px;
  height: 50px;
  background: #FFF9E5; /* 暖色圓形底 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.qa-suggestion-card:hover .qa-suggestion-icon {
  transform: scale(1.1);
}

.qa-suggestion-content h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}

.qa-suggestion-link {
  margin: 0;
  font-size: 14px;
  color: #E05026;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}
.qa-suggestion-link span {
  margin-left: 5px;
  transition: transform 0.3s;
}

.qa-suggestion-card:hover .qa-suggestion-link span {
  transform: translateX(4px);
}

/* ── 底部 CTA ── */
.qa-cta {
  padding: 80px 20px;
  background: linear-gradient(135deg, #FAF7F2 0%, #fbf3da 100%); /* 暖色漸層背景 */
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.qa-cta-content {
  max-width: 600px;
  margin: 0 auto;
}

.qa-cta-sub {
  font-size: 14px;
  color: #E05026;
  margin: 0 0 15px 0;
  letter-spacing: 2px;
  font-weight: 500;
}

.qa-cta-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 35px 0;
  line-height: 1.4;
}
.mobile-break {
  display: none;
}

.qa-cta-buttons {
  display: flex;
  justify-content: center;
}

.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 45px;
  background-color: #E25B2A;
  color: var(--color-white);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  transition: all 0.3s;
}

.btn-cta-primary:hover {
  background-color: #702D15;
}

/* ── 動畫 Keyframes ── */
@keyframes qaFadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes qaLineExpand {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* ── 響應式 (RWD) ── */
@media (max-width: 768px) {
  .qa-hero {
    height: 180px;
    margin-top: 60px; /* 手機版 header 較矮 */
  }
  
  .qa-hero-title {
    font-size: 24px;
  }

  .qa-search-box {
    padding: 12px 15px 12px 45px;
  }
  
  .qa-search-icon {
    left: 15px;
  }

  .qa-hot-searches {
    justify-content: flex-start;
    overflow: hidden;
  }
  
  .qa-hot-tags-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px; /* 給卷軸留點空間 */
    -webkit-overflow-scrolling: touch;
    /* 隱藏預設卷軸讓視覺乾淨些 */
    scrollbar-width: none; 
    -ms-overflow-style: none;
    gap: 10px;
  }
  .qa-hot-tags-scroll::-webkit-scrollbar {
    display: none;
  }

  .qa-hot-label, .qa-hot-tag {
    flex-shrink: 0;
  }

  .qa-accordion-header {
    padding: 15px 20px;
  }
  
  .qa-question-wrap {
    gap: 10px;
  }
  
  .qa-question-number {
    font-size: 16px;
  }
  
  .qa-question-title {
    font-size: 15px;
  }

  .qa-accordion-content-inner {
    padding: 0 20px 20px 20px;
  }

  .qa-suggestions-grid {
    grid-template-columns: 1fr;
  }
  
  .qa-cta {
    padding: 60px 20px;
  }

  .qa-cta-title {
    font-size: 22px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
  }
  .mobile-break {
    display: block;
  }
}

/* ===========================================
   配送時程表（點「配送時間」熱門搜尋按鈕時展開）
   =========================================== */
.qa-shipping-schedule {
  display: none;
  padding: 30px 0;
  background-color: var(--color-bg-light);
  border-bottom: 1px solid var(--color-border);
}

.qa-shipping-schedule.is-active {
  display: block;
  animation: qaShippingFadeIn 0.35s ease;
}

@keyframes qaShippingFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qa-shipping-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-dark);
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 3px solid #E05026; /* 赤陶紅品牌色 */
  line-height: 1.4;
}

.qa-shipping-table-wrap {
  width: 100%;
  overflow-x: auto; /* 手機版可橫向捲動，避免版面爆開 */
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.qa-shipping-table {
  width: 100%;
  min-width: 640px; /* 保持五欄可讀，過窄時觸發捲動 */
  border-collapse: collapse;
  background: var(--color-white);
  font-size: 14px;
}

.qa-shipping-table th,
.qa-shipping-table td {
  padding: 14px 16px;
  text-align: center;
  border: 1px solid var(--color-border);
  vertical-align: middle;
}

.qa-shipping-table thead th {
  background: var(--color-gold);
  color: var(--color-white);
  font-weight: 600;
  white-space: nowrap;
}

.qa-shipping-table tbody td {
  color: var(--color-text-primary);
  line-height: 1.6;
}

.qa-shipping-table .qa-shipping-area {
  background-color: var(--color-bg-light);
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
}

.qa-shipping-table .qa-shipping-slot {
  background-color: #FFF9E5; /* 暖色底，呼應品牌 */
}

.qa-shipping-note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

@media (max-width: 768px) {
  .qa-shipping-schedule {
    padding: 22px 0;
  }
  .qa-shipping-title {
    font-size: 16px;
  }
  .qa-shipping-table {
    font-size: 13px;
  }
  .qa-shipping-table th,
  .qa-shipping-table td {
    padding: 10px 12px;
  }
}
