/* ============================================================
   MW spot - Microwave & RF Components
   Main Stylesheet
   ============================================================ */

:root {
  --primary: #0a2a44;
  --primary-light: #0d3b5e;
  --accent: #0066b3;
  --accent-hover: #0088dd;
  --text: #333333;
  --text-light: #666666;
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-dark: #1a1a2e;
  --border: #e0e4e8;
  --success: #28a745;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 6px;
  --max-width: 1200px;
  --header-height: 72px;
  --transition: 0.25s ease;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ============================================================
   Header
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: block;
  flex-shrink: 0;
}

.logo-image-frame,
.footer-logo-frame {
  position: relative;
  display: block;
  width: 190px;
  height: 42px;
  overflow: hidden;
}

.logo-image-frame img,
.footer-logo-frame img {
  position: absolute;
  width: 214px;
  height: auto;
  left: -12px;
  top: -26px;
  max-width: none;
}

.footer-logo-frame {
  width: 150px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 4px;
}

.footer-logo-frame img {
  width: 169px;
  left: -9px;
  top: -21px;
}

/* Navigation */
.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav > li { position: relative; }

.main-nav > li > a {
  display: block;
  padding: 8px 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.main-nav > li > a:hover,
.main-nav > li.active > a {
  color: var(--accent);
  background: rgba(0,102,179,0.06);
}

/* Dropdown */
.dropdown { display: none; }

.main-nav > li:hover .dropdown {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px 0;
  z-index: 999;
}

.dropdown li a {
  display: block;
  padding: 8px 20px;
  color: var(--text);
  font-size: 13px;
  transition: all var(--transition);
}

.dropdown li a:hover {
  color: var(--accent);
  background: rgba(0,102,179,0.04);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
}

.lang-switch button {
  padding: 5px 10px;
  border: none;
  background: var(--white);
  color: var(--text-light);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.lang-switch button.active {
  background: var(--accent);
  color: var(--white);
}

.lang-switch button:hover:not(.active) {
  background: var(--bg-alt);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all var(--transition);
}

/* ============================================================
   Hero / Banner
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #0a4a6e 100%);
  color: var(--white);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  opacity: 0.9;
  max-width: 650px;
  line-height: 1.7;
}

.hero-freq {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.hero-freq strong { color: #5cb8ff; }

.hero-buttons {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
}

.btn-white:hover {
  background: #e8ecef;
  color: var(--primary);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 70px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================================
   Product Category Grid
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.product-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  color: var(--text);
}

.product-card .icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.product-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary);
}

.product-card .freq {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ============================================================
   Features / Stats
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.feature-card .feat-icon {
  font-size: 36px;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-light);
}

/* Stats */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
  text-align: center;
}

.stat-item .stat-num {
  font-size: 40px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.stat-item .stat-label {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 6px;
}

/* ============================================================
   Applications Grid
   ============================================================ */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  padding: 28px 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  transition: all var(--transition);
}

.app-card:hover {
  box-shadow: var(--shadow);
}

.app-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.app-card p {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   Contact
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 20px;
}

.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 14px;
}

.contact-item .ci-icon {
  width: 36px;
  height: 36px;
  background: rgba(0,102,179,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea { min-height: 130px; resize: vertical; }

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.cms-page-body {
  white-space: pre-line;
  line-height: 1.9;
  color: #43566a;
  margin: 0 0 28px;
}

.contact-form-status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
}

.contact-form-status.is-success { color: #1f7a42; }
.contact-form-status.is-error { color: #b42318; }

/* ============================================================
   About Page
   ============================================================ */
.about-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.about-hero h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-hero p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 700px;
  margin: 0 auto;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-text h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
}

.about-text p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 14px;
  line-height: 1.8;
}

.about-image {
  background: var(--bg-alt);
  border-radius: var(--radius);
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  color: var(--border);
}

.cert-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.cert-badge {
  padding: 8px 16px;
  background: rgba(0,102,179,0.08);
  border: 1px solid rgba(0,102,179,0.2);
  border-radius: 50px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   Product Detail Page
   ============================================================ */
.product-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  padding: 50px 0;
}

.product-hero h1 {
  font-size: 32px;
  font-weight: 700;
}

.product-hero p {
  font-size: 15px;
  opacity: 0.85;
  margin-top: 8px;
}

.product-detail-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 50px 0;
}

.product-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  align-self: start;
}

.product-sidebar h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}

.product-sidebar ul {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.product-sidebar ul li a {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.product-sidebar ul li a:hover,
.product-sidebar ul li a.current {
  color: var(--accent);
  background: rgba(0,102,179,0.04);
}

.product-sidebar ul li:last-child a { border-bottom: none; }

.product-main h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  margin-top: 32px;
}

.product-main h2:first-child { margin-top: 0; }

.product-main p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 14px;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13px;
}

.spec-table th,
.spec-table td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--border);
}

.spec-table th {
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--primary);
  width: 200px;
}

/* ============================================================
   Page Banner (generic inner page)
   ============================================================ */
.page-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  padding: 50px 0;
  text-align: center;
}

.page-banner h1 {
  font-size: 34px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-banner .breadcrumb {
  font-size: 13px;
  opacity: 0.8;
}

.page-banner .breadcrumb a {
  color: rgba(255,255,255,0.9);
}

.page-banner .breadcrumb a:hover { color: var(--white); }

/* ============================================================
   News
   ============================================================ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.news-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.news-card-body {
  padding: 22px;
}

.news-card .date {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 6px;
}

.news-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.news-card p {
  font-size: 13px;
  color: var(--text-light);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--bg-dark);
  color: #b0b8c1;
  padding: 50px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: var(--white);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col p {
  font-size: 13px;
  line-height: 1.7;
}

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul li a {
  color: #b0b8c1;
  font-size: 13px;
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: #707880;
}

.admin-login-link {
  display: inline-block;
  margin-top: 8px;
  color: #8a949f;
  font-size: 11px;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}

.admin-login-link:hover {
  color: var(--white);
}

/* ============================================================
   Language Toggle Content
   ============================================================ */
[lang] { display: none; }
[lang="en"] { display: revert; }

html[data-lang="zh"] [lang="en"] { display: none; }
html[data-lang="zh"] [lang="zh"] { display: revert; }

/* ============================================================
   Mobile Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-content {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .product-detail-content {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 10px 0;
    box-shadow: var(--shadow-hover);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  .main-nav.open { display: flex; }

  .main-nav > li > a {
    padding: 12px 24px;
  }

  .main-nav > li:hover .dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: var(--bg-alt);
    padding: 0;
  }

  .dropdown li a {
    padding-left: 40px;
  }

  .hero h1 { font-size: 30px; }
  .hero p { font-size: 15px; }

  .section { padding: 48px 0; }

  .section-header h2 { font-size: 24px; }

  .stats-row { gap: 30px; }

  .stat-item .stat-num { font-size: 30px; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .logo-image-frame { width: 145px; height: 34px; }
  .logo-image-frame img { width: 163px; left: -9px; top: -20px; }
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 24px; }
  .hero-buttons { flex-direction: column; }
  .btn { width: 100%; }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }
}
