/* ==========================================================================
   Ruiyuze — Custom Electrical & Mechanical Parts
   Global stylesheet
   ========================================================================== */

:root {
  --ink:        #0d1b2a;
  --ink-soft:   #33475b;
  --muted:      #6b7c93;
  --line:       #e2e8f0;
  --bg:         #ffffff;
  --bg-alt:     #f6f8fb;
  --bg-dark:    #0d1b2a;

  --brand:      #0b4f9e;
  --brand-dk:   #083a76;
  --brand-lt:   #e8f1fb;
  --accent:     #f59e0b;
  --success:    #0f9d58;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 2px rgba(13,27,42,.06), 0 1px 3px rgba(13,27,42,.08);
  --shadow:     0 4px 12px rgba(13,27,42,.08);
  --shadow-lg:  0 12px 32px rgba(13,27,42,.12);

  --wrap:       1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 .6em;
  font-weight: 700;
  letter-spacing: -.01em;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--bg-dark);
  color: #c9d6e4;
  font-size: .82rem;
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; min-height: 38px; flex-wrap: wrap;
}
.topbar a { color: #fff; }
.topbar .tb-right { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar strong { color: #fff; font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); font-size: 1.15rem; letter-spacing: -.02em; }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  background: linear-gradient(135deg, var(--brand) 0%, #1e7fd6 100%);
  color: #fff; display: grid; place-items: center;
  font-size: .92rem; font-weight: 800; letter-spacing: -.03em;
}
.logo small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--ink-soft); font-size: .94rem; font-weight: 500;
  padding: 9px 13px; border-radius: 8px; transition: .15s;
}
.nav a:hover { background: var(--bg-alt); color: var(--brand); }
.nav a.active { color: var(--brand); background: var(--brand-lt); }

.header-cta { display: flex; align-items: center; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
  font-size: .94rem; font-weight: 600; cursor: pointer; transition: .15s;
  font-family: inherit; line-height: 1.2; white-space: nowrap;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dk); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent); color: #3a2500; }
.btn-accent:hover { background: #dd8f08; color: #3a2500; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-light:hover { background: rgba(255,255,255,.24); color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(30,127,214,.28), transparent 62%),
    linear-gradient(160deg, #0d1b2a 0%, #12305a 62%, #0b4f9e 100%);
  color: #e8f0f9; padding: 76px 0 68px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 78%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero h1 { color: #fff; font-size: 2.85rem; margin-bottom: .5em; }
.hero h1 em { font-style: normal; color: #7fc0ff; }
.hero .lead { font-size: 1.1rem; color: #bed2e6; max-width: 34em; margin-bottom: 1.6em; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(127,192,255,.14); border: 1px solid rgba(127,192,255,.32);
  color: #9fd0ff; font-size: .8rem; font-weight: 600;
  padding: 5px 13px; border-radius: 100px; margin-bottom: 20px;
  letter-spacing: .04em; text-transform: uppercase;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-badges { display: flex; gap: 22px; flex-wrap: wrap; font-size: .88rem; color: #9fb6cd; }
.hero-badges span { display: flex; align-items: center; gap: 7px; }
.tick { color: #4ade80; font-weight: 700; }

/* RFQ card in hero */
.hero-card {
  background: #fff; border-radius: var(--radius-lg); padding: 26px;
  box-shadow: 0 24px 56px rgba(0,0,0,.34); color: var(--ink-soft);
}
.hero-card h3 { font-size: 1.08rem; margin-bottom: .35em; }
.hero-card .sub { font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.hero-card .mini-field { margin-bottom: 11px; }
.hero-card input, .hero-card select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .9rem; font-family: inherit; color: var(--ink);
  background: #fff;
}
.hero-card input:focus, .hero-card select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
.hero-card .note { font-size: .76rem; color: var(--muted); text-align: center; margin: 12px 0 0; }

/* ---------- Section shells ---------- */
section { padding: 68px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark { background: var(--bg-dark); color: #bed2e6; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head p { font-size: 1.04rem; color: var(--muted); margin-bottom: 0; }
.section-dark .section-head p { color: #9fb6cd; }
.eyebrow {
  display: inline-block; font-size: .78rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--brand);
  margin-bottom: 12px;
}
.section-dark .eyebrow { color: #7fc0ff; }

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

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; transition: .18s;
}
.card:hover { border-color: #cbd8e6; box-shadow: var(--shadow); transform: translateY(-2px); }
.card .icon {
  width: 42px; height: 42px; border-radius: 11px; background: var(--brand-lt);
  color: var(--brand); display: grid; place-items: center; margin-bottom: 16px;
  font-size: 1.15rem; font-weight: 700;
}
.card h3 { margin-bottom: .45em; }
.card p { font-size: .94rem; margin-bottom: 0; color: var(--muted); }
.card ul { margin: 0; padding-left: 1.1em; font-size: .92rem; color: var(--muted); }
.card ul li { margin-bottom: .4em; }

/* ---------- Category cards (electrical / mechanical) ---------- */
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: .18s; }
.cat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: #cbd8e6; }
.cat-thumb {
  height: 150px; display: grid; place-items: center; position: relative;
  background: linear-gradient(140deg, #eef4fb 0%, #dbe8f7 100%);
  border-bottom: 1px solid var(--line);
}
.cat-thumb svg { width: 74px; height: 74px; opacity: .92; }
.cat-body { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.cat-body h3 { font-size: 1.05rem; margin-bottom: .4em; }
.cat-body p { font-size: .9rem; color: var(--muted); flex: 1; }
.cat-body .more { font-size: .88rem; font-weight: 600; color: var(--brand); }
.cat-body .more::after { content: " →"; }

/* ---------- Capability / spec table ---------- */
.spec-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .93rem; }
.spec-table th, .spec-table td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.spec-table th { background: var(--bg-alt); font-weight: 600; color: var(--ink); width: 34%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: none; }
.spec-table td { color: var(--muted); }

/* ---------- Steps ---------- */
.steps { counter-reset: s; display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 52px 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px dashed var(--line);
}
.step:last-child { border-bottom: none; }
.step-num {
  counter-increment: s; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 1.05rem;
}
.step-num::before { content: counter(s); }
.step h3 { font-size: 1.08rem; margin-bottom: .3em; }
.step p { margin-bottom: 0; font-size: .95rem; }

/* ---------- Comparison table ---------- */
.cmp { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); font-size: .93rem; }
.cmp th, .cmp td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.cmp thead th { background: var(--bg-dark); color: #fff; font-weight: 600; font-size: .9rem; }
.cmp tbody tr:nth-child(even) { background: #fafbfd; }
.cmp tbody tr:last-child td { border-bottom: none; }
.cmp .yes { color: var(--success); font-weight: 700; }
.cmp .no  { color: #c0392b; font-weight: 700; }
.cmp .rec { background: var(--brand-lt) !important; }

/* ---------- Trust strip ---------- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-item { padding: 26px 22px; text-align: center; border-right: 1px solid var(--line); }
.trust-item:last-child { border-right: none; }
.trust-item .num { font-size: 1.7rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.trust-item .lbl { font-size: .86rem; color: var(--muted); margin-top: 4px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(150deg, #0d1b2a 0%, #12305a 100%);
  color: #e8f0f9; padding: 54px 0 50px;
}
.page-hero h1 { color: #fff; font-size: 2.15rem; margin-bottom: .35em; }
.page-hero p { color: #bed2e6; max-width: 44em; margin-bottom: 0; font-size: 1.02rem; }
.breadcrumb { font-size: .84rem; color: #7f96ac; margin-bottom: 14px; }
.breadcrumb a { color: #9fd0ff; }

/* ---------- Capability blocks ---------- */
.cap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 46px; align-items: center;
  padding: 40px 0; border-bottom: 1px solid var(--line);
}
.cap:last-child { border-bottom: none; }
.cap.rev .cap-media { order: 2; }
.cap-media {
  border-radius: var(--radius-lg); min-height: 260px;
  background: linear-gradient(140deg, #eef4fb 0%, #dbe8f7 100%);
  border: 1px solid var(--line); display: grid; place-items: center; padding: 28px;
}
.cap-media svg { width: 128px; height: 128px; opacity: .85; }
.cap h2 { font-size: 1.5rem; margin-bottom: .5em; }
.cap .cap-tag { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-lt); padding: 4px 11px; border-radius: 6px; margin-bottom: 13px; }
.cap-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Product list ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prod {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; transition: .18s;
}
.prod:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.prod h3 { font-size: 1rem; margin-bottom: .4em; }
.prod .meta { font-size: .84rem; color: var(--muted); margin-bottom: 14px; flex: 1; }
.prod .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tag { font-size: .72rem; font-weight: 600; background: var(--brand-lt); color: var(--brand); padding: 3px 9px; border-radius: 100px; }
.prod .ask { font-size: .87rem; font-weight: 600; margin-top: auto; }

/* ---------- Contact / form ---------- */
.contact-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: start; }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 17px; }
.field label { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field label .req { color: #c0392b; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: .94rem; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; font-size: .92rem; }
.radio-row label { display: flex; align-items: center; gap: 7px; font-weight: 400; color: var(--ink-soft); margin: 0; }

.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 18px; }
.side-card h3 { font-size: 1rem; margin-bottom: .8em; }
.contact-method { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.contact-method:last-child { border-bottom: none; }
.contact-method .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-lt); color: var(--brand); display: grid; place-items: center; flex: none; font-size: .95rem; }
.contact-method .lbl { font-size: .78rem; color: var(--muted); }
.contact-method .val { font-size: .94rem; font-weight: 600; color: var(--ink); word-break: break-word; }

/* ---------- FAQ ---------- */
.faq { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; background: #fff; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: none; }
.faq summary {
  padding: 17px 22px; font-weight: 600; color: var(--ink); cursor: pointer;
  font-size: .96rem; list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .a { padding: 0 22px 19px; font-size: .93rem; color: var(--muted); }
.faq .a p:last-child { margin-bottom: 0; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, #0b4f9e 0%, #1e7fd6 100%);
  color: #fff; padding: 56px 0;
}
.cta-band .wrap { display: flex; align-items: center; justify-content: space-between; gap: 34px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: .3em; font-size: 1.75rem; }
.cta-band p { color: #d6e8fb; margin-bottom: 0; max-width: 44em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-dark); color: #93a7bd; padding: 56px 0 0; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr 1.3fr; gap: 30px; padding-bottom: 40px; }
.site-footer h4 { color: #fff; font-size: .92rem; margin-bottom: 1em; letter-spacing: .02em; }
.site-footer a { color: #93a7bd; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: .6em; }
.site-footer .about { color: #93a7bd; font-size: .88rem; max-width: 30em; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: #6b8299; }

/* ---------- Placeholder marker ---------- */
.ph {
  background: #fff9e6; border-bottom: 1px dashed var(--accent);
  padding: 0 2px; cursor: help;
}

/* ---------- Mobile / tablet nav ---------- */
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  font-size: 1.15rem; line-height: 1; color: var(--ink);
}
@media (max-width: 1080px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 10px 16px 16px; gap: 2px;
    box-shadow: var(--shadow);
  }
  .nav.open a { padding: 12px 14px; }
  .nav-toggle { display: block; }
}

/* ---------- Floating WhatsApp button ---------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  display: inline-flex; align-items: center; gap: 9px;
  background: #25D366; color: #fff; font-weight: 600; font-size: .9rem;
  padding: 12px 18px; border-radius: 100px;
  box-shadow: 0 8px 24px rgba(37,211,102,.38); transition: .18s;
}
.wa-float:hover {
  background: #1da851; color: #fff;
  transform: translateY(-2px); box-shadow: 0 12px 30px rgba(37,211,102,.48);
}
.wa-float svg { flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .hero-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .prod-grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(2) { border-right: none; }
  .trust-item:nth-child(1), .trust-item:nth-child(2) { border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cap { grid-template-columns: 1fr; gap: 26px; }
  .cap.rev .cap-media { order: 0; }
}
@media (max-width: 760px) {
  h1 { font-size: 1.95rem; }
  .hero h1 { font-size: 2.05rem; }
  h2 { font-size: 1.5rem; }
  section { padding: 48px 0; }
  .nav.open { border-radius: 0; }
  .header-cta .btn { display: none; }
  .header-cta .btn.mobile-show { display: inline-flex; }
  .grid-2, .grid-3, .grid-4, .prod-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band .wrap { flex-direction: column; align-items: flex-start; }
  .cmp { font-size: .85rem; }
  .cmp th, .cmp td { padding: 10px 12px; }
  .topbar .tb-right { display: none; }
  .wa-float { right: 16px; bottom: 16px; padding: 14px; border-radius: 50%; }
  .wa-float span { display: none; }
  .site-footer { padding-bottom: 84px; }
}
