/* SafeDoor.com.tw — 駿旺股份有限公司 防火門窗官網
   簡潔、不花俏，重點放在 SEO/GEO 執行品質，響應式設計 */

:root {
  --navy: #1f3a5f;
  --navy-dark: #14263f;
  --accent: #c0392b;
  --bg: #ffffff;
  --bg-soft: #eef1f6;
  --text: #222c35;
  --text-muted: #5a6672;
  --border: #e0e4e8;
  --line-radius: 8px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
header.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(20, 38, 63, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy-dark);
  display: block;
  text-decoration: none;
  border-radius: 6px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background .15s ease;
}
.brand:hover { background: var(--bg-soft); text-decoration: none; color: var(--navy); }
.brand small { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }
nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
nav.main-nav a {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
nav.main-nav a.active,
nav.main-nav a:hover { color: var(--navy); }

.btn-line {
  background: #06c755;
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.btn-line:hover { background: #05b34c; text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero .wrap { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; }
.hero-text { flex: 1 1 420px; }
.hero-text h1 {
  font-size: 34px;
  line-height: 1.4;
  color: var(--navy-dark);
  margin: 0 0 16px;
}
.hero-text p { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; max-width: 46em; }
.hero-badges { flex: 1 1 320px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.badge {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(20, 38, 63, 0.06);
}
.badge .num { font-size: 26px; font-weight: 800; color: var(--navy); }
.badge .lbl { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
}
.btn-primary { background: var(--navy); color: #fff !important; }
.btn-primary:hover { background: var(--navy-dark); text-decoration: none; }
.btn-outline { border: 1.5px solid var(--navy); color: var(--navy) !important; }
.btn-outline:hover { background: var(--bg-soft); text-decoration: none; }

/* ---------- Sections ---------- */
section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }
section.alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
h2.section-title {
  font-size: 26px;
  color: var(--navy-dark);
  margin: 0 0 8px;
  padding-left: 16px;
  border-left: 5px solid var(--navy);
}
p.section-sub { color: var(--text-muted); margin: 10px 0 32px; max-width: 50em; padding-left: 16px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .hero-text h1 { font-size: 27px; }
}
@media (max-width: 620px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 40px 0; }
  nav.main-nav ul { gap: 14px; }
  .header-inner { justify-content: center; text-align: center; }
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
  padding: 24px;
  box-shadow: 0 2px 6px rgba(20, 38, 63, 0.06);
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { box-shadow: 0 6px 16px rgba(20, 38, 63, 0.12); transform: translateY(-2px); }
.card h3 { margin: 0 0 10px; font-size: 18px; color: var(--navy-dark); }
.card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
section.alt .card, section.alt .badge { background: var(--bg); }
.card .tag {
  display: inline-block;
  font-size: 12px;
  background: var(--bg-soft);
  color: var(--navy);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
  font-weight: 700;
}

/* ---------- Table ---------- */
table.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0 8px; font-size: 14.5px; }
table.spec-table th, table.spec-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
table.spec-table th { background: var(--navy); color: #fff; font-weight: 700; }
table.spec-table tr:nth-child(even) td { background: var(--bg-soft); }
.table-scroll { overflow-x: auto; }

.source-note { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 10px; }
.owner-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.owner-tag.direct { background: #e6f4ea; color: #1e7b34; }
.owner-tag.agent { background: #fdf1e6; color: #b3611c; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq-item h3 { margin: 0 0 8px; font-size: 16.5px; color: var(--navy-dark); }
.faq-item p { margin: 0; color: var(--text-muted); }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--navy-dark);
  color: #cfd8e3;
  padding: 40px 0 24px;
  margin-top: 40px;
  font-size: 14px;
}
footer.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
footer.site-footer h4 { color: #fff; font-size: 15px; margin: 0 0 12px; }
footer.site-footer a { color: #cfd8e3; }
footer.site-footer .col { flex: 1 1 220px; }
footer .bottom-bar {
  border-top: 1px solid #2c4666;
  margin-top: 24px;
  padding-top: 16px;
  font-size: 12.5px;
  color: #90a0b3;
  text-align: center;
}

/* ---------- Product cards with icon ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
@media (max-width: 860px) { .grid-4, .grid-5 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-4, .grid-5 { grid-template-columns: 1fr; } }

.prod-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(20, 38, 63, 0.06);
  transition: box-shadow .15s ease, transform .15s ease;
}
.prod-card:hover { box-shadow: 0 6px 16px rgba(20, 38, 63, 0.12); transform: translateY(-2px); }
.prod-icon {
  background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.prod-icon svg { width: 84px; height: 84px; }
.prod-body { padding: 14px 16px 16px; }
.prod-body h4 { margin: 0 0 6px; font-size: 15.5px; color: var(--navy-dark); }
.prod-size {
  font-size: 13px; color: var(--navy);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 6px 9px;
  margin-top: 8px;
  line-height: 1.5;
}
.prod-size.pending { color: var(--text-muted); font-style: italic; }
.prod-group-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin: 30px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}
.prod-group-title:first-of-type { margin-top: 6px; }

/* ---------- 首頁廣告橫幅（沒有設定圖片時整段不輸出） ---------- */
.home-banner { padding: 28px 0; border-bottom: none; }
.banner-box {
  border-radius: var(--line-radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(20, 38, 63, 0.10);
  line-height: 0;
}
.banner-box img { width: 100%; height: auto; display: block; }
.banner-box a { display: block; }
.banner-box a:hover { opacity: .94; }

/* ---------- 群組說明文字 ---------- */
.group-note {
  margin: -4px 0 16px;
  padding-left: 12px;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.8;
}
.group-note strong { color: var(--text); }

/* ---------- 規格表（型式與可製作尺寸） ----------
   刻意用表格而不是卡片：高度只要卡片的三分之一，數字好掃讀、可複製，
   也不會被誤認為可以點選挑款式。                                        */
.prod-spec-wrap {
  max-width: 620px;
  margin: 0 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
  overflow: hidden;
  background: var(--bg);
}
table.prod-spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.prod-spec thead th {
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  padding: 8px 14px;
}
table.prod-spec tbody th {
  font-weight: 700;
  color: var(--navy-dark);
  text-align: left;
  white-space: nowrap;
  width: 34%;
}
table.prod-spec tbody th,
table.prod-spec tbody td {
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
table.prod-spec tbody td { color: var(--text); line-height: 1.6; }
table.prod-spec tbody td.is-pending { color: var(--text-muted); font-style: italic; }
.spec-ico {
  display: inline-flex;
  vertical-align: -6px;
  margin-right: 8px;
}
.spec-ico svg { width: 22px; height: 22px; opacity: .75; }

/* 花色系列這種第二欄字比較長的表格，放寬一點、第一欄允許換行 */
.prod-spec-wrap.prod-spec-wide { max-width: 100%; }
.prod-spec-wide table.prod-spec tbody th { white-space: normal; width: 27%; }

@media (max-width: 620px) {
  table.prod-spec { font-size: 13.5px; }
  table.prod-spec tbody th { white-space: normal; width: 40%; }
  .spec-ico { display: none; }
}

/* ---------- 型錄下載卡 ---------- */
.dl-card {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0 8px;
  padding: 14px 18px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
}
.dl-ico {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}
.dl-body { flex: 1 1 260px; min-width: 0; }
.dl-body strong { display: block; color: var(--navy-dark); font-size: 15px; }
.dl-body span { display: block; margin-top: 3px; font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }
.dl-card .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .dl-card .btn { width: 100%; text-align: center; }
}

/* ---------- 可點選的產品卡片 ---------- */
.prod-card-link { display: block; color: inherit; text-decoration: none; }
.prod-card-link:hover { text-decoration: none; }
.prod-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}

/* ---------- 產品卡片照片 ---------- */
.prod-photo {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.prod-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 自動等比例填滿，不會變形 */
  object-position: center 42%;
  display: block;
}

/* ---------- 左側分類導覽 ---------- */
.with-side-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
}
.side-nav { flex: 0 0 190px; }
.side-nav-inner {
  position: sticky;
  top: 92px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--line-radius);
  padding: 16px 14px;
  box-shadow: 0 2px 6px rgba(20, 38, 63, 0.06);
}
.side-nav-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
}
.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li + li { margin-top: 2px; }
.side-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid transparent;
}
.side-nav a:hover {
  background: var(--bg-soft);
  color: var(--navy);
  border-left-color: var(--accent);
  text-decoration: none;
}
.side-nav-content { flex: 1 1 auto; min-width: 0; }
/* 側邊導覽模式下，內容區的 section 不需要再自己置中與留白 */
.side-nav-content section { padding: 40px 0; }
.side-nav-content section:first-child { padding-top: 8px; }
.side-nav-content section.alt {
  background: transparent;
  border-top: none;
}
.side-nav-content .wrap { max-width: none; padding: 0; }
/* 錨點跳轉時避免被固定表頭遮住 */
.side-nav-content section { scroll-margin-top: 86px; }

@media (max-width: 860px) {
  .with-side-nav { display: block; padding: 0; }
  .side-nav { display: none; }
  .side-nav-content .wrap { max-width: var(--maxw); padding: 0 20px; }
  .side-nav-content section { padding: 48px 0; }
  .side-nav-content section.alt { background: var(--bg-soft); border-top: 1px solid var(--border); }
}

/* Sticky mobile LINE CTA */
.mobile-line-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #06c755;
  z-index: 60;
}
.mobile-line-bar a {
  display: block;
  text-align: center;
  color: #fff !important;
  font-weight: 700;
  padding: 13px 0;
}
@media (max-width: 620px) {
  .mobile-line-bar { display: block; }
  body { padding-bottom: 52px; }
}
