/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 93.75%; scroll-behavior: smooth; }
body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem; line-height: 1.6; color: #4B4F58; background: #fff;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4,h5,h6 { color: #3a3a3a; font-family: 'Montserrat', sans-serif; }

/* ========== LANGUAGE TOGGLE ========== */
html.lang-en .lang-zh { display: none; }
html.lang-zh .lang-en { display: none; }
html.lang-zh body { font-family: 'Noto Sans SC', 'Roboto', sans-serif; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }


/* ========== BUTTONS ========== */
.btn {
  display: inline-block; padding: 13px 34px; border-radius: 4px;
  font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.5px; transition: all 0.3s ease; cursor: pointer;
}
.btn-primary {
  background: #2e7d32; color: #fff; border: 2px solid #2e7d32;
}
.btn-primary:hover { background: #1b5e20; border-color: #1b5e20; }
.btn-outline {
  background: transparent; color: #2e7d32; border: 2px solid #2e7d32;
}
.btn-outline:hover { background: #2e7d32; color: #fff; }


/* ========== HEADER ========== */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  transition: background-color 0.3s, box-shadow 0.3s;
  background: transparent;
}
.site-header.scrolled {
  background: rgba(255,255,255,0.97);
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}
.site-header.scrolled .nav-link { color: #3a3a3a; }
.site-header.scrolled .nav-link:hover { color: #2e7d32; }
.site-header.scrolled .header-cta {
  background: #2e7d32; color: #fff; border-color: #2e7d32;
}
.site-header.scrolled .header-cta:hover {
  background: #1b5e20; border-color: #1b5e20;
}
.site-header.scrolled .menu-toggle .bar { background: #3a3a3a; }

.header-container {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 70px;
}
.logo-img { max-width: 130px; height: auto; }

.nav-menu { list-style: none; display: flex; align-items: center; }
.nav-link {
  display: block; padding: 24px 20px; color: #fff;
  font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.5px; transition: color 0.3s;
}
.nav-link:hover { color: rgba(255,255,255,0.7); }

.lang-toggle {
  padding: 6px 14px; border: 1.5px solid #fff; border-radius: 4px;
  background: transparent; color: #fff;
  font-family: 'Poppins', sans-serif; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s; letter-spacing: 0.5px;
}
.lang-toggle:hover { background: #fff; color: #2e7d32; }
.site-header.scrolled .lang-toggle { border-color: #2e7d32; color: #2e7d32; }
.site-header.scrolled .lang-toggle:hover { background: #2e7d32; color: #fff; }

.header-cta {
  display: inline-block; padding: 8px 24px; border: 2px solid #fff;
  border-radius: 4px; color: #fff; font-family: 'Poppins', sans-serif;
  font-size: 0.85rem; font-weight: 600; transition: all 0.3s;
}
.header-cta:hover { background: #fff; color: #2e7d32; }

.menu-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 10px; flex-direction: column; gap: 5px;
}
.menu-toggle .bar {
  display: block; width: 24px; height: 3px; background: #fff;
  border-radius: 2px; transition: all 0.3s;
}
.menu-toggle.active .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }


/* ========== HERO ========== */
.hero {
  position: relative; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(135deg, #0a1628 0%, #122a1a 50%, #1a3a2a 100%);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(46,125,50,0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(27,94,32,0.15) 0%, transparent 50%);
  z-index: 1;
}
.hero-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,0.3); z-index: 2;
}
.hero-content {
  position: relative; z-index: 3; padding: 20px; max-width: 800px;
}
.hero-label {
  font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 500;
  color: #81c784; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 16px;
}
.hero-title {
  font-size: 3rem; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 20px;
}
.hero-desc {
  font-family: 'Poppins', sans-serif; font-size: 1.05rem;
  color: rgba(255,255,255,0.8); line-height: 1.6; margin-bottom: 30px;
}
.hero-arrow {
  margin-top: 40px; font-size: 1.5rem; color: rgba(255,255,255,0.5);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%,20%,50%,80%,100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}


/* ========== SECTIONS ========== */
.section { padding: 5em 0; }
.section-label {
  text-align: center; font-family: 'Poppins', sans-serif;
  font-size: 0.85rem; font-weight: 600; color: #2e7d32;
  text-transform: uppercase; letter-spacing: 3px; margin-bottom: 10px;
}
.section-label.light { color: #81c784; }

.section-title {
  text-align: center; font-size: 2.2rem; font-weight: 700;
  color: #3a3a3a; margin-bottom: 1.2em;
}
.section-title::after {
  content: ''; display: block; width: 60px; height: 3px;
  background: #2e7d32; margin: 15px auto 0;
}
.section-title.light { color: #fff; }
.section-title.light::after { background: rgba(255,255,255,0.5); }

.section-subtitle {
  text-align: center; max-width: 800px; margin: -0.5em auto 2em;
  font-size: 1rem; color: #666; line-height: 1.7;
}


/* ========== ABOUT ========== */
.about { background: #fff; }
.about-text {
  max-width: 800px; margin: 0 auto 2em; text-align: center;
  font-size: 1.05rem; line-height: 1.8;
}
.about-text p { margin-bottom: 1.2em; }
.about-text strong { color: #3a3a3a; }
.about .btn { display: block; margin: 0 auto; width: fit-content; }


/* ========== PRODUCTS — flexible auto-fit grid ========== */
.products { background: #f5f7f5; }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 2em;
}

.product-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 15px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.product-image {
  width: 100%; aspect-ratio: 4/3; overflow: hidden; background: #f0f0f0;
}
.product-image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.product-card:hover .product-image img { transform: scale(1.05); }

.placeholder-img {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); gap: 8px;
}
.placeholder-img span { font-size: 3rem; }
.placeholder-img small {
  font-family: 'Poppins', sans-serif; font-size: 0.8rem;
  letter-spacing: 1px; text-transform: uppercase;
}

.product-content { padding: 24px; }
.product-content h3 {
  font-family: 'Poppins', sans-serif; font-size: 1.15rem;
  font-weight: 600; color: #3a3a3a; margin-bottom: 10px;
}
.product-content p { font-size: 0.9rem; color: #666; line-height: 1.6; }


/* ========== WHY EARTHX ========== */
.why-section {
  background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 3em;
}

.stat-card {
  text-align: center;
  padding: 30px 15px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
}
.stat-number {
  font-family: 'Montserrat', sans-serif; font-size: 2.8rem;
  font-weight: 800; color: #fff; line-height: 1;
}
.stat-unit {
  font-family: 'Poppins', sans-serif; font-size: 0.9rem;
  color: #81c784; margin-bottom: 8px;
}
.stat-card p {
  font-family: 'Poppins', sans-serif; font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.advantage-item { text-align: center; padding: 20px; }
.advantage-icon { font-size: 2.5rem; margin-bottom: 15px; }
.advantage-item h4 {
  font-family: 'Poppins', sans-serif; font-size: 1.1rem;
  font-weight: 600; color: #fff; margin-bottom: 10px;
}
.advantage-item p {
  font-size: 0.9rem; color: rgba(255,255,255,0.8); line-height: 1.6;
}


/* ========== CTA ========== */
.cta-section { background: #f5f7f5; text-align: center; padding: 4em 0; }
.cta-section h3 {
  font-size: 1.8rem; font-weight: 700; color: #3a3a3a;
  margin-bottom: 0.6em; max-width: 650px; margin-left: auto; margin-right: auto;
}
.cta-desc {
  font-size: 1rem; color: #666; max-width: 550px;
  margin: 0 auto 1.5em; line-height: 1.6;
}


/* ========== CONTACT ========== */
.contact { background: #fff; }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-item {
  display: flex; gap: 15px; margin-bottom: 24px; align-items: flex-start;
}
.contact-icon { font-size: 1.4rem; margin-top: 2px; }
.contact-item strong {
  font-family: 'Poppins', sans-serif; font-size: 0.95rem;
  display: block; margin-bottom: 4px; color: #3a3a3a;
}
.contact-item p { font-size: 0.9rem; color: #666; line-height: 1.5; }

/* ── Distributor Contact Form ── */
.contact-form-wrapper { width: 100%; }

.distributor-form { display: flex; flex-direction: column; gap: 18px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
  font-family: 'Poppins', sans-serif; font-size: 0.82rem;
  font-weight: 600; color: #3a3a3a; letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1.5px solid #d8dbd8; border-radius: 6px;
  font-family: 'Roboto', sans-serif; font-size: 0.9rem; color: #4B4F58;
  background: #fff; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: #b0b4b0; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

.form-group select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232e7d32' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }

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

.checkbox-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 12px 14px;
  border: 1.5px solid #d8dbd8; border-radius: 6px; background: #fff;
}

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Roboto', sans-serif; font-size: 0.9rem; color: #4B4F58;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #2e7d32; cursor: pointer;
  flex-shrink: 0;
}

.form-submit { align-self: flex-start; }

.form-note {
  font-family: 'Poppins', sans-serif; font-size: 0.78rem;
  color: #999; margin-top: -6px;
}


/* ========== FOOTER ========== */
.site-footer { background: #1a1a1a; color: #fff; padding: 40px 0 20px; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start;
}
.footer-logo { max-width: 200px; margin-bottom: 10px; }
.footer-info h4 {
  font-family: 'Poppins', sans-serif; font-size: 1rem;
  font-weight: 600; color: #fff; margin-bottom: 8px;
}
.footer-info p { font-size: 0.9rem; color: rgba(255,255,255,0.7); line-height: 1.6; }
.footer-bottom {
  grid-column: 1 / -1; text-align: center; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-bottom p { font-size: 0.85rem; color: rgba(255,255,255,0.5); }


/* ========== PRODUCT MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-panel {
  background: #fff; border-radius: 12px;
  max-width: 720px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  padding: 36px 32px;
  position: relative;
}

.modal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; font-size: 2rem;
  color: #aaa; cursor: pointer; line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover { color: #3a3a3a; }

.modal-title {
  font-family: 'Poppins', sans-serif; font-size: 1.3rem;
  font-weight: 600; color: #3a3a3a; margin-bottom: 24px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}
.modal-grid:has(.modal-section) {
  display: block;
}

.modal-section { margin-bottom: 24px; }
.modal-section:last-child { margin-bottom: 0; }
.modal-section-label {
  font-family: 'Poppins', sans-serif; font-size: 0.9rem;
  font-weight: 600; color: #2e7d32; text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid #eee;
}
.modal-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}
.modal-empty {
  color: #999; font-family: 'Poppins', sans-serif; font-size: 0.9rem;
}

.modal-item { text-align: center; }
.modal-item img {
  width: 100%; aspect-ratio: 1/1; object-fit: contain;
  border-radius: 8px; margin-bottom: 8px;
  background: #f5f5f5;
}
.modal-item-name {
  font-family: 'Poppins', sans-serif; font-size: 0.82rem;
  font-weight: 500; color: #4B4F58;
}
.modal-item-specs {
  list-style: none; padding: 0; margin: 4px 0 0;
  font-family: 'Roboto', sans-serif; font-size: 0.75rem;
  color: #888; line-height: 1.5;
}


/* ========== SCROLL TO TOP ========== */
.scroll-top {
  position: fixed; bottom: 30px; right: 30px;
  width: 46px; height: 46px; border-radius: 50%;
  border: none; background: #2e7d32; color: #fff;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  box-shadow: 0 3px 15px rgba(0,0,0,0.2); z-index: 999;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-3px); background: #1b5e20; }


/* ========== RESPONSIVE ========== */
@media (max-width: 921px) {
  .menu-toggle { display: flex; }
  .header-cta { display: none; }

  .main-nav {
    position: fixed; top: 70px; left: 0; right: 0;
    background: #fff; max-height: 0; overflow: hidden;
    transition: max-height 0.4s; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .main-nav.open { max-height: 80vh; overflow-y: auto; }

  .nav-menu { flex-direction: column; align-items: stretch; padding: 10px 0; }
  .nav-link {
    color: #3a3a3a; padding: 14px 24px;
    border-bottom: 1px solid #f0f0f0;
  }
  .nav-link:hover { background: #f5f5f5; color: #2e7d32; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages-grid { grid-template-columns: 1fr; gap: 20px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }

  .hero-title { font-size: 2.2rem; }
  .section-title { font-size: 1.8rem; }
}

@media (max-width: 544px) {
  html { font-size: 85.5%; }
  .hero-title { font-size: 1.8rem; }
  .hero-label { font-size: 0.75rem; letter-spacing: 2px; }
  .section { padding: 3em 0; }
  .section-title { font-size: 1.5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-number { font-size: 2rem; }
  .scroll-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
