/* ========================================
   SanTeXing Electronics - BestSwitch STX
   B2B Industrial Static Website
   Theme: Professional Industrial Blue
   ======================================== */

/* === CSS Variables === */
:root {
  --primary: #1A3A5C;
  --primary-dark: #0F2440;
  --primary-light: #2C5F8A;
  --secondary: #2E8B57;
  --secondary-light: #3DAF6E;
  --accent: #F5A623;
  --accent-hover: #E09510;
  --bg-light: #F8F9FA;
  --bg-dark: #1A1A2E;
  --text-dark: #222;
  --text-mid: #555;
  --text-light: #888;
  --white: #FFFFFF;
  --border: #E0E0E0;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 80px; }
body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* === Typography === */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; color: var(--primary); }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; }
p { margin-bottom: 1rem; color: var(--text-mid); }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { position: relative; display: inline-block; }
.section-title h2::after {
  content: ''; display: block; width: 60px; height: 3px;
  background: var(--secondary); margin: 12px auto 0; border-radius: 2px;
}
.section-title p { color: var(--text-light); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* === Buttons === */
.btn {
  display: inline-block; padding: 12px 32px; border-radius: 50px;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: var(--transition); border: 2px solid transparent;
  text-align: center; font-family: var(--font-main);
}
.btn-primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--white); }
.btn-outline { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--primary); }
.btn-secondary { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-dark); color: var(--white); }

/* === Header / Nav === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
  height: 72px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; width: auto; }
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.logo-text span { color: var(--secondary); font-weight: 400; }
.nav-links { display: flex; gap: 8px; align-items: center; }
.nav-links a {
  padding: 8px 16px; color: var(--text-dark); font-weight: 500;
  font-size: 0.9rem; border-radius: 6px; transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); background: rgba(26,58,92,0.06); }
.nav-cta { background: var(--accent) !important; color: var(--white) !important; padding: 8px 20px !important; border-radius: 50px !important; }
.nav-cta:hover { background: var(--accent-hover) !important; }

/* Mobile Menu Toggle */
.menu-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; background: none; border: none; }
.menu-toggle span { width: 24px; height: 2px; background: var(--primary); border-radius: 2px; transition: var(--transition); }

/* === Hero === */
.hero {
  min-height: 85vh; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative; overflow: hidden; margin-top: 72px;
}
.hero-bg { position: absolute; inset: 0; object-fit: cover; opacity: 0.15; width: 100%; height: 100%; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(15,36,64,0.85) 0%, rgba(26,58,92,0.7) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 700px; padding: 40px 20px; }
.hero-badge {
  display: inline-block; padding: 6px 16px; background: rgba(46,139,87,0.2);
  border: 1px solid rgba(46,139,87,0.4); border-radius: 50px;
  color: var(--secondary-light); font-size: 0.85rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero h1 { color: var(--white); margin-bottom: 1.2rem; }
.hero h1 span { color: var(--accent); }
.hero p { color: rgba(255,255,255,0.8); font-size: 1.1rem; margin-bottom: 2rem; max-width: 580px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* === Stats Bar === */
.stats-bar {
  background: var(--white); padding: 40px 0; border-bottom: 1px solid var(--border);
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; text-align: center; }
.stat-item h3 { font-size: 2rem; color: var(--secondary); margin-bottom: 4px; }
.stat-item p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* === Section General === */
section { padding: 80px 0; }
section.alt-bg { background: var(--bg-light); }

/* === Product Overview (Home) === */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}
.product-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: var(--transition);
  display: flex; flex-direction: column;
}
.product-card:hover {
  box-shadow: var(--shadow-hover); transform: translateY(-4px);
  border-color: var(--primary-light);
}
.product-card-image {
  height: 220px; overflow: hidden; background: var(--bg-light);
  display: flex; align-items: center; justify-content: center;
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-card:hover .product-card-image img { transform: scale(1.05); }
.product-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.product-card-body h3 { font-size: 1.1rem; margin-bottom: 8px; }
.product-card-body p { font-size: 0.9rem; color: var(--text-light); flex: 1; margin-bottom: 15px; }
.product-card-body .btn { align-self: flex-start; padding: 8px 24px; font-size: 0.85rem; }

/* === Product Detail Page === */
.product-detail {
  margin-top: 72px; padding: 40px 0;
}
.product-detail-header { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; align-items: start; }
.product-detail-gallery { position: sticky; top: 90px; }
.product-detail-gallery .main-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.product-detail-gallery .thumb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.product-detail-gallery .thumb-grid img { border-radius: 6px; border: 1px solid var(--border); cursor: pointer; height: 80px; object-fit: cover; }
.product-detail-gallery .thumb-grid img:hover { border-color: var(--primary); }
.product-detail-info h1 { margin-bottom: 0.5rem; }
.product-detail-info .product-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1rem; }
.product-detail-info .product-tags span {
  padding: 4px 12px; background: rgba(26,58,92,0.06); border-radius: 50px;
  font-size: 0.8rem; color: var(--primary-light);
}

/* Spec Table */
.spec-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.spec-table th, .spec-table td { padding: 10px 16px; border: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.spec-table th { background: var(--primary); color: var(--white); font-weight: 600; }
.spec-table tr:nth-child(even) { background: var(--bg-light); }
.spec-table td:first-child { font-weight: 600; color: var(--text-dark); white-space: nowrap; }

/* === About Page === */
.about-hero {
  margin-top: 72px; min-height: 50vh; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  position: relative; overflow: hidden;
}
.about-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.12; }
.about-hero-content { position: relative; z-index: 2; text-align: center; padding: 60px 20px; }
.about-hero-content h1 { color: var(--white); margin-bottom: 0.5rem; }
.about-hero-content p { color: rgba(255,255,255,0.75); font-size: 1.1rem; }
.about-section { padding: 80px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-grid.reverse { direction: rtl; }
.about-grid.reverse > * { direction: ltr; }
.about-grid img { width: 100%; border-radius: var(--radius-lg); }

/* === Features === */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--white); padding: 30px 24px; border-radius: var(--radius);
  border: 1px solid var(--border); text-align: center;
  transition: var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.feature-icon { font-size: 2rem; margin-bottom: 1rem; display: block; }
.feature-card h4 { margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* === Case Studies === */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.case-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); transition: var(--transition);
}
.case-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.case-card-image { height: 200px; background: var(--bg-light); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.case-card-image img { width: 100%; height: 100%; object-fit: cover; }
.case-card-body { padding: 20px; }
.case-card-date { font-size: 0.8rem; color: var(--text-light); margin-bottom: 6px; display: block; }
.case-card-body h3 { font-size: 1.05rem; margin-bottom: 8px; }
.case-card-body p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* === Contact Page === */
.contact-section { margin-top: 72px; padding: 80px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info-card { padding: 30px; background: var(--bg-light); border-radius: var(--radius); border: 1px solid var(--border); }
.contact-info-card h3 { margin-bottom: 1rem; }
.contact-info-item { display: flex; gap: 12px; margin-bottom: 16px; align-items: flex-start; }
.contact-info-item img { width: 20px; height: 20px; flex-shrink: 0; margin-top: 4px; }
.contact-info-item div { flex: 1; }
.contact-info-item strong { display: block; font-size: 0.85rem; color: var(--text-light); margin-bottom: 2px; }
.contact-info-item span { font-size: 0.95rem; color: var(--text-dark); }

.contact-form { padding: 30px; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); }
.contact-form h3 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; color: var(--text-dark); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--font-main); font-size: 0.95rem;
  transition: var(--transition); background: var(--bg-light);
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,58,92,0.1); }
.form-group textarea { min-height: 120px; resize: vertical; }

/* === Page Header === */
.page-header {
  margin-top: 72px; padding: 60px 0 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  text-align: center;
}
.page-header h1 { color: var(--white); }
.page-header p { color: rgba(255,255,255,0.75); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }

/* === Products Overview Page === */
.product-category-section { padding: 60px 0; }
.product-category-section:nth-child(even) { background: var(--bg-light); }

/* === Back to Top === */
.back-to-top {
  position: fixed; bottom: 30px; right: 30px; z-index: 999;
  width: 44px; height: 44px; background: var(--primary); color: var(--white);
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* === Footer === */
.site-footer {
  background: var(--primary-dark); color: rgba(255,255,255,0.7);
  padding: 60px 0 30px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand .logo img { height: 36px; }
.footer-brand .logo span { color: var(--white); }
.footer-brand p { font-size: 0.9rem; color: rgba(255,255,255,0.5); margin-top: 12px; }
.footer-col h4 { color: var(--white); margin-bottom: 1rem; font-size: 1rem; }
.footer-col a { display: block; padding: 4px 0; font-size: 0.9rem; color: rgba(255,255,255,0.55); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.35); }

/* === Breadcrumb === */
.breadcrumb { padding: 12px 0; font-size: 0.85rem; color: var(--text-light); background: var(--bg-light); }
.breadcrumb a { color: var(--text-mid); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; }

/* === Responsive === */
@media (max-width: 968px) {
  .product-detail-header { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .case-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0;
    background: var(--white); flex-direction: column; padding: 20px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%); opacity: 0; transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-links a { width: 100%; padding: 12px; }
  .hero { min-height: 70vh; }
  .hero-content { text-align: center; }
  .hero-actions { justify-content: center; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 50px 0; }
}

/* === Utility === */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-2 { gap: 0.5rem; display: flex; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 50px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-green { background: rgba(46,139,87,0.1); color: var(--secondary); }
.badge-blue { background: rgba(26,58,92,0.1); color: var(--primary); }

/* Lightbox */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.9); justify-content: center; align-items: center;
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox-close {
  position: absolute; top: 20px; right: 30px; color: white;
  font-size: 2rem; cursor: pointer; background: none; border: none;
  font-family: var(--font-main);
}
