/* ========================================================
   ChiaPao Metal Co., Ltd. — Industrial Orange Theme
   Brand: orange (#f47b20 from logo) + steel grey
   ======================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange: #f47b20;
  --orange-dark: #d65c0a;
  --orange-light: #ffe7d5;
  --orange-soft: #fff3e8;
  --steel: #3a4753;
  --steel-dark: #232b34;
  --steel-light: #6c7884;
  --text: #2a3340;
  --text-light: #5e6873;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-tint: #fafbfc;
  --border: #e3e7ec;
  --border-strong: #c7cdd5;
  --shadow: 0 2px 12px rgba(58, 71, 83, 0.08);
  --shadow-hover: 0 8px 24px rgba(244, 123, 32, 0.18);
  --radius: 4px;
  --max-width: 1180px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", "Helvetica Neue", "Noto Sans Thai", "Sarabun", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--orange-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--orange); }

img { max-width: 100%; height: auto; display: block; }

/* ============= Top Bar ============= */
.top-bar {
  background: var(--steel-dark);
  color: #b8c2cd;
  font-size: 13px;
  padding: 8px 24px;
}
.top-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.top-bar a { color: #b8c2cd; }
.top-bar a:hover { color: var(--orange); }
.top-bar .info { display: flex; gap: 22px; flex-wrap: wrap; }
.top-bar .tag {
  background: var(--orange);
  color: #fff;
  padding: 2px 10px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* ============= Header ============= */
.site-header {
  background: #fff;
  border-bottom: 4px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}
.brand img {
  height: 46px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  border-radius: var(--radius);
  transition: all .2s;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.main-nav a:hover { background: var(--orange-soft); color: var(--orange-dark); }
.main-nav a.active {
  background: var(--orange);
  color: #fff;
}
.main-nav a.active:hover { background: var(--orange-dark); color: #fff; }

/* ============= Hero ============= */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--steel-dark) 0%, var(--steel) 100%);
  color: #fff;
  padding: 90px 24px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background-image: radial-gradient(circle at 70% 50%, rgba(244, 123, 32, 0.18) 0%, transparent 60%);
}
.hero::after {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: var(--orange);
  transform: rotate(45deg);
  opacity: .08;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: center;
}
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; }
}
.hero .est-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 700;
}
.hero .est-line::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--orange);
}
.hero h1 {
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 22px;
  letter-spacing: -.5px;
}
.hero h1 em {
  font-style: normal;
  color: var(--orange);
}
.hero p.lead {
  font-size: clamp(15px, 1.8vw, 17px);
  color: rgba(255,255,255,.92);
  margin-bottom: 32px;
  max-width: 580px;
}
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-image {
  position: relative;
}
.hero-image img {
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  border: 4px solid #fff;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all .2s;
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--orange);
  color: #fff;
}
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.5);
}
.btn-secondary:hover { background: #fff; color: var(--steel-dark); }

/* ============= Page Header ============= */
.page-header {
  background: linear-gradient(135deg, var(--steel-dark) 0%, var(--steel) 100%);
  color: #fff;
  padding: 50px 24px 45px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--orange);
}
.page-header::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -40px;
  width: 200px;
  height: 200px;
  background: var(--orange);
  transform: translateY(-50%) rotate(45deg);
  opacity: .12;
}
.page-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.breadcrumb {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: rgba(255,255,255,.7);
}
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }
.page-header h1 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -.3px;
}
.page-header p {
  margin-top: 8px;
  color: rgba(255,255,255,.9);
  font-size: 16px;
  max-width: 720px;
}

/* ============= Container ============= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 70px 24px;
}
.container-narrow {
  max-width: 980px;
  margin: 0 auto;
  padding: 70px 24px;
}

section h2 {
  font-size: 30px;
  color: var(--steel-dark);
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: -.3px;
}
section h2.center { text-align: center; }
section .section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--orange-dark);
  background: var(--orange-soft);
  padding: 4px 14px;
  border-radius: 2px;
  margin-bottom: 12px;
}
section h3 {
  font-size: 22px;
  color: var(--steel-dark);
  font-weight: 700;
  margin: 30px 0 14px;
}
section h4 {
  font-size: 16px;
  color: var(--orange-dark);
  font-weight: 700;
  margin: 18px 0 8px;
}

section p { margin-bottom: 14px; }

/* ============= Product Cards ============= */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin-top: 36px;
}
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--orange);
  color: inherit;
}
.product-card-img {
  background: linear-gradient(135deg, #f0f3f7 0%, #ffffff 100%);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.product-card-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.product-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 2px;
  text-transform: uppercase;
}
.product-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--steel-dark);
  font-weight: 700;
}
.product-card-body p {
  font-size: 13px;
  color: var(--text-light);
  flex: 1;
  margin-bottom: 14px;
  line-height: 1.55;
}
.product-card-body .more {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.product-card-body .more::after { content: " →"; transition: margin .2s; }
.product-card:hover .more::after { margin-left: 6px; }

/* ============= Stats Bar ============= */
.stats-bar {
  background: var(--orange);
  color: #fff;
  padding: 50px 24px;
  position: relative;
  overflow: hidden;
}
.stats-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 90% 20%, rgba(255,255,255,.12) 0%, transparent 50%);
}
.stats-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  text-align: center;
}
.stat .num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  color: #fff;
  letter-spacing: -.5px;
}
.stat .label {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .92;
}

/* ============= Split Layout ============= */
.split {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 50px;
  align-items: start;
}
.split-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 880px) {
  .split, .split-equal { grid-template-columns: 1fr; gap: 30px; }
}

.feature-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
}
.feature-list li {
  position: relative;
  padding: 10px 0 10px 32px;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  top: 10px;
  color: var(--orange);
  font-weight: 700;
  font-size: 18px;
}

/* ============= Spec Table (產品規格表) ============= */
.spec-table-wrap {
  margin: 30px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec-table-head {
  background: linear-gradient(135deg, var(--steel-dark) 0%, var(--steel) 100%);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.spec-table-head .code {
  background: var(--orange);
  color: #fff;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 2px;
}
.spec-table-head h4 {
  color: #fff;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.spec-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}
@media (max-width: 700px) { .spec-content { grid-template-columns: 1fr; } }

.spec-img {
  background: linear-gradient(135deg, #f0f3f7 0%, #ffffff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-right: 1px solid var(--border);
}
@media (max-width: 700px) { .spec-img { border-right: none; border-bottom: 1px solid var(--border); } }
.spec-img img {
  max-height: 200px;
  max-width: 100%;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.spec-table tr td {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.spec-table tr:last-child td { border-bottom: none; }
.spec-table tr td:first-child {
  background: var(--orange-soft);
  font-weight: 700;
  color: var(--orange-dark);
  width: 38%;
  border-right: 1px solid var(--border);
}

/* ============= Section variations ============= */
.section-soft { background: var(--bg-soft); }
.section-tint { background: var(--bg-tint); }

/* ============= News (Activity) ============= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.news-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  display: block;
  text-decoration: none;
  color: inherit;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}
.news-card-img {
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--bg-soft);
}
.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.news-card:hover .news-card-img img { transform: scale(1.05); }
.news-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(35, 43, 52, 0.4) 100%);
  pointer-events: none;
}
.news-card-body {
  padding: 18px 20px;
}
.news-card-body h3 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--steel-dark);
  font-weight: 700;
  line-height: 1.4;
}
.news-card-body .meta {
  font-size: 12px;
  color: var(--orange-dark);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
}
.news-card-body .more {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-dark);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.news-card-body .more::after { content: " →"; }

/* News detail page */
.news-detail .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.news-detail .gallery a {
  display: block;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.news-detail .gallery a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.news-detail .gallery img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* ============= Footer ============= */
.site-footer {
  background: var(--steel-dark);
  color: #b8c2cd;
  padding: 60px 24px 26px;
  margin-top: 80px;
  border-top: 4px solid var(--orange);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
}
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  margin-bottom: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 8px;
  display: inline-block;
}
.footer-col p, .footer-col a {
  color: #aab4be;
  font-size: 13px;
  line-height: 1.8;
  display: block;
}
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #353f4a;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #7a838e;
  letter-spacing: .5px;
}

/* ============= Mobile ============= */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--orange);
  margin: 4px 0;
}

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-top: 14px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 16px; }
}
