/* ============================================
   HICHIP Corp Website - Global Styles
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

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

ul, ol {
  list-style: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* ============================================
   Language Switching (CSS-driven, no-JS required)
   ============================================ */
.lang-zh, .lang-en { display: none !important; }
html[data-lang="zh"] .lang-zh { display: block !important; }
html[data-lang="en"] .lang-en { display: block !important; }

/* Inline spans need inline display */
html[data-lang="zh"] span.lang-zh,
html[data-lang="en"] span.lang-en { display: inline !important; }

/* ============================================
   Header / Navigation
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.logo img {
  height: 40px;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-desktop a {
  font-size: 15px;
  color: #333;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: #00a0e9;
}

.nav-desktop .has-dropdown {
  position: relative;
}

.nav-desktop .has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #666;
  margin-left: 6px;
  vertical-align: middle;
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  padding: 10px 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  white-space: nowrap;
}

.dropdown a:hover {
  background: #f5f5f5;
}

.lang-switcher {
  position: relative;
}

.lang-switcher select {
  appearance: none;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 28px 6px 12px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

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

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  transition: all 0.3s;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 999;
  padding: 20px;
  overflow-y: auto;
}

.mobile-nav.active {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 14px 0;
  font-size: 16px;
  border-bottom: 1px solid #eee;
  color: #333;
}

.mobile-nav a.active {
  color: #00a0e9;
}

.mobile-dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-dropdown {
  padding-left: 15px;
  display: none;
}

.mobile-dropdown.open {
  display: block;
}

.mobile-dropdown a {
  font-size: 14px;
  color: #666;
  padding: 10px 0;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none;
  }
  .hamburger {
    display: flex;
  }
  .header-inner {
    height: 60px;
  }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: #1a1a2e;
  color: #aaa;
  padding: 60px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand img {
  height: 36px;
  margin-bottom: 16px;
}

.footer-brand h4 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
  color: #888;
}

.footer-col h5 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #00a0e9;
  display: inline-block;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: #888;
  padding: 6px 0;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #00a0e9;
}

.footer-bottom {
  border-top: 1px solid #333;
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: #666;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 30px 20px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ============================================
   Scroll to top button
   ============================================ */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: #00a0e9;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: #0088cc;
}

/* ============================================
   Page title sections (common)
   ============================================ */
.page-hero {
  padding: 140px 0 60px;
  background-size: cover;
  background-position: center;
  color: #fff;
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  font-size: 42px;
  font-weight: 700;
}

.page-hero p {
  font-size: 18px;
  margin-top: 10px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .page-hero {
    padding: 100px 0 40px;
  }
  .page-hero h1 {
    font-size: 28px;
  }
}

/* ============================================
   Section titles
   ============================================ */
.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
}

.section-title .line {
  width: 50px;
  height: 3px;
  background: #00a0e9;
  margin: 0 auto;
}

.section-title p {
  font-size: 15px;
  color: #666;
  margin-top: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 768px) {
  .section-title h2 {
    font-size: 24px;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #00a0e9;
  color: #fff;
}

.btn-primary:hover {
  background: #0088cc;
}

.btn-outline {
  background: transparent;
  color: #00a0e9;
  border: 1px solid #00a0e9;
}

.btn-outline:hover {
  background: #00a0e9;
  color: #fff;
}
