/* ==========================================================
   浪台灣 旅行優惠中心 /deals/（Phase 3改 階段一）
   ----------------------------------------------------------
   版型依老闆提供的表格式示意圖。只服務這一頁，style.css 一行不動。

   兩個刻意的取捨：
   ① 表格列做成「一列一張卡」（border-spacing 分隔），不是傳統框線表格——
      手機收合成卡片時視覺不會斷掉，同一套骨架兩種裝置都成立。
   ② 平台只用識別色文字標，不放 logo 圖檔：沒有授權素材就不放
      （施工單 §5 也要求 logo 克制、不得做成 Banner 牆）。
   ========================================================== */

.deals-page {
  --d-red: var(--c-accent);
  --d-line: #ECE6E4;
  --d-paper: #FBF9F7;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 第一屏 ---------- */
.deals-top {
  padding: 118px 0 46px;
  background:
    radial-gradient(circle at 18% 22%, rgba(226, 62, 92, .05), transparent 42%),
    radial-gradient(circle at 82% 8%, rgba(226, 62, 92, .04), transparent 38%),
    linear-gradient(180deg, #FDFBF9, var(--d-paper));
  border-bottom: 1px solid var(--d-line);
}
.deals-top-in {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px;
  gap: 46px; align-items: start;
}
@media (max-width: 900px) {
  .deals-top { padding: 96px 0 34px; }
  .deals-top-in { grid-template-columns: 1fr; gap: 28px; }
}

/* 品牌小標：原本直接放 favicon PNG，那張圖自帶底色與留白，
   縮到 26px 就變成一張漂在旁邊的貼紙、跟旁邊的字對不齊。
   改成純 CSS 的紅色圓角磚＋白色「浪」，跟字同一條基線，也不用多載一張圖。 */
.deals-brand {
  display: inline-flex; align-items: center; gap: 9px; margin: 4px 0 16px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: .04em; color: var(--c-ink);
}
.deals-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; border-radius: 8px;
  background: var(--d-red); color: #fff;
  font-size: .92rem; font-weight: 700; line-height: 1; padding-bottom: 1px;
}

.deals-page h1 {
  position: relative; display: inline-block; margin: 0;
  font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -.02em;
}
/* 紅色手繪底線：沿用全站選單 active 的那支筆觸（圓角不等＋微傾） */
/* 底線貼齊標題寬度：原本右邊多伸出 4%，看起來像畫歪了 */
.deals-page h1::after {
  content: ""; position: absolute; left: 1%; right: 1%; bottom: -4px; height: 6px;
  background: var(--d-red); border-radius: 3px 7px 2px 6px;
  transform: rotate(-.9deg); opacity: .92;
}
.deals-sub {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin: 22px 0 0; color: var(--c-text-muted); font-size: 1.02rem;
}
.deals-live {
  padding: 4px 11px; border-radius: var(--r-pill);
  background: var(--c-pink-wash); color: var(--c-accent-hover);
  font-size: .78rem; font-weight: 600; letter-spacing: .02em;
}

/* 統計：只有兩格，數字全部由 deals.json 算出來 */
.deals-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.deals-stat {
  display: flex; align-items: center; gap: 12px;
  min-width: 178px; padding: 13px 18px;
  background: #fff; border: 1px solid var(--d-line); border-radius: 14px;
}
.ds-ic { flex: none; display: block; width: 24px; height: 24px; color: #2B333C; }
.ds-ic img { width: 24px; height: 24px; display: block; }
.ds-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ds-b { display: grid; gap: 3px; }
.ds-l { font-size: .8rem; color: var(--c-text-muted); letter-spacing: .02em; }
.ds-v { font-size: .84rem; color: var(--c-text-muted); }
.ds-v b {
  font-family: var(--font-display); font-size: 1.42rem; color: var(--d-red);
  margin-right: 3px; letter-spacing: -.01em;
}
/* 更新時間是「參考資訊」不是「賣點」：日期用墨色、字級收小，
   紅色只留給真正要人看的數字（總優惠數）。兩個都大紅＝兩個都不突出。 */
.deals-stat--date .ds-v b {
  font-size: 1.06rem; color: var(--c-ink); letter-spacing: .01em;
}

/* 右上手寫小字 */
.deals-scribble {
  margin: 0 0 12px; text-align: right;
  font-family: var(--font-display); font-weight: 700; font-size: 1.06rem;
  color: var(--c-ink); letter-spacing: .02em;
}
.deals-scribble span { display: inline-block; margin-left: 6px; color: var(--d-red); transform: rotate(6deg); }

/* 熱門折扣碼（黑卡）：只有 1 筆，由程式自動挑，不是人工釘的 */
.hot-card {
  padding: 22px 22px 20px; border-radius: 18px;
  background: linear-gradient(165deg, #22242A, #16181D 62%);
  color: #fff; box-shadow: 0 16px 40px rgba(22, 24, 29, .22);
}
.hot-t {
  display: flex; align-items: center; gap: 10px; margin: 0 0 15px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; letter-spacing: .02em;
}
.hot-t img {
  width: 30px; height: 30px; padding: 5px; box-sizing: border-box;
  background: var(--d-red); border-radius: 50%; filter: brightness(0) invert(1);
}
.hot-code {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 9px 9px 18px; background: #fff; border-radius: 12px;
}
.hot-code b {
  flex: 1; min-width: 0; font-family: var(--font-display); font-size: 1.32rem;
  color: var(--c-ink); letter-spacing: .04em; overflow-wrap: anywhere;
}
.hot-btn {
  flex: none; height: 38px; padding: 0 18px; border: none; border-radius: 9px;
  background: var(--d-red); color: #fff; cursor: pointer; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: .94rem;
  transition: background-color .18s var(--ease);
}
.hot-btn:hover { background: var(--c-accent-hover); }
.hot-btn.is-done { background: #2E9E6B; }
.hot-d { margin: 13px 0 0; font-size: .9rem; color: rgba(255, 255, 255, .72); }

/* ---------- 內容區 ---------- */
.deals-body { padding-block: 44px 64px; background: #fff; }
.deals-h2 {
  margin: 0; font-size: 1.12rem; letter-spacing: -.01em;
}

.deals-filterbar {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 14px 18px; margin-bottom: 22px;
}
.deals-filterbar .deals-h2 { grid-column: 1 / -1; }
.deals-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.dchip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-width: 84px; height: 76px; padding: 10px 13px;
  background: #fff; border: 1px solid var(--d-line); border-radius: 14px;
  font-size: .84rem; color: var(--c-text); cursor: pointer;
  transition: border-color .16s var(--ease), background-color .16s var(--ease),
              color .16s var(--ease), transform .16s var(--ease);
}
.dchip img { width: 26px; height: 26px; display: block; }
.dchip:hover { border-color: #D9CFCC; transform: translateY(-1px); }
.dchip.is-on {
  border-color: var(--d-red); background: #FFF3F5; color: var(--c-accent-hover); font-weight: 600;
}
.deals-platsel select {
  height: 46px; padding: 0 34px 0 15px; border: 1px solid var(--d-line); border-radius: 12px;
  background: #fff url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path d='M1 1.5 6 6.5l5-5' fill='none' stroke='%236E6A6E' stroke-width='1.6' stroke-linecap='round'/></svg>") no-repeat right 13px center / 12px 8px;
  font: inherit; font-size: .92rem; color: var(--c-text); cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
@media (max-width: 720px) {
  .deals-filterbar { grid-template-columns: 1fr; }
  .deals-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .dchip { flex: none; }
}

/* ---------- 表格：一列一張卡 ---------- */
.deals-tablewrap { overflow-x: auto; }
.deals-table {
  width: 100%; border-collapse: separate; border-spacing: 0 10px;
  font-size: .95rem;
}
.deals-table th {
  padding: 0 16px 2px; text-align: left; font-weight: 600;
  font-size: .8rem; color: var(--c-text-faint); letter-spacing: .04em;
}
.drow { background: #fff; cursor: pointer; }
.drow td {
  padding: 16px; border-top: 1px solid var(--d-line); border-bottom: 1px solid var(--d-line);
  vertical-align: middle; background: #fff;
  transition: background-color .16s var(--ease);
}
.drow td:first-child { border-left: 1px solid var(--d-line); border-radius: 14px 0 0 14px; }
.drow td:last-child { border-right: 1px solid var(--d-line); border-radius: 0 14px 14px 0; }
.drow:hover td { background: #FFFAFB; }
.drow[hidden] { display: none; }

/* 欄寬：把「折扣／期限／適用範圍」三欄鎖成不斷行，剩下的寬度全給優惠內容。
   之前七欄平均分，結果 1440px 下「折扣」欄 9 列有 5 列斷成兩行，整張表毛毛的。 */
.dc-plat { width: 110px; }
/* 平台色標：--pc＝品牌識別色（做底與框）、--pt＝同色系深版（做字）。
   兩個變數都由產生器依平台寫進 style，不在這裡寫死平台名稱。
   分成兩個色是因為品牌鮮豔色直接當字色對比度不夠（#FF5B00 在白底 3.2:1，AA 要 4.5）。 */
.dplat {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 86px; height: 38px; padding: 0 13px; border-radius: 10px;
  background: color-mix(in srgb, var(--pc) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--pc) 40%, #fff);
  color: var(--pt); font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: .01em;
}
.dplat:hover { color: var(--pt); background: color-mix(in srgb, var(--pc) 20%, #fff); }
/* 不支援 color-mix 的舊瀏覽器：底色退回白底，字色與框線仍在，色標不會消失 */
@supports not (background: color-mix(in srgb, red 10%, #fff)) {
  .dplat { background: #fff; border-color: var(--pt); }
}
.dc-title { font-weight: 500; color: var(--c-ink); min-width: 200px; }
.dc-code { width: 176px; }
.dcode {
  display: inline-block; padding: 8px 13px; border-radius: 9px;
  border: 1px dashed rgba(226, 62, 92, .45); background: #FFF6F8;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem;
  color: var(--c-ink); letter-spacing: .03em; white-space: nowrap;
}
.dcode--none {
  border-style: solid; border-color: var(--d-line); background: var(--c-mist);
  color: var(--c-text-muted); font-weight: 600; letter-spacing: .02em;
}
.dc-off {
  width: 168px; color: var(--c-accent-hover); font-weight: 600;
  white-space: nowrap; font-size: .92rem;
}
.dc-exp { width: 104px; color: var(--c-text-muted); white-space: nowrap; font-size: .9rem; }
.dc-scope { width: 96px; color: var(--c-text-muted); white-space: nowrap; font-size: .9rem; }
/* 欄寬要吃得下最長的按鈕文字：無碼的活動優惠寫「查看活動」四個字，
   原本 118px 的欄配 82px 的按鈕會把字擠成兩行、還溢出按鈕外。 */
.dc-act { width: 132px; text-align: right; }

.dbtn {
  min-width: 82px; height: 36px; padding: 0 14px; border: none; border-radius: 9px;
  background: var(--d-red); color: #fff; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: .9rem;
  white-space: nowrap;
  transition: background-color .18s var(--ease);
}
.dbtn:hover { background: var(--c-accent-hover); }
.dbtn.is-done { background: #2E9E6B; }

.dnote { margin-top: 7px; }
.dnote summary {
  list-style: none; cursor: pointer; font-size: .8rem; color: var(--c-text-faint);
}
.dnote summary::-webkit-details-marker { display: none; }
.dnote summary::after { content: " ⌄"; }
.dnote[open] summary::after { content: " ⌃"; }
.dnote p {
  margin: 6px 0 0; font-size: .82rem; line-height: 1.6; color: var(--c-text-muted);
  text-align: left;
}
.deals-empty { margin: 26px 0; text-align: center; color: var(--c-text-muted); }

/* 手機與小筆電：整張表收合成卡片。
   門檻設在 1120px 而不是 860px——這個寬度以下七欄塞不下，硬塞就是每一欄都斷行；
   收成一列一張卡反而好讀，也不用橫向捲。 */
@media (max-width: 1120px) {
  .deals-tablewrap { overflow-x: visible; }
  .deals-table, .deals-table tbody, .drow, .drow td { display: block; width: auto; }
  .deals-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .drow {
    border: 1px solid var(--d-line); border-radius: 14px; padding: 6px 4px; margin-bottom: 12px;
  }
  .drow td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 9px 14px; border: none; border-radius: 0; text-align: right;
  }
  .drow td:first-child, .drow td:last-child { border: none; border-radius: 0; }
  .drow td::before {
    content: attr(data-th); flex: none;
    font-size: .78rem; color: var(--c-text-faint); letter-spacing: .04em;
  }
  .dc-title { font-size: 1.02rem; }
  .dc-off, .dc-exp, .dc-scope, .dcode { white-space: normal; }
  .dc-plat, .dc-code, .dc-off, .dc-exp, .dc-scope, .dc-act { width: auto; }
  .dc-act { display: block; text-align: right; }
  .dc-act::before { display: none; }
  .dbtn { width: 100%; height: 44px; }
  .dnote p { text-align: right; }
}

/* ---------- 沒找到想要的優惠 ---------- */
.deals-ask {
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  margin-top: 34px; padding: 24px 26px;
  border: 1.5px dashed #E0D5D2; border-radius: 16px; background: var(--d-paper);
}
.deals-ask h2 { margin: 0; font-size: 1.16rem; }
.deals-ask p { margin: 6px 0 0; font-size: .92rem; color: var(--c-text-muted); }
.btn-dark {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  height: 48px; padding: 0 26px; border-radius: var(--r-md);
  background: var(--c-ink); color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1;
  transition: background-color .18s var(--ease), transform .18s var(--ease);
}
.btn-dark:hover { background: #34323A; color: #fff; transform: translateY(-1px); }
@media (max-width: 640px) {
  .deals-ask { flex-direction: column; align-items: stretch; text-align: center; }
  .btn-dark { width: 100%; }
}

/* ---------- 平台完整整理 ＋ FAQ ＋ 揭露 ---------- */
.deals-more { margin-top: 44px; }
.deals-more h2, .deals-faq h2 { margin: 0 0 16px; font-size: 1.3rem; }
.deals-morelinks { display: flex; flex-wrap: wrap; gap: 12px; }
.dmore {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 1px solid var(--d-line); border-radius: 12px;
  background: #fff; color: var(--c-ink); font-weight: 500; font-size: .95rem;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.dmore:hover { border-color: var(--d-red); color: var(--c-accent-hover); }

.deals-faq { margin-top: 44px; }
.deals-disclosure {
  margin: 32px 0 0; padding: 16px 18px; border-radius: 12px;
  background: var(--c-mist); font-size: .86rem; line-height: 1.75; color: var(--c-text-muted);
}
