:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-lighter: #eff6ff;
  --primary-dark: #1e40af;
  --secondary: #7c3aed;
  --accent: #06b6d4;
  --accent-light: #cffafe;
  --gradient-main: linear-gradient(135deg, #2563eb, #7c3aed);
  --gradient-main-alt: linear-gradient(135deg, #2563eb, #06b6d4);
  --gradient-hero: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  --gradient-cta: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-section: linear-gradient(180deg, #f0f4ff 0%, #f8fafc 50%, #f0f4ff 100%);
  --gradient-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --bg-body: #ffffff;
  --bg-section: #f8fafc;
  --bg-alt: #f1f5f9;
  --bg-dark: #0f172a;
  --bg-dark-2: #1e293b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --secondary-bg: #f0f4ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 24px -6px rgba(0,0,0,.1), 0 4px 8px -6px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 36px -8px rgba(0,0,0,.12), 0 8px 12px -6px rgba(0,0,0,.06);
  --shadow-card: 0 2px 8px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); color: var(--text-primary); line-height: 1.7; font-size: 15px; -webkit-font-smoothing: antialiased; background: var(--bg-body); overflow-x: hidden; }

::selection { background: var(--primary); color: #fff; }

a { color: var(--primary); text-decoration: none; transition: all .25s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }
video { max-width: 100%; height: auto; }
table { max-width: 100%; display: block; overflow-x: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-break: break-all; }
ul, ol { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-alt { background: var(--gradient-section); }
.section-title { text-align: center; font-size: 32px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.5px; position: relative; }
.section-title::after { content: ''; display: block; width: 48px; height: 3px; background: var(--gradient-main); border-radius: 2px; margin: 16px auto 0; }
.section-subtitle { text-align: center; color: var(--text-secondary); font-size: 16px; margin-bottom: 56px; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.7; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 28px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; cursor: pointer; transition: all .3s; border: none; line-height: 1.4; position: relative; overflow: hidden; }
.btn-primary { background: var(--gradient-main); color: #fff; }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,.3); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f1f5f9; color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.btn-lg { padding: 14px 36px; font-size: 16px; }
.btn-sm { padding: 8px 18px; font-size: 13px; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden; transition: all .35s cubic-bezier(.4,0,.2,1); border: 1px solid var(--border); }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: var(--primary-light); }

.tag { display: inline-block; padding: 4px 14px; background: var(--primary-lighter); color: var(--primary); border-radius: 20px; font-size: 12px; font-weight: 500; }

/* ===== Header ===== */
/* ===== Header (mobile-first: hamburger visible, nav hidden) ===== */
header { background: #fff; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 9999; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 50px; padding: 0 14px; padding-top: env(safe-area-inset-top, 0px); }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.logo img { height: 30px; width: auto; }
.logo span { background: var(--gradient-hero); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; font-weight: 800; font-size: 17px; }

/* Hamburger: visible by default */
.menu-toggle { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1.5px solid #d0d0d0; border-radius: 6px; background: #fafafa; cursor: pointer; flex-shrink: 0; }
.menu-toggle:active { background: #eee; }
.menu-toggle span { display: block; width: 20px; height: 2.5px; background: #444; position: relative; border-radius: 1px; }
.menu-toggle span::before, .menu-toggle span::after { content: ''; position: absolute; left: 0; width: 20px; height: 2.5px; background: #444; border-radius: 1px; }
.menu-toggle span::before { top: -7px; }
.menu-toggle span::after { top: 7px; }

/* Nav dropdown */
header nav { display: none; position: absolute; top: 50px; left: 0; right: 0; background: #fff; box-shadow: 0 8px 32px rgba(0,0,0,.12); z-index: 9998; max-height: calc(100vh - 50px); overflow-y: auto; }
header nav.open { display: block; }
nav ul { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
nav a { display: block; padding: 14px 20px; color: var(--text-secondary); font-size: 16px; font-weight: 500; border-bottom: 1px solid #f2f2f2; text-decoration: none; -webkit-tap-highlight-color: rgba(37,99,235,.1); }
nav a:last-child { border-bottom: none; }
nav a:active { color: var(--primary); background: var(--primary-lighter); }
nav a.active { color: var(--primary); background: var(--primary-lighter); font-weight: 600; }

/* Body padding for iOS safe area */
body { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* Product detail layout defaults */
.product-layout { display: flex; gap: 32px; margin-top: 24px; }
.product-sidebar { width: 200px; flex-shrink: 0; position: sticky; top: 80px; align-self: flex-start; }
.product-content { flex: 1; min-width: 0; }
.product-header { display: flex; gap: 32px; flex-wrap: wrap; }
.product-gallery { flex: 1 1 360px; max-width: 520px; min-width: 280px; }
.product-meta { flex: 1; min-width: 280px; }

/* ---- Mobile layout (≤1024px) ---- */
@media (max-width: 1024px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 14px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { width: 100%; text-align: center; justify-content: center; }
  .section { padding: 36px 0; }
  .section-title { font-size: 22px; }
  .page-hero { padding: 32px 0 28px; }
  .page-hero h1 { font-size: 22px; }
  .container { padding: 0 16px; }
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .solutions-grid, .cases-grid, .news-grid { grid-template-columns: 1fr !important; }
  .features-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-detail { display: flex !important; flex-direction: column; gap: 24px; }
  .product-layout { flex-direction: column !important; gap: 16px; }
  .product-sidebar { width: 100% !important; position: static !important; top: auto; }
  .product-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 8px; }
  .product-nav-item { white-space: nowrap; flex-shrink: 0; }
  .product-header { flex-direction: column !important; gap: 16px; }
  .product-content { min-width: 100%; }
  .product-gallery { flex: 1 1 auto !important; max-width: 100% !important; min-width: 0 !important; }
  .product-meta { min-width: 0 !important; flex: 1 1 auto; }
  .contact-grid { grid-template-columns: 1fr !important; }
  .doc-item { flex-direction: column; align-items: stretch; gap: 12px; }
  .doc-item .btn { width: 100%; text-align: center; }
  .search-box form { flex-direction: column; gap: 8px; }
  .search-box input, .search-box button { width: 100%; }
}
@media (max-width: 768px) {
  html { font-size: 14px; }
  .hero { min-height: 320px; }
  .hero h1 { font-size: 24px; }
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr; }
  .product-card .card-img { height: 160px; }
  .product-gallery .main-image { height: 220px; }
  input, textarea, select { font-size: 16px !important; }
}

/* Desktop: hide hamburger, show nav inline */
@media (min-width: 1025px) {
  header { background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(226,232,240,.6); }
  .header-inner { height: 72px; padding: 0 24px; }
  .logo img { height: 36px; }
  .logo span { font-size: 20px; }
  .menu-toggle { display: none; }
  header nav { display: block; position: static; box-shadow: none; background: transparent; }
  nav ul { flex-direction: row; gap: 2px; padding: 0; }
  nav a { display: block; padding: 8px 18px; font-size: 14px; border-bottom: none; border-radius: var(--radius-sm); position: relative; }
  nav a.active::after { content: ''; position: absolute; bottom: 2px; left: 18px; right: 18px; height: 2px; background: var(--gradient-main); border-radius: 1px; }
}

/* ===== Footer ===== */
footer { background: var(--bg-dark); color: #fff; padding: 64px 0 0; position: relative; }
footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-main); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand h3 { font-size: 20px; margin-bottom: 16px; background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-brand p { color: #94a3b8; font-size: 14px; line-height: 1.8; max-width: 360px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 20px; color: #f1f5f9; text-transform: uppercase; letter-spacing: .5px; position: relative; padding-bottom: 12px; }
.footer-col h4::after { content: ''; position: absolute; bottom: 0; left: 0; width: 24px; height: 2px; background: var(--gradient-main); border-radius: 1px; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col a { color: #94a3b8; font-size: 14px; transition: all .25s; display: inline-block; }
.footer-col a:hover { color: #fff; transform: translateX(4px); }
.footer-col li { color: #94a3b8; font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 24px 0; text-align: center; color: #64748b; font-size: 13px; }

.breadcrumb { padding: 20px 0; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--border); }

.page-hero { background: var(--gradient-hero); color: #fff; padding: 72px 0 80px; text-align: center; position: relative; overflow: hidden; }
.page-hero::before { content: ''; position: absolute; inset: 0; background: url('/templates/hardware_tech/assets/images/tech/hero-pattern.svg') repeat; opacity: .04; }
.page-hero::after { content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px; background: radial-gradient(circle, rgba(59,130,246,.1) 0%, transparent 70%); }
.page-hero h1 { font-size: 38px; font-weight: 800; margin-bottom: 14px; position: relative; letter-spacing: -.5px; }
.page-hero p { color: #94a3b8; font-size: 16px; position: relative; max-width: 560px; margin: 0 auto; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; transition: all .25s; }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-1px); }
.pagination .active { background: var(--gradient-main); color: #fff; border-color: var(--primary); font-weight: 600; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-section); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ===== Animations ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-fade-up { animation: fadeUp .6s ease-out forwards; }
.animate-fade-in { animation: fadeIn .6s ease-out forwards; }