/* =====================================================================
   省省吧 — 彰化在地優惠刊登平台
   全站共用樣式表 (design system)
   ===================================================================== */

/* ---------- 設計變數 ---------- */
:root {
  --primary: #ff4119;        /* 主色：活力珊瑚橘（更鮮亮）*/
  --primary-dark: #e62f0c;
  --primary-soft: #ffe9e2;
  --accent: #ffc314;         /* 點綴：省錢金黃（更亮）*/
  --accent-dark: #f59e0b;
  --teal: #06c2ad;           /* 輔助：鮮活青綠（用於填色 / 邊框 / icon）*/
  --teal-ink: #0a8576;       /* 青綠文字色：小字在淺底上維持可讀性 */
  --teal-soft: #d6f8f3;

  --ink: #1b2230;            /* 主文字 */
  --muted: #6a7280;          /* 次要文字 */
  --bg: #fffaf5;             /* 頁面底色：暖奶油 */
  --surface: #ffffff;
  --border: #ffe1d4;
  --shadow: 0 6px 24px rgba(32, 38, 47, .08);
  --shadow-lg: 0 14px 40px rgba(32, 38, 47, .14);

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --container: 1140px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section-y: clamp(3rem, 7vw, 5.5rem);

  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, "Helvetica Neue", sans-serif;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: clamp(15px, 1.6vw, 16.5px);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font-family: inherit; cursor: pointer; }

/* ---------- 版面容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--soft { background: var(--surface); }
.section--cream { background: linear-gradient(180deg, #fffaf5, #fff1e8); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}
.section-head .eyebrow {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: .12em;
  font-size: .8rem;
  text-transform: uppercase;
}
.section-head h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin-block: .4rem .6rem;
}
.section-head p { color: var(--muted); }

/* ---------- 標題階層 ---------- */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 800; }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--muted); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .7em 1.5em;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px rgba(255, 65, 25, .4); }
.btn--primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn--accent { background: var(--accent); color: #4a3500; box-shadow: 0 8px 22px rgba(255, 195, 20, .45); }
.btn--accent:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary-soft); }
.btn--light { background: #fff; color: var(--primary); }
.btn--light:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--sm { padding: .5em 1.1em; font-size: .9rem; }
.btn--block { width: 100%; }

/* ---------- 標籤 / 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .3em .85em;
  border-radius: var(--radius-pill);
  font-size: .8rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.badge--accent { background: #fff5db; color: #9a6300; }
.badge--teal { background: var(--teal-soft); color: var(--teal-ink); }
.badge--free { background: #e7f8ec; color: #13b85d; }

/* =====================================================================
   Header / Nav
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--ink);
}
.brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
}
.brand .brand-mark span { transform: translateY(-1px); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(.5rem, 2vw, 1.6rem);
}
.nav-links a {
  font-weight: 600;
  color: var(--ink);
  padding: .4rem .2rem;
  position: relative;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px; border-radius: 3px;
  background: var(--primary);
}
.nav-actions { display: flex; align-items: center; gap: .6rem; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  width: 44px; height: 44px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 3px;
  width: 24px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 3px;
  transition: .25s;
}

/* =====================================================================
   Hero
   ===================================================================== */
.hero {
  position: relative;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(28,16,8,.7), rgba(255,65,25,.5)),
    url("../images2/hero-bg.png") center/cover no-repeat;
}
.hero .container {
  padding-block: clamp(3.5rem, 10vw, 7rem);
  display: grid;
  gap: 1.4rem;
  max-width: 820px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.hero p { font-size: clamp(1.05rem, 2.4vw, 1.3rem); max-width: 600px; text-shadow: 0 1px 6px rgba(0,0,0,.3); }
.hero .hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .4rem; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 5vw, 3rem);
  margin-top: 1.2rem;
}
.hero-stats .stat strong { display: block; font-size: clamp(1.5rem, 4vw, 2.2rem); }
.hero-stats .stat span { font-size: .9rem; opacity: .9; }

/* ---------- 搜尋列 ---------- */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  background: #fff;
  padding: .6rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 620px;
}
.search-bar input,
.search-bar select {
  flex: 1 1 160px;
  min-width: 0;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: .75em 1em;
  font-size: 1rem;
  color: var(--ink);
  font-family: inherit;
}
.search-bar input:focus,
.search-bar select:focus { outline: 2px solid var(--primary); border-color: transparent; }
.search-bar .btn { flex: 0 0 auto; }

/* =====================================================================
   分類網格
   ===================================================================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}
.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  padding: 1.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .18s ease, box-shadow .2s ease, border-color .2s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary); }
.cat-card .ico {
  font-size: 2rem;
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
}
.cat-card h3 { font-size: 1.05rem; }
.cat-card .count { font-size: .82rem; color: var(--muted); }

/* =====================================================================
   優惠卡片
   ===================================================================== */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.deal-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .2s ease;
}
.deal-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.deal-card .thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--primary-soft);
}
.deal-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.deal-card .thumb .badge { position: absolute; top: .8rem; left: .8rem; box-shadow: var(--shadow); }
.deal-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.deal-card .cat-tag { font-size: .8rem; font-weight: 700; color: var(--teal-ink); }
.deal-card h3 { font-size: 1.15rem; }
.deal-card .store { font-size: .92rem; color: var(--muted); }
.deal-card .offer { font-weight: 800; color: var(--primary-dark); font-size: 1.05rem; }
.deal-card .meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--muted);
  margin-top: auto;
}
.deal-card .map-link {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-weight: 700;
  color: var(--teal-ink);
}
.deal-card .map-link:hover { text-decoration: underline; }
.deal-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
}

/* ---------- 篩選列 ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.8rem;
}
.filter-chip {
  padding: .5em 1.1em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: .9rem;
  color: var(--ink);
  transition: .15s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* =====================================================================
   How it works / 步驟
   ===================================================================== */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.4rem;
  text-align: center;
}
.step .num {
  width: 48px; height: 48px;
  margin: 0 auto .9rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #4a3500;
  font-weight: 900;
  font-size: 1.2rem;
}
.step h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.step p { color: var(--muted); font-size: .95rem; }

/* =====================================================================
   功能 / 特色卡
   ===================================================================== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.4rem;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.feature .ico { font-size: 1.8rem; margin-bottom: .6rem; }
.feature h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.feature p { color: var(--muted); font-size: .95rem; }

/* =====================================================================
   價格 / 方案
   ===================================================================== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.plan.featured { border: 2px solid var(--primary); box-shadow: var(--shadow-lg); position: relative; }
.plan.featured .ribbon {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; padding: .25em 1em; border-radius: var(--radius-pill);
  font-size: .8rem; font-weight: 700;
}
.plan h3 { font-size: 1.3rem; }
.plan .price { font-size: 2.2rem; font-weight: 900; color: var(--primary-dark); }
.plan .price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.plan ul { display: grid; gap: .55rem; }
.plan ul li { display: flex; gap: .5em; color: var(--muted); }
.plan ul li::before { content: "✓"; color: #13b85d; font-weight: 900; }

/* =====================================================================
   CTA 區塊
   ===================================================================== */
.cta {
  background: linear-gradient(120deg, var(--primary), var(--accent-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.5rem);
  text-align: center;
}
.cta h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: .6rem; }
.cta p { opacity: .95; max-width: 560px; margin: 0 auto 1.4rem; }
.cta .hero-cta { justify-content: center; display: flex; flex-wrap: wrap; gap: .8rem; }

/* =====================================================================
   表單
   ===================================================================== */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.5rem, 4vw, 2.6rem);
  max-width: 680px;
  margin-inline: auto;
}
.form-card.narrow { max-width: 440px; }
.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 700; font-size: .95rem; }
.field .hint { font-size: .82rem; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75em 1em;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
.field textarea { min-height: 130px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.notice {
  display: flex;
  gap: .6rem;
  background: var(--primary-soft);
  border: 1px solid #ffd9cd;
  border-radius: var(--radius-sm);
  padding: .9rem 1.1rem;
  color: var(--primary-dark);
  font-size: .92rem;
  margin-bottom: 1.4rem;
}

/* ---------- 頁首 banner (內頁) ---------- */
.page-hero {
  background: linear-gradient(120deg, var(--primary), var(--accent-dark));
  color: #fff;
  text-align: center;
}
.page-hero .container { padding-block: clamp(2.5rem, 7vw, 4rem); }
.page-hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.page-hero p { opacity: .95; max-width: 620px; margin: .6rem auto 0; }

/* ---------- 麵包屑 ---------- */
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumb a:hover { color: var(--primary); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  background: #20262f;
  color: #cdd3da;
  padding-block: clamp(2.5rem, 6vw, 3.5rem) 1.5rem;
  margin-top: var(--section-y);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}
.site-footer .brand { color: #fff; }
.site-footer p { color: #9aa3ad; font-size: .92rem; margin-top: .8rem; max-width: 30ch; }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: .9rem; }
.footer-col a { display: block; color: #aab1ba; padding: .25rem 0; font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid #333b46;
  margin-top: 2.2rem;
  padding-top: 1.3rem;
  text-align: center;
  font-size: .85rem;
  color: #8b939d;
}

/* =====================================================================
   工具 class
   ===================================================================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 2rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.rounded-img { border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* =====================================================================
   RWD
   ===================================================================== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .6rem var(--gutter) 1.2rem;
    gap: .2rem;
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .7rem .2rem; border-bottom: 1px solid var(--border); }
  .nav-links a.active::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 1.4rem; }
}
