/* ============================================
   XINSEN WPC Website Stylesheet
   ============================================ */

:root {
  --primary: #1a5c3a;
  --primary-light: #2d8a57;
  --primary-dark: #0f3d26;
  --accent: #c8922a;
  --accent-light: #e0a93d;
  --dark: #0f1f16;
  --text: #1a2e22;
  --text-light: #5a6e60;
  --bg: #f8faf8;
  --white: #ffffff;
  --gray-50: #f5f7f5;
  --gray-100: #e8ede9;
  --gray-200: #d0dbd4;
  --gray-300: #a8bdb0;
  --border: #d0dbd4;
  --shadow: 0 2px 16px rgba(15, 61, 38, 0.08);
  --shadow-lg: 0 8px 40px rgba(15, 61, 38, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; line-height: 1.15; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 600; }
p { font-size: 0.95rem; color: var(--text-light); }
.section-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.section-desc { font-size: 1rem; color: var(--text-light); max-width: 680px; margin-bottom: 40px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { margin-bottom: 12px; }
.section-header .section-desc { margin: 0 auto 0; text-align: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius); font-weight: 600;
  font-size: 0.95rem; text-decoration: none; transition: var(--transition); cursor: pointer; border: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.cta-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.logo { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.logo-text { font-size: 1.3rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.logo-sub { font-size: 0.65rem; color: var(--text-light); font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text); font-size: 0.92rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { background: var(--gray-50); color: var(--primary); }
.btn-nav { background: var(--primary) !important; color: #fff !important; padding: 8px 18px !important; }
.btn-nav:hover { background: var(--primary-dark) !important; }
.lang-btn {
  background: var(--gray-100); color: var(--text); border: none;
  padding: 7px 14px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--text); }
.mobile-menu { display: none; flex-direction: column; background: #fff; border-top: 1px solid var(--gray-100); padding: 12px; }
.mobile-menu a { padding: 12px 16px; text-decoration: none; color: var(--text); font-size: 1rem; border-radius: 8px; }

/* ── Page Header ── */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: #fff; padding: 64px 0 56px; text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header h1 { color: #fff; margin-bottom: 12px; position: relative; }
.page-header p { color: rgba(255,255,255,0.8); font-size: 1.05rem; position: relative; }
.page-header .section-label { color: var(--accent-light); }

/* ── Sections ── */
.section { padding: 72px 0; }
.section-divider { border-top: 1px solid var(--gray-100); }
.cta-section { background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; text-align: center; padding: 72px 0; }
.cta-section h2 { color: #fff; margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.82); font-size: 1.05rem; }

/* ── CAROUSEL ── */
.carousel-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  background: var(--dark);
  box-shadow: var(--shadow-lg);
  max-height: 480px;
}
.carousel-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  height: 480px;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
  overflow: hidden;
}
.carousel-slide img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  object-position: center;
  display: block;
}
.carousel-slide .slide-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 48px 40px 32px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
}
.carousel-slide .slide-overlay h3 {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 6px; color: #fff;
}
.carousel-slide .slide-overlay p {
  font-size: 0.9rem; color: rgba(255,255,255,0.8); margin: 0;
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.92); border: none; width: 44px; height: 44px;
  border-radius: 50%; font-size: 1.2rem; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition); color: var(--primary); font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.carousel-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.carousel-arrow.prev { left: 16px; }
.carousel-arrow.next { right: 16px; }
.carousel-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.carousel-dot {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.45);
  border: none; cursor: pointer; transition: var(--transition); padding: 0;
}
.carousel-dot.active { background: #fff; transform: scale(1.3); }
.carousel-thumb-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.carousel-thumb {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  opacity: 0.65;
  transition: var(--transition);
  border: 2px solid transparent;
}
.carousel-thumb.active { opacity: 1; border-color: var(--primary); }
.carousel-thumb:hover { opacity: 1; }
.carousel-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Products Grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.product-img {
  /* 统一 aspect-ratio 4/3，图片不变形 */
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--gray-100);
  display: block;
  flex-shrink: 0;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.product-card:hover .product-img img { transform: scale(1.04); }
.product-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-body h3 {
  font-size: 0.95rem; margin-bottom: 8px; color: var(--text);
}
.product-body p {
  font-size: 0.85rem; margin-bottom: 12px; flex: 1; line-height: 1.5;
}
.product-specs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto;
}
.spec-tag {
  font-size: 0.72rem; font-weight: 600;
  background: var(--gray-50); color: var(--text);
  padding: 4px 9px; border-radius: 20px;
  border: 1px solid var(--gray-200);
  white-space: nowrap;
}

/* ── Gallery Grid (legacy, fallback) ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--gray-100);
  cursor: pointer;
  transition: var(--transition);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

/* ── Lightbox ── */
.lightbox { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.92); align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 85vh; object-fit: contain; border-radius: 12px; }
.lightbox-close { position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 1.8rem; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }

/* ── Footer ── */
.footer { background: var(--dark); color: rgba(255,255,255,0.7); padding: 60px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 12px; letter-spacing: -0.02em; }
.footer-addr { font-size: 0.82rem; margin-top: 8px; }
.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #fff; margin-bottom: 16px; }
.footer-col a { display: block; color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.88rem; padding: 5px 0; transition: var(--transition); }
.footer-col a:hover { color: var(--accent-light); }
.footer-col p { font-size: 0.88rem; margin-bottom: 6px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; text-align: center; font-size: 0.82rem; }

/* ── Stats ── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0; }
.stat-item { text-align: center; background: var(--white); padding: 24px 16px; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); display: block; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 0.82rem; color: var(--text-light); }

/* ── Process Steps ── */
.process-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 40px 0; }
.step-card { text-align: center; padding: 28px 20px; background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-100); }
.step-icon { font-size: 2.2rem; margin-bottom: 14px; display: block; }
.step-card h3 { font-size: 0.95rem; margin-bottom: 8px; }
.step-card p { font-size: 0.82rem; }

/* ── Certs ── */
.certs-row { display: flex; flex-wrap: wrap; gap: 16px; margin: 32px 0; }
.cert-badge { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--gray-200); border-radius: 40px; padding: 8px 16px; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.cert-badge span { font-size: 1.1rem; }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius); font-size: 0.92rem; font-family: inherit;
  background: var(--white); color: var(--text); transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,92,58,0.1);
}
.form-group textarea { resize: vertical; min-height: 120px; }
select { appearance: none; 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='%235a6e60' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ── Misc ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 32px; }
.section-header { margin-bottom: 40px; }
.section-header h2 { margin-bottom: 10px; }

/* ── Features Grid ── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  transition: all 0.3s;
}
.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}
.feature-icon { font-size: 2.4rem; margin-bottom: 16px; display: block; }
.feature-card h3 { font-size: 1rem; margin-bottom: 12px; color: var(--text); }
.feature-card p { font-size: 0.88rem; line-height: 1.65; }

/* ── Product Categories ── */
.product-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.cat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}
.cat-card h3 { font-size: 1.05rem; margin: 12px 0 8px; color: var(--text); }
.cat-card p { font-size: 0.88rem; line-height: 1.55; }
.cat-spec { font-size: 0.8rem !important; color: var(--text-light) !important; }

/* ── Stats ── */
.stats-row { margin-top: 48px; }
.stat-item {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 28px 16px;
  text-align: center;
  transition: all 0.3s;
}
.stat-item:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.stat-num { font-size: 2.4rem; font-weight: 800; color: var(--primary); }

/* ── Comparison Table ── */
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th {
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.88rem;
}
.compare-table tr:nth-child(even) td { background: var(--gray-50); }
.compare-table tr:hover td { background: rgba(26,92,58,0.04); }
.highlight-row td { background: rgba(26,92,58,0.06) !important; font-weight: 600; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-100); }

/* ── Case Cards ── */
.case-card { transition: all 0.3s; }
.case-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.case-card > div:first-child img { transition: transform 0.5s; }
.case-card:hover > div:first-child img { transform: scale(1.05); }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light), var(--accent));
}


/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .process-steps { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .carousel-track { height: 320px; }
  .carousel-slide img { height: 320px; }
  .carousel-wrapper { max-height: 320px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-menu.open { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .process-steps { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .carousel-thumb-row { grid-template-columns: repeat(4, 1fr); }
  .carousel-track { height: 240px; }
  .carousel-slide img { height: 240px; }
  .carousel-wrapper { max-height: 240px; }
  .carousel-arrow { width: 36px; height: 36px; font-size: 1rem; }
}

/* ── WhatsApp Floating Button ── */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.whatsapp-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #25D366;
  color: #fff;
  padding: 14px 18px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  padding-right: 18px;
  transform: scale(0.7);
  opacity: 0.85;
}

.whatsapp-btn:hover {
  background: #128C7E;
  transform: scale(1);
  opacity: 1;
  max-width: 260px;
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.55);
}

.whatsapp-icon {
  width: 42px;
  height: 42px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.whatsapp-btn:hover .whatsapp-icon {
  transform: scale(1.1);
}

.whatsapp-icon svg {
  width: 24px;
  height: 24px;
}

.whatsapp-label {
  overflow: hidden;
  white-space: nowrap;
}

.whatsapp-float .tooltip {
  background: var(--dark);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  position: absolute;
  right: 60px;
  white-space: nowrap;
}
.whatsapp-float:hover .tooltip { opacity: 1; }
