/* ============================================
   SAWATEC China - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
  --primary: #1F4E79;
  --primary-dark: #163a5c;
  --primary-light: #2a6da8;
  --accent: #e8792f;
  --white: #ffffff;
  --light-gray: #f5f7fa;
  --mid-gray: #e0e4e8;
  --text-dark: #2c3e50;
  --text-light: #6c7a89;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --transition: all 0.3s ease;
  --radius: 8px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

a:hover {
  color: var(--accent);
}

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

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
}

.logo img {
  height: 40px;
}

.logo span.sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-light);
  display: block;
  letter-spacing: 0;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-menu li a {
  padding: 8px 14px;
  font-size: 0.9rem;
  color: var(--text-dark);
  border-radius: var(--radius);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  background: var(--primary);
  color: var(--white);
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

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

/* ============================================
   Hero Section
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.02);
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero .hero-sub {
  font-size: 1rem;
  opacity: 0.7;
  margin-top: 8px;
}

.hero-small {
  padding: 120px 0 50px;
}

.hero-small h1 {
  font-size: 2.2rem;
}

/* ============================================
   Section Styles
   ============================================ */
.section {
  padding: 80px 0;
}

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

.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0 auto;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 16px auto 0;
  border-radius: 2px;
}

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

.card-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: var(--transition);
}

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

.card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--light-gray);
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.card-body p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ============================================
   Products Page
   ============================================ */
.product-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}

.product-categories .cat-btn {
  padding: 10px 24px;
  border: 2px solid var(--primary);
  border-radius: 50px;
  background: transparent;
  color: var(--primary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.product-categories .cat-btn:hover,
.product-categories .cat-btn.active {
  background: var(--primary);
  color: var(--white);
}

.product-section {
  margin-bottom: 60px;
  display: none;
}

.product-section.active {
  display: block;
}

.product-section h2 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--mid-gray);
}

.product-section > p {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 1rem;
}

.product-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  overflow: hidden;
}

.product-item-header {
  background: var(--primary);
  color: var(--white);
  padding: 16px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.product-item-header:hover {
  background: var(--primary-dark);
}

.product-item-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.product-item-header .toggle-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.product-item-header.open .toggle-icon {
  transform: rotate(180deg);
}

.product-item-body {
  display: none;
  padding: 24px;
}

.product-item-body.open {
  display: block;
}

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.product-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.product-images img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  background: var(--light-gray);
}

.product-images img:hover {
  transform: scale(1.05);
}

.product-images img:first-child {
  grid-column: 1 / -1;
  height: 240px;
}

.product-info h4 {
  color: var(--primary);
  font-size: 1.1rem;
  margin: 20px 0 10px;
}

.product-info h4:first-child {
  margin-top: 0;
}

.product-info p {
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.7;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  color: var(--text-light);
  font-size: 0.95rem;
}

.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.spec-table th,
.spec-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--mid-gray);
  font-size: 0.9rem;
}

.spec-table th {
  background: var(--light-gray);
  color: var(--primary);
  font-weight: 600;
}

.btn-contact {
  display: inline-block;
  padding: 10px 28px;
  background: var(--accent);
  color: var(--white);
  border-radius: 50px;
  font-size: 0.95rem;
  margin-top: 16px;
  transition: var(--transition);
}

.btn-contact:hover {
  background: #d06a25;
  color: var(--white);
  transform: translateY(-2px);
}

/* ============================================
   Markets Page
   ============================================ */
.market-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.market-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  transition: var(--transition);
  border-left: 4px solid var(--primary);
}

.market-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--accent);
}

.market-card h3 {
  color: var(--primary);
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.market-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.7;
}

.market-card .market-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================
   Timeline (Company)
   ============================================ */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--mid-gray);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 40px;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-content {
  width: 45%;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-right: auto;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: auto;
}

.timeline-year {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 1;
}

.timeline-content h4 {
  color: var(--primary);
  margin-bottom: 8px;
}

.timeline-content p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.timeline-content img {
  width: 100%;
  border-radius: 6px;
  margin-top: 10px;
}

/* ============================================
   Company Info Boxes
   ============================================ */
.info-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 24px;
}

.info-box h3 {
  color: var(--primary);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.info-box p {
  color: var(--text-light);
  line-height: 1.8;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.contact-info {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px;
}

.contact-info h3 {
  font-size: 1.4rem;
  margin-bottom: 24px;
}

.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.contact-item .icon {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
}

.contact-item .detail h4 {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.contact-item .detail p {
  font-size: 1rem;
}

.contact-item .detail a {
  color: var(--white);
  opacity: 0.9;
}

.contact-item .detail a:hover {
  opacity: 1;
}

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px;
}

.contact-form h3 {
  color: var(--primary);
  margin-bottom: 24px;
  font-size: 1.4rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--mid-gray);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31,78,121,0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  display: inline-block;
  padding: 12px 40px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ============================================
   Support Page
   ============================================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card .icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.service-card h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.service-card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ============================================
   News Page
   ============================================ */
.news-list {
  max-width: 800px;
  margin: 0 auto;
}

.news-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  transition: var(--transition);
  border-left: 4px solid var(--primary);
}

.news-item:hover {
  box-shadow: var(--shadow-lg);
}

.news-date {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.news-item h3 {
  color: var(--primary);
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.news-item p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ============================================
   Career Page
   ============================================ */
.career-placeholder {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.career-placeholder .icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.career-placeholder h3 {
  color: var(--primary);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.career-placeholder p {
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   Quote / Testimonial
   ============================================ */
.testimonial {
  background: var(--primary);
  color: var(--white);
  padding: 60px 0;
  text-align: center;
}

.testimonial blockquote {
  font-size: 1.3rem;
  font-style: italic;
  max-width: 700px;
  margin: 0 auto 20px;
  line-height: 1.8;
}

.testimonial cite {
  font-size: 1rem;
  opacity: 0.8;
}

/* ============================================
   Stats Section
   ============================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item .number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

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

/* ============================================
   Partner Logos
   ============================================ */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.partner-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: var(--transition);
}

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

.partner-card h4 {
  color: var(--primary);
  margin-bottom: 8px;
  font-size: 1rem;
}

.partner-card p {
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 50px 0 30px;
}

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

.footer h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

.footer p, .footer li {
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.8;
}

.footer ul {
  list-style: none;
}

.footer ul li a {
  color: var(--white);
  opacity: 0.7;
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ============================================
   Lightbox (Image Modal)
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .card-grid-3, .card-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(even) {
    flex-direction: column;
    padding-left: 50px;
  }

  .timeline-content {
    width: 100%;
  }

  .timeline-year {
    left: 20px;
    transform: translateX(-50%);
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section {
    padding: 50px 0;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .nav-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    gap: 4px;
  }

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

  .nav-menu li a {
    display: block;
    padding: 12px 16px;
  }

  .mobile-toggle {
    display: flex;
  }

  .card-grid,
  .card-grid-3,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

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

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

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

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

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

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

  .product-images {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-images img:first-child {
    height: 180px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 110px 0 60px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .stat-item .number {
    font-size: 2rem;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}
