/* ==========================================
   Hangfei Bearing Co., Ltd. - Global Styles
   Industrial Navy-Gray-White Theme
   ========================================== */

/* CSS Variables */
:root {
  --primary-dark: #0a1628;
  --primary: #1e3a5f;
  --primary-light: #2b6cb0;
  --accent: #3182ce;
  --gray-dark: #2d3748;
  --gray: #4a5568;
  --gray-light: #718096;
  --gray-lighter: #a0aec0;
  --bg-light: #f7f8fa;
  --bg-white: #ffffff;
  --text-dark: #1a202c;
  --text-body: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 6px;
  --radius-lg: 12px;
  --max-width: 1280px;
}

/* 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", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-body);
  background: var(--bg-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

/* Language Switching */
body.lang-en .zh { display: none !important; }
body.lang-zh .en { display: none !important; }

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================
   Header
   ========================================== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--primary-dark);
  box-shadow: var(--shadow);
}

.header-top {
  background: #070f1c;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  font-size: 13px;
  color: var(--gray-lighter);
}

.header-top a { color: var(--gray-lighter); }
.header-top a:hover { color: var(--bg-white); }

.header-top-left { display: flex; gap: 20px; align-items: center; }
.header-top-left span { display: flex; align-items: center; gap: 6px; }

.lang-switch {
  display: flex;
  gap: 4px;
}
.lang-switch button {
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 3px;
  color: var(--gray-lighter);
  border: 1px solid transparent;
  transition: var(--transition);
}
.lang-switch button:hover { color: var(--bg-white); }
.lang-switch button.active {
  background: var(--primary-light);
  color: var(--bg-white);
  border-color: var(--primary-light);
}

/* Main Nav */
.header-main { background: var(--primary-dark); }
.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bg-white);
}

.logo-mark {
  width: 44px; height: 44px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  letter-spacing: 1px;
  color: var(--bg-white);
}

.logo-text { display: flex; flex-direction: column; }
.logo-text .brand-name {
  font-size: 18px; font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
}
.logo-text .brand-sub {
  font-size: 11px; color: var(--gray-lighter);
  letter-spacing: 2px; text-transform: uppercase;
}

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 16px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  position: relative;
}
.nav a:hover, .nav a.active {
  color: var(--bg-white);
  background: rgba(255,255,255,0.08);
}
.nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 16px; right: 16px;
  height: 2px;
  background: var(--primary-light);
  border-radius: 2px;
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
.mobile-menu-btn span {
  display: block;
  width: 24px; height: 2px;
  background: var(--bg-white);
  transition: var(--transition);
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
  position: relative;
  min-height: 600px;
  display: flex; align-items: center;
  background: var(--primary-dark);
  overflow: hidden;
  margin-top: 112px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(43,108,176,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(49,130,206,0.1) 0%, transparent 50%),
    linear-gradient(180deg, rgba(10,22,40,0.95), rgba(10,22,40,0.98));
  z-index: 1;
}

.hero .container { position: relative; z-index: 2; }

.hero-content {
  max-width: 640px;
  padding: 80px 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(43,108,176,0.2);
  border: 1px solid rgba(43,108,176,0.3);
  border-radius: 20px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--bg-white);
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero h1 span { color: var(--primary-light); }

.hero-desc {
  font-size: 17px;
  color: rgba(255,255,255,0.7);
  line-height: 1.7;
  margin-bottom: 36px;
}

.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-light);
  color: var(--bg-white);
  box-shadow: 0 4px 14px rgba(43,108,176,0.35);
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43,108,176,0.45);
}

.btn-outline {
  background: transparent;
  color: var(--bg-white);
  border: 1.5px solid rgba(255,255,255,0.25);
}
.btn-outline:hover {
  border-color: var(--bg-white);
  background: rgba(255,255,255,0.05);
}

.hero-visual {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 45%;
  max-width: 600px;
  opacity: 0.15;
  z-index: 0;
}

.hero-visual svg { width: 100%; height: auto; }

/* ==========================================
   Section Common
   ========================================== */
.section { padding: 80px 0; }
.section-bg { background: var(--bg-light); }

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-header h2 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
  line-height: 1.3;
}

.section-header p {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
}

.section-header .line {
  width: 48px; height: 3px;
  background: var(--primary-light);
  margin: 0 auto 20px;
  border-radius: 2px;
}

/* ==========================================
   Features / Cards
   ========================================== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.feature-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-light);
}
.feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}
.feature-card:hover .feature-img img {
  transform: scale(1.05);
}

.feature-body {
  padding: 24px 28px 36px;
  text-align: center;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================
   Product Cards
   ========================================== */
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.product-img {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background: var(--bg-light);
  overflow: hidden;
}
.product-img img, .product-img .placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: var(--transition);
}
.product-card:hover .product-img img,
.product-card:hover .product-img .placeholder {
  transform: scale(1.05);
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
  color: var(--gray-light);
}
.placeholder svg { opacity: 0.5; margin-bottom: 8px; }
.placeholder span { font-size: 12px; }

.product-info { padding: 20px 24px 24px; }
.product-info h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.product-info .product-en {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.product-info .product-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
}
.product-link:hover { color: var(--accent); gap: 10px; }

/* ==========================================
   Stats
   ========================================== */
.stats-bar {
  background: var(--primary);
  padding: 48px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-item {
  text-align: center;
  color: var(--bg-white);
}
.stat-num {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff, #90cdf4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* ==========================================
   About Section (Home)
   ========================================== */
.about-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-img img, .about-img .placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.about-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.3;
}
.about-content p {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 16px;
}

.highlight-list {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.highlight-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-body);
}
.highlight-list .check {
  width: 22px; height: 22px;
  background: rgba(43,108,176,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
}

/* ==========================================
   Factory / Production
   ========================================== */
.factory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.factory-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.factory-card .factory-img {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg-light);
  overflow: hidden;
  display: block;
}
.factory-card .factory-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.factory-card .factory-img .placeholder {
  width: 100%; height: 100%;
}
.factory-card h3 {
  padding: 16px 20px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}
.factory-card p {
  padding: 0 20px 20px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ==========================================
   Product Detail Page
   ========================================== */
.breadcrumb {
  background: var(--bg-light);
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb span { margin: 0 8px; }

.pd-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  padding: 48px 0;
}
.pd-gallery {
  background: var(--bg-light);
  border-radius: var(--radius);
  overflow: hidden;
}
.pd-img-wrap {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
}
#pd-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}
.pd-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.pd-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: var(--transition);
  opacity: 0.7;
}
.pd-thumb:hover { opacity: 1; }
.pd-thumb-active {
  border-color: var(--primary-light);
  opacity: 1;
}
.pd-placeholder {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
  color: var(--gray-light);
  border-radius: var(--radius);
}
.pd-info h1 {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.pd-info .pd-sub {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
}
.pd-info .pd-desc {
  font-size: 15px;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 24px;
}

.pd-specs {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.pd-specs h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.pd-specs ul { display: flex; flex-direction: column; gap: 8px; }
.pd-specs li {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.pd-specs li:last-child { border-bottom: none; padding-bottom: 0; }
.pd-specs li .label { color: var(--text-muted); }
.pd-specs li .value { color: var(--text-dark); font-weight: 500; }

.pd-actions { display: flex; gap: 12px; }
.pd-actions .btn { padding: 12px 28px; font-size: 14px; }

/* ==========================================
   Contact / Inquiry Forms
   ========================================== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
}

.contact-info-card {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 40px;
  color: var(--bg-white);
  height: fit-content;
}
.contact-info-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.contact-info-card > p {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
}

.contact-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.contact-item .icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--bg-white);
  flex-shrink: 0;
}
.contact-item h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.contact-item p {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.form-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 40px;
  border: 1px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-group label .required { color: #e53e3e; margin-left: 2px; }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-dark);
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }

.form-card .btn-primary { width: 100%; padding: 14px; }

/* ==========================================
   Footer
   ========================================== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-brand .logo { margin-bottom: 16px; }
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--bg-white);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
}
.footer-col a:hover { color: var(--bg-white); }

.footer-contact li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

.footer-bottom {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ==========================================
   Page Title Bar
   ========================================== */
.page-title {
  background: var(--primary-dark);
  padding: 140px 0 60px;
  text-align: center;
  color: var(--bg-white);
}
.page-title h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 12px;
}
.page-title p {
  font-size: 16px;
  color: rgba(255,255,255,0.6);
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-row { gap: 40px; }
  .pd-layout { gap: 32px; }
}

@media (max-width: 768px) {
  .grid-3, .grid-4, .stats-grid, .factory-grid {
    grid-template-columns: 1fr;
  }
  .about-row, .contact-layout, .pd-layout {
    grid-template-columns: 1fr;
  }
  .hero { min-height: auto; margin-top: 104px; }
  .hero h1 { font-size: 32px; }
  .hero-content { padding: 60px 0; }
  .section { padding: 60px 0; }
  .section-header h2 { font-size: 28px; }
  .page-title { padding: 120px 0 48px; }
  .page-title h1 { font-size: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .header-main .container { height: 64px; }
  .header-top .container { flex-wrap: wrap; height: auto; padding: 6px 24px; gap: 6px; }
  .hero { margin-top: 104px; }
}

/* Mobile Menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: 104px; left: 0; right: 0; bottom: 0;
  background: var(--primary-dark);
  z-index: 999;
  padding: 24px;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 14px 16px;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
}
.mobile-nav a:hover, .mobile-nav a.active {
  background: rgba(255,255,255,0.08);
  color: var(--bg-white);
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}
