/* ===========================================================
   SANFAN — Manufacturer Site  (redesign)
   Calm, premium B2B palette: deep teal-green + warm accent
   =========================================================== */
:root {
  --ink: #15201c;
  --bg: #ffffff;
  --soft: #f4f8f6;
  --muted: #5d6b65;
  --line: #e4eae6;
  --brand: #0e6b5c;
  --brand-2: #15a892;
  --brand-ink: #0a4d42;
  --gold: #c98a3a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(20, 50, 42, .08);
  --shadow-sm: 0 4px 14px rgba(20, 50, 42, .07);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
/* iOS Safari: keep layout viewport locked to device width so a pinch-zoom
   (especially on the longer English copy) can never leave the page "stuck"
   at a wider size; also stop iOS auto-inflating font sizes after zoom/rotate. */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overflow-wrap: break-word;
}
img, table, iframe, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.section { padding: 78px 0; }
.section.soft { background: var(--soft); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 46px; }
.section-head .eyebrow {
  color: var(--brand-2); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; font-size: 13px; margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 12px; line-height: 1.2; }
.section-head p { color: var(--muted); font-size: 16px; margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  cursor: pointer; border: 1.5px solid transparent; transition: .2s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: rgba(14,107,92,.08); }
.btn-light { background: #fff; color: var(--brand-ink); }
.btn-light:hover { background: #eef5f2; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--ink); }
.nav-brand img { height: 38px; width: auto; border-radius: 8px; }
.nav-brand .accent { color: var(--brand); }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-weight: 500; font-size: 15px; color: var(--ink); position: relative; }
.nav-links a:hover { color: var(--brand); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--brand); transition: .2s;
}
.nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.lang-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
.menu-toggle { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(120deg, var(--brand-ink) 0%, var(--brand) 55%, var(--brand-2) 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: url("../../assets/img/factory-building.jpg") center/cover no-repeat;
  opacity: .22; mix-blend-mode: multiply;
}
.hero-inner { position: relative; z-index: 2; padding: 84px 0 92px; }
.hero .eyebrow {
  display: inline-block; background: rgba(255,255,255,.16); color: #eafff8;
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  letter-spacing: .04em; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.12; margin: 0 0 18px; max-width: 760px; }
.hero p.lead { font-size: clamp(16px, 2vw, 19px); color: #e7f5f1; max-width: 640px; margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,.18); border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stats .hs { background: var(--brand-ink); padding: 22px 18px; text-align: center; }
.hero-stats .num { font-size: 30px; font-weight: 800; }
.hero-stats .lab { font-size: 13px; color: #cdeee6; margin-top: 4px; }

/* ---------- Stat strip (generic) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; align-items: stretch; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: center; height: 100%; min-height: 120px;
}
.stat-card .num { font-size: 34px; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-card .lab { color: var(--muted); margin-top: 10px; font-size: 14px; line-height: 1.3; }

/* ---------- Cards grid ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow-sm); transition: .22s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfe3dc; }
.card .ico { font-size: 26px; margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------- Why us ---------- */
.feature-card .num-badge {
  width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 14px;
}

/* ---------- Factory / split ---------- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: stretch; }
.split > div { min-width: 0; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.cap-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.cap-table th, .cap-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.cap-table th { color: var(--muted); font-weight: 600; background: var(--soft); }
.cap-table td.val { font-weight: 700; color: var(--brand); text-align: right; white-space: nowrap; }

/* Factory section: full image shown (no crop), height matches the left text column */
.media-band { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--soft); height: 100%; display: flex; align-items: center; justify-content: center; }
.media-band img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Range cards ---------- */
.range-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 20px; }
.range-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: .22s ease;
  text-decoration: none; color: inherit;
}
.range-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfe3dc; }
.range-card .rc-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); }
.range-card .rc-img img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.range-card:hover .rc-img img { transform: scale(1.06); }
.range-card .rc-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.range-card h3 { margin: 0; font-size: 19px; }
.range-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.range-card .rc-more { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 13.5px; color: var(--brand); }

/* ---------- Product gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.g-item {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; transition: .22s ease;
}
.g-item:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfe3dc; }
.g-item .ph { aspect-ratio: 1/1; overflow: hidden; background: var(--soft); }
.g-item .ph img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.g-item:hover .ph img { transform: scale(1.06); }
.g-item .meta { padding: 12px 13px; }
.g-item .meta .n { font-weight: 700; font-size: 14.5px; }
.g-item .meta .s { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.gallery-note {
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 22px;
  background: #fff7ec; border: 1px solid #f3e2c6; color: #8a5a1c;
  display: inline-block; padding: 8px 16px; border-radius: 999px;
}

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.cert {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 12px; text-align: center; box-shadow: var(--shadow-sm);
}
.cert .badge { font-size: 24px; }
.cert .name { font-weight: 700; font-size: 13.5px; margin-top: 8px; }
.cert .sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.cert-wall { margin-top: 26px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cert-wall img { width: 100%; }

/* ---------- Steps (process / oem / how) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 22px; position: relative; box-shadow: var(--shadow-sm);
}
.step .n {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 14px;
}
.step h4 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- Product page category ---------- */
.cat-block { margin-bottom: 54px; }
.cat-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
.cat-head h3 { font-size: 24px; margin: 0; }
.cat-head .tag { color: var(--brand-2); font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prod-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: .22s ease; display: flex; flex-direction: column;
}
.prod-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.prod-card .ph { aspect-ratio: 4/3; background: var(--soft); overflow: hidden; }
.prod-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .info { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.prod-card .info h4 { margin: 0 0 8px; font-size: 17px; }
.prod-card .info p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.prod-card .info .more { margin-top: 14px; color: var(--brand); font-weight: 600; font-size: 13.5px; }
/* anchor variant: keep block behaviour when wrapped in <a> */
a.prod-card { color: inherit; }
a.prod-card:hover .info h4 { color: var(--brand); }

/* ---------- Product detail page ---------- */
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 16px; color: rgba(255,255,255,.82); }
.breadcrumb a { color: rgba(255,255,255,.85); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .bc-sep { opacity: .55; }
.breadcrumb .bc-cat { color: #fff; font-weight: 600; }

.product-detail { display: grid; grid-template-columns: 1.05fr 1fr; gap: 42px; align-items: start; }
.pd-gallery { position: sticky; top: 92px; }
.pd-main { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--soft); box-shadow: var(--shadow-sm); }
.pd-main img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.pd-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.pd-thumb { padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #fff; cursor: pointer; transition: .2s; aspect-ratio: 1/1; }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumb.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(14,107,92,.25); }
.pd-thumb:hover { border-color: var(--brand-2); }

.pd-info { min-width: 0; }
.pd-desc { font-size: 16.5px; color: var(--ink); line-height: 1.7; margin: 0 0 22px; }
.pd-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.pd-specs h3 { font-size: 19px; margin: 0 0 14px; }
.spec-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th, .spec-table td { text-align: left; padding: 13px 16px; font-size: 14.5px; vertical-align: top; }
.spec-table th { width: 40%; background: var(--soft); color: var(--muted); font-weight: 600; }
.spec-table td { color: var(--ink); }
.pd-specs .btn { margin-top: 18px; }

.pd-overview { font-size: 16px; color: #34433d; line-height: 1.8; max-width: 820px; margin: 0 auto 26px; }
.pd-features-title { text-align: center; font-size: 20px; margin: 0 0 22px; }
.pd-features { list-style: none; padding: 0; margin: 0 auto; max-width: 820px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 26px; }
.pd-features li { position: relative; padding-left: 30px; font-size: 15px; color: #34433d; line-height: 1.6; }
.pd-features li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(14,107,92,.12); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.pd-custom { font-size: 16px; color: #34433d; line-height: 1.8; max-width: 820px; margin: 0 auto; }

.pd-notfound { text-align: center; padding: 40px 0; }
.pd-notfound p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--brand-ink), var(--brand-2)); color: #fff; border-radius: 22px; padding: 54px 40px; text-align: center; }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); margin: 0 0 12px; }
.cta-band p { color: #e3f3ee; margin: 0 0 26px; font-size: 16px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.info-card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.info-card .val { font-size: 16px; font-weight: 600; margin-top: 6px; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; color: var(--ink); background: #fff;
  overflow-wrap: anywhere;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 110px; }
.form-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
#form-ok { display: none; margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); background: #e8f6f0; border: 1px solid #bfe3d6; color: var(--brand-ink); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #cdd9d4; padding: 56px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 34px; }
.site-footer .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; font-size: 18px; margin-bottom: 14px; }
.site-footer .brand img { height: 34px; border-radius: 8px; }
.site-footer h5 { color: #fff; font-size: 14px; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 9px; font-size: 14px; }
.site-footer ul li a:hover { color: #fff; }
.site-footer .contact-line { font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; word-break: break-word; }
.site-footer .contact-line span { color: #fff; font-weight: 600; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 38px; padding-top: 18px; font-size: 13px; color: #93a39c; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .gallery, .cert-grid { grid-template-columns: repeat(3, 1fr); }
  .steps, .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .media-band { height: 340px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 26px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
  .pd-gallery { position: static; }
}
@media (max-width: 640px) {
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 22px 16px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: block; }
  .nav-actions .btn { display: none; }
  .gallery, .cert-grid, .grid-3, .grid-4, .grid-5, .prod-grid, .stat-grid, .steps { grid-template-columns: repeat(2, 1fr); }
  .media-band { height: 300px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .stat-card { padding: 22px 14px; min-height: 100px; }
  .stat-card .num { font-size: 28px; }
  .cap-table th, .cap-table td { padding: 10px 12px; font-size: 13.5px; }
  .pd-features { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero-inner { padding: 60px 0 64px; }
}
