/* ============================================================
   Sensorbase Technologic Ltd. — Website Styles
   Design language matched to the reference site:
   red/white corporate palette, curved hero, clean grids, dark footer.
   ============================================================ */

:root {
  --red: #d6000c;
  --red-hover: #b00009;
  --red-soft: #fff0f1;
  --red-tint: #fde3e5;
  --ink: #1b1d22;
  --ink-2: #3a3f47;
  --muted: #7d838c;
  --line: #e6e8eb;
  --paper: #ffffff;
  --mist: #f6f7f9;
  --dark: #0c0d10;
  --shadow: 0 14px 40px rgba(20, 25, 35, .09);
  --max: 1200px;
  --font: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.container { width: min(100% - 48px, var(--max)); margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border: 1px solid transparent; border-radius: 2px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  transition: all .25s ease; white-space: nowrap;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-hover); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(214,0,12,.28); }
.btn-outline-red { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline-red:hover { background: var(--red); color: #fff; }
.btn-outline-white { background: transparent; color: #fff; border-color: rgba(255,255,255,.65); }
.btn-outline-white:hover { background: rgba(255,255,255,.14); border-color: #fff; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #f0f0f0; transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: 11px; }
/* Contact headset icon button in header */
.contact-icon-btn {
  padding: 9px 13px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.contact-icon-btn img { width: 18px; height: auto; display: block; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 74px; }
.brand { flex: 0 0 auto; display: block; }
.brand img { width: 178px; height: auto; }
.main-nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px; padding: 26px 0;
  font-size: 13px; font-weight: 400; color: var(--ink-2); transition: color .2s;
}
.nav-link:hover, .nav-item.open .nav-link { color: var(--red); }
.nav-link .caret { font-size: 9px; opacity: .65; }
.dropdown {
  position: absolute; top: 100%; left: -20px; min-width: 230px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 10px 0; opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: .22s ease; list-style: none; margin: 0;
}
.nav-item.open .dropdown, .nav-item:hover .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: block; padding: 9px 22px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.dropdown a:hover { background: var(--red-soft); color: var(--red); }
/* All menu text shares the same font size and normal weight */
.main-nav, .main-nav a { font-size: 13px; font-weight: 400; }

/* Products mega menu — thumbnail + product name */
.dropdown.mega {
  left: -30px; width: 620px; min-width: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px;
  padding: 14px;
}
.dropdown.mega li { margin: 0; }
.dropdown.mega a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 3px; font-size: 13px; font-weight: 400;
  transition: background .18s, color .18s;
}
.dropdown.mega a img {
  width: 42px; height: 38px; object-fit: contain; flex: 0 0 42px;
  background: transparent; border-radius: 2px; padding: 2px;
}
.dropdown.mega a span { line-height: 1.3; }
.dropdown.mega a:hover img { background: transparent; }
.dropdown.mega .mega-all {
  grid-column: 1 / -1; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line);
}
.dropdown.mega .mega-all a {
  color: var(--red); font-size: 13px; font-weight: 400;
  padding: 8px 10px;
}

/* NTC Thermistor -> series flyout submenu */
.dropdown.mega li.has-sub { position: relative; }
.dropdown.mega li.has-sub > a { position: relative; }
.sub-caret { margin-left: auto; font-size: 10px; color: var(--muted); transition: transform .2s; }
.dropdown.mega li.has-sub:hover > a .sub-caret { transform: rotate(90deg); color: var(--red); }
.subdropdown {
  position: absolute; left: 100%; top: -8px; min-width: 168px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 8px 0; list-style: none; margin: 0;
  display: none; z-index: 20;
}
.dropdown.mega li.has-sub:hover > .subdropdown,
.dropdown.mega li.has-sub:focus-within > .subdropdown { display: block; }
.subdropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 12px; font-size: 13px; font-weight: 400; color: var(--ink-2);
  white-space: nowrap;
}
.subdropdown a img {
  width: 32px; height: 30px; object-fit: contain; flex: 0 0 32px;
  background: transparent; border-radius: 2px; padding: 2px;
}
.subdropdown a:hover { background: var(--red-soft); color: var(--red); padding-left: 16px; }
.subdropdown a:hover img { background: transparent; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink-2); position: relative;
}
.icon-btn:hover { color: var(--red); }
.mobile-toggle { display: none; }

/* Search overlay */
.search-panel {
  position: absolute; top: 100%; right: 0; width: 340px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow); padding: 18px;
  display: none;
}
.search-panel.active { display: block; }
.search-panel input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); font-size: 14px; outline: none; }
.search-panel input:focus { border-color: var(--red); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 380px; display: grid; place-items: center;
  text-align: center; color: #fff; padding: 58px 20px 140px;
  background: #4a0d0d url("../assets/hero-bg.svg") center/cover no-repeat;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,3,3,.28) 0%, rgba(20,3,3,.46) 100%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 2; }
.hero-badge {
  display: inline-block; padding: 5px 15px; border: 1px solid rgba(255,130,120,.85);
  border-radius: 30px; color: #ffb5ae; font-size: 10.5px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(32px, 4vw, 54px); line-height: 1.15; margin: 0 0 14px; font-weight: 600; letter-spacing: -.02em; }
.hero p { max-width: 660px; margin: 0 auto 24px; font-size: 15px; color: rgba(255,255,255,.87); line-height: 1.8; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-curve {
  position: absolute; left: -5%; right: -5%; bottom: -2px; height: 130px;
  background: var(--mist); border-radius: 50% 50% 0 0 / 100% 100% 0 0; z-index: 3;
}

/* ---------- Section headings ---------- */
.section { padding: 70px 0; }
/* Reduce whitespace directly under the inner page hero to a single line */
.page-hero + .section { padding-top: 20px; }
.hero + .section { padding-top: 20px; }
.section-mist { background: var(--mist); }
.eyebrow {
  display: flex; align-items: center; gap: 9px; color: var(--red);
  font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  margin-bottom: 16px;
}
.eyebrow::after { content: ""; width: 34px; height: 2px; background: var(--red); display: block; }
.section-title { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; font-weight: 600; margin: 0 0 14px; color: var(--ink); }
.section-desc { color: var(--muted); max-width: 600px; margin: 0 0 32px; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head-row .section-desc { margin-bottom: 0; }
.text-link { color: var(--red); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; display: inline-flex; gap: 6px; align-items: center; }
.text-link:hover { text-decoration: underline; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-visual { display: grid; place-items: center; }
.about-visual img { width: auto; max-width: 560px; max-height: 460px; filter: drop-shadow(0 18px 26px rgba(0,0,0,.10)); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.stat .num { font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.stat .num span { color: var(--red); }
.stat .label { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }

/* ---------- Product cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 20px 20px 22px; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: #d9dde2; }
.product-thumb { height: 148px; display: grid; place-items: center; background: transparent; border-radius: 2px; margin-bottom: 18px; overflow: hidden; }
.product-thumb img { max-height: 128px; width: auto; transition: transform .3s; }
.product-card:hover .product-thumb img { transform: scale(1.06); }
.product-card h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
.product-card p { font-size: 12.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; flex: 1; }
.card-link { color: var(--red); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 7px; }
.card-link:hover { gap: 11px; }
.center-cta { text-align: center; margin-top: 38px; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.news-item { padding: 28px 26px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.news-item:nth-child(3n) { border-right: 0; }
.news-date { color: var(--red); font-size: 11px; font-weight: 700; letter-spacing: .05em; margin-bottom: 12px; }
.news-item h3 { font-size: 18px; line-height: 1.4; margin: 0 0 12px; font-weight: 600; }
.news-item p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

/* ---------- Support resources ---------- */
.resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; text-align: center; padding-top: 10px; }
.resource-icon {
  width: 68px; height: 68px; border-radius: 50%; background: var(--red-tint);
  color: var(--red); display: grid; place-items: center; margin: 0 auto 18px;
}
.resource-icon svg { width: 26px; height: 26px; }
.resource h3 { font-size: 17px; margin: 0 0 8px; }
.resource p { color: var(--muted); font-size: 13px; margin: 0 0 18px; }

/* ---------- CTA band ---------- */
.cta-band {
  position: relative; padding: 56px 0; color: #fff; overflow: hidden;
  background: #10131a url("../assets/cta-bg.svg") center/cover no-repeat;
}
.cta-band::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, rgba(5,7,11,.55), rgba(5,7,11,.15)); }
.cta-inner { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.cta-script { font-family: Georgia, serif; font-style: italic; font-size: 25px; font-weight: 700; opacity: .92; }
.cta-copy h2 { font-size: 27px; margin: 0 0 8px; font-weight: 600; }
.cta-copy p { margin: 0 0 20px; color: rgba(255,255,255,.78); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer { background: #cfe6d4; color: var(--ink-2); padding: 50px 0 0; font-size: 12.5px; }
.footer-top { text-align: center; padding-bottom: 26px; border-bottom: 1px solid #b4d4bb; }
.footer-top p { margin: 0 0 18px; color: #43574a; }
.footer-top p strong { color: var(--ink); font-weight: 600; }
.footer-top p span { margin: 0 16px; color: #93b89c; }
.footer-top a { color: var(--red); }
.footer-top a:hover { color: var(--red-hover); text-decoration: underline; }
.socials { display: flex; gap: 10px; justify-content: center; }
.social {
  width: 36px; height: 36px; border-radius: 50%; background: #bcdcc4;
  display: grid; place-items: center; color: #3b5342; transition: .2s;
}
.social:hover { background: var(--red); color: #fff; transform: translateY(-3px); }
.social svg { width: 16px; height: 16px; }
.footer-cols { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1fr; gap: 40px; padding: 42px 0 46px; }
.footer-col h4 { color: var(--ink); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 18px; padding-bottom: 14px; position: relative; }
.footer-col h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 2px; background: var(--red); }
.footer-product-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a:hover { color: var(--red); text-decoration: underline; }
.footer-logo img { width: 180px; margin-bottom: 18px; }
.footer-addr { color: #43574a; line-height: 1.9; }
.footer-addr a { color: var(--red); }
.footer-bottom {
  border-top: 1px solid #b4d4bb; padding: 18px 0 24px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #4f6656; font-size: 11.5px;
}
.footer-bottom a:hover { color: var(--red); }

/* ---------- Inner page hero ---------- */
.page-hero {
  background: #4a0d0d url("../assets/hero-bg.svg") center/cover no-repeat;
  color: #fff; padding: 42px 0; position: relative; text-align: center;
}
.page-hero::after { content:""; position:absolute; inset:0; background: rgba(20,3,3,.48); }
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(28px, 3.4vw, 42px); margin: 0 0 10px; font-weight: 600; }
.page-hero p { margin: 0; color: rgba(255,255,255,.82); }
.breadcrumb { display: flex; gap: 8px; justify-content: center; list-style: none; padding: 0; margin: 0 0 12px; font-size: 11px; color: rgba(255,255,255,.6); }
.breadcrumb a:hover { color: #fff; }

/* ---------- Generic content ---------- */
.prose h2 { font-size: 26px; margin: 34px 0 14px; }
.prose h3 { font-size: 19px; margin: 26px 0 10px; }
.prose p { color: var(--ink-2); margin: 0 0 16px; }
.prose ul { color: var(--ink-2); padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.info-card { border: 1px solid var(--line); padding: 26px; border-radius: 3px; background: #fff; }
.info-card h3 { margin: 0 0 10px; font-size: 18px; }
.info-card p { color: var(--muted); margin: 0; font-size: 13.5px; }
.faq-item { border-bottom: 1px solid var(--line); padding: 20px 0; }
.faq-item h3 { font-size: 16px; margin: 0 0 8px; }
.faq-item p { color: var(--muted); margin: 0; font-size: 13.5px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px 0; border-bottom: 1px solid var(--line); }
.contact-card .contact-ico { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; }
.contact-card h4 { margin: 0 0 4px; font-size: 14px; }
.contact-card p { margin: 0; color: var(--muted); font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 2px;
  font-family: inherit; font-size: 13px; outline: none; background: #fff;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--red); }
.field textarea { min-height: 130px; resize: vertical; }
.subject-picker { position: relative; }
.subject-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.subject-trigger { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 2px; background: #fff; font-family: inherit; font-size: 13px; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.subject-trigger:hover, .subject-picker.open .subject-trigger { border-color: var(--red); }
.subject-current { display: flex; align-items: center; gap: 10px; min-width: 0; }
.subject-thumb { width: 30px; height: 26px; object-fit: contain; flex: 0 0 30px; }
.subject-caret { color: var(--muted); flex: 0 0 auto; }
.subject-menu { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 320px; overflow-y: auto; padding: 4px; }
.subject-picker.open .subject-menu { display: block; }
.subject-option { width: 100%; border: 0; background: transparent; border-radius: 2px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; font-family: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; text-align: left; }
.subject-option img { width: 30px; height: 26px; object-fit: contain; flex: 0 0 30px; }
.subject-option:hover, .subject-option.active { background: var(--red-soft); color: var(--red); }
.subject-option[aria-selected="true"] { font-weight: 600; }
.form-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main-nav { gap: 16px; }
  .nav-link { font-size: 12px; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .mobile-toggle { display: grid; }
  .main-nav {
    position: fixed; inset: 74px 0 auto 0; background: #fff; flex-direction: column;
    align-items: stretch; gap: 0; padding: 10px 24px 20px; box-shadow: var(--shadow);
    transform: translateY(-130%); transition: transform .3s ease; max-height: calc(100vh - 74px); overflow: auto;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-link { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 8px 14px; min-width: 0; display: none; }
  .nav-item.open .dropdown { display: block; }
  .dropdown.mega { width: 100%; left: 0; padding: 6px 0 8px; display: none; grid-template-columns: 1fr; gap: 0; }
  .nav-item.open .dropdown.mega { display: grid; }
  .dropdown.mega .mega-all { margin-top: 4px; }
  /* Series submenu: inline expand on mobile */
  .dropdown.mega li.has-sub:hover > a .sub-caret { transform: none; color: var(--muted); }
  .sub-caret { display: inline-block; transition: transform .2s; }
  .dropdown.mega li.has-sub.open > a .sub-caret { transform: rotate(90deg); color: var(--red); }
  .dropdown.mega .subdropdown { position: static; min-width: 0; box-shadow: none; border: 0; border-left: 2px solid var(--red-tint); padding: 2px 0 4px 8px; margin: 0 0 4px 20px; display: none; }
  .dropdown.mega li.has-sub:hover > .subdropdown { display: none; }
  .dropdown.mega li.has-sub.open > .subdropdown { display: block; }
  .dropdown.mega .subdropdown a:hover { padding-left: 16px; }
  .header-tools .btn-outline-red, .header-tools .btn-red { display: none; }
  .about-grid, .contact-grid, .info-grid { grid-template-columns: 1fr; gap: 34px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-item:nth-child(3n) { border-right: 1px solid var(--line); }
  .news-item:nth-child(2n) { border-right: 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 32px, var(--max)); }
  .header-inner { height: 64px; }
  .brand img { width: 148px; }
  .main-nav { top: 64px; }
  .hero { padding: 58px 18px 115px; min-height: 420px; }
  .hero-curve { height: 80px; }
  .section { padding: 50px 0; }
  .product-grid, .news-grid, .resources, .stats, .footer-product-cols { grid-template-columns: 1fr; }
  .news-item { border-right: 0 !important; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-top p span { display: none; }
}
