/* ========================================================
   Oriental Ace Fiber - Site Style
   Color theme based on original brand: blue #055cb4
   ======================================================== */

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

:root {
  --brand: #055cb4;
  --brand-dark: #034280;
  --brand-light: #e6f0fa;
  --accent: #f5a623;
  --text: #2a2a2a;
  --text-light: #5e5e5e;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --border: #e3e7ee;
  --shadow: 0 2px 12px rgba(5, 92, 180, 0.08);
  --shadow-hover: 0 6px 24px rgba(5, 92, 180, 0.18);
  --radius: 6px;
  --max-width: 1180px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

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

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

/* ============= Header ============= */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--brand);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.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;
}
.brand img { height: 52px; width: auto; }
.brand-text { line-height: 1.2; }
.brand-text strong {
  display: block;
  font-size: 18px;
  color: var(--brand);
  letter-spacing: .5px;
}
.brand-text span {
  font-size: 12px;
  color: var(--text-light);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.main-nav a {
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius);
  transition: all .2s;
}
.main-nav a:hover { background: var(--brand-light); color: var(--brand); }
.main-nav a.active { background: var(--brand); color: #fff; }

.lang-switch {
  display: flex;
  gap: 6px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
  margin-left: 6px;
}
.lang-switch a {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text-light);
  font-weight: 500;
}
.lang-switch a.active { background: var(--brand); color: #fff; }
.lang-switch a:hover:not(.active) { background: var(--bg-soft); color: var(--brand); }

/* ============= Hero ============= */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 80px 24px 70px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,.06) 0%, transparent 40%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.hero p {
  font-size: clamp(15px, 2vw, 18px);
  max-width: 780px;
  margin: 0 auto;
  opacity: .92;
}
.hero .est {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 50px;
  font-size: 13px;
  letter-spacing: 2px;
}

/* ============= Page Header (內頁標題) ============= */
.page-header {
  background: var(--brand-light);
  padding: 50px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: clamp(26px, 4vw, 36px);
  color: var(--brand-dark);
  margin-bottom: 8px;
}
.page-header p {
  color: var(--text-light);
  font-size: 15px;
}

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

section h2 {
  font-size: 28px;
  color: var(--brand-dark);
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 12px;
}
section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background: var(--brand);
}
section h2.center { text-align: center; padding-bottom: 18px; }
section h2.center::after { left: 50%; transform: translateX(-50%); }

section h3 {
  font-size: 20px;
  color: var(--brand);
  margin: 24px 0 10px;
}

section p { margin-bottom: 14px; }

/* ============= Product Categories Grid (首頁/Products) ============= */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 30px;
}
.cat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  display: block;
  color: inherit;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}
.cat-card-img {
  background: var(--bg-soft);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cat-card-img img {
  max-height: 200px;
  max-width: 90%;
  object-fit: contain;
}
.cat-card-body {
  padding: 22px;
  border-top: 3px solid var(--brand);
}
.cat-card-body h3 {
  margin: 0 0 8px;
  font-size: 19px;
  color: var(--brand-dark);
}
.cat-card-body p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
}
.cat-card-body .more {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: .5px;
}
.cat-card-body .more::after { content: " →"; }

/* ============= Product Items Grid (子頁產品列表) ============= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 30px;
}
.product-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.product-item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.product-item-img {
  background: var(--bg-soft);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}
.product-item-img img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.product-item-name {
  padding: 14px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  letter-spacing: .5px;
  text-transform: uppercase;
  border-top: 1px solid var(--border);
}

/* ============= About Page ============= */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  align-items: start;
}
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; } }

.feature-list {
  list-style: none;
  margin: 18px 0;
}
.feature-list li {
  position: relative;
  padding: 10px 0 10px 32px;
  border-bottom: 1px dashed var(--border);
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 10px;
  width: 22px;
  height: 22px;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.cert-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
}
.cert-box img { margin: 0 auto 14px; max-width: 280px; }
.cert-box p { font-size: 13px; color: var(--text-light); margin: 0; }

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-table th, .info-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-table th {
  width: 130px;
  color: var(--brand-dark);
  font-weight: 600;
  background: rgba(5, 92, 180, .04);
}
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: none; }

/* ============= Service Page ============= */
.service-block {
  background: var(--bg-soft);
  border-left: 4px solid var(--brand);
  padding: 24px 28px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.service-block h3 { margin-top: 0; }
.service-block ul { margin-left: 20px; }
.service-block li { margin-bottom: 6px; }

/* ============= Contact Page ============= */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.contact-card h3 { margin-top: 0; }
.contact-row {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.contact-row:last-child { border-bottom: none; }
.contact-row .icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  background: var(--brand-light);
  color: var(--brand);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.contact-row .body strong {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.contact-row .body { font-size: 15px; }

.map-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}
.map-box img { width: 100%; }

/* ============= Footer ============= */
.site-footer {
  background: #1a2332;
  color: #c8d1dd;
  padding: 50px 24px 24px;
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
}
.footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.footer-col p, .footer-col a {
  color: #c8d1dd;
  font-size: 14px;
  display: block;
  padding: 4px 0;
}
.footer-col a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #2d3a4d;
  text-align: center;
  font-size: 13px;
  color: #8a96a8;
}

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

/* ============= Highlights row (首頁特色) ============= */
.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.highlight-item {
  text-align: center;
  padding: 20px;
}
.highlight-item .num {
  font-size: 38px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 8px;
}
.highlight-item h4 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 6px;
}
.highlight-item p {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
}

/* ============= Mobile nav toggle ============= */
.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(--brand); 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; }
  .lang-switch { border-left: none; padding-left: 0; margin-left: 0; padding-top: 10px; border-top: 1px solid var(--border); justify-content: center; }
}
