/* ===========================================================
   CRRC Yongji — Brazilian Portuguese site
   Corporate B2B industrial palette
   =========================================================== */

:root {
  --color-primary: #003366;
  --color-primary-dark: #002347;
  --color-accent: #C8102E;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-soft: #f5f7fa;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 6px;
  --container: 1200px;
}

/* ----- Reset & base ----- */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0 0 0.75em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-accent); }

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

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

/* ----- Header ----- */

.site-header {
  background: #fff;
  color: var(--color-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.5rem;
}

.main-nav a {
  color: var(--color-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-primary);
  background: var(--color-bg-soft);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.25rem;
}

.lang-switcher a, .lang-switcher span {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
}

.lang-switcher .lang-current {
  background: var(--color-accent);
  color: #fff;
}

.lang-switcher .lang-link:hover {
  background: var(--color-bg-soft);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

/* ----- Hero carousel ----- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--color-primary-dark);
}

.hero-slides {
  position: relative;
  height: clamp(360px, 60vh, 560px);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-size: cover;
  background-position: center;
}

.hero-slide.active { opacity: 1; }

.hero-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,35,71,0.85) 0%, rgba(0,35,71,0.4) 70%, transparent 100%);
}

.hero-content {
  position: relative;
  max-width: 640px;
  padding: 0 2rem;
  color: #fff;
  z-index: 2;
}

.hero-content h1 {
  color: #fff;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 0;
  cursor: pointer;
}

.btn:hover {
  background: #a30d24;
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
}
.btn-outline:hover {
  background: #fff;
  color: var(--color-primary);
}

.hero-dots {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  border: 0;
  padding: 0;
  transition: background 0.2s ease;
}

.hero-dot.active { background: #fff; }

/* ----- Sections ----- */

.section {
  padding: 4rem 0;
}

.section-soft {
  background: var(--color-bg-soft);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-header h2 {
  margin-bottom: 0.5rem;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 1rem auto 0;
}

.section-header p {
  color: var(--color-muted);
  font-size: 1.1rem;
}

/* ----- Product grid ----- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  display: flex;
  flex-direction: column;
}

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

.product-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f7f9fc 0%, #e9eef5 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.product-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  padding: 0.75rem;
}

.product-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0,51,102,0.08);
  pointer-events: none;
}

.product-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.product-card p {
  color: var(--color-muted);
  font-size: 0.95rem;
  flex: 1;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.card-link {
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-block;
  margin-top: auto;
}

.card-link:hover {
  color: var(--color-primary);
}

.product-tag {
  background: var(--color-bg-soft);
  color: var(--color-primary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

/* ----- Content prose ----- */

.page-hero {
  background: var(--color-primary);
  color: #fff;
  padding: 4rem 0 3rem;
  position: relative;
  background-size: cover;
  background-position: center;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,35,71,0.85), rgba(0,35,71,0.85));
}

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

.page-hero h1 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.page-hero .breadcrumb {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.page-hero .breadcrumb a {
  color: rgba(255,255,255,0.85);
}

.prose {
  max-width: 850px;
  margin: 0 auto;
}

.prose h2 {
  color: var(--color-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}

.prose h3 {
  color: var(--color-primary);
  margin-top: 1.75rem;
}

.prose ul {
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
}

.feature h4 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Stats row */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: center;
  margin: 3rem 0;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  display: block;
  line-height: 1;
}

.stat-label {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  display: block;
}

/* ----- Footer ----- */

.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.85);
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding: 3rem 1.5rem;
}

.footer-col h4 {
  color: #fff;
  margin-bottom: 1rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.footer-col p,
.footer-col address {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  font-style: normal;
  margin: 0 0 1em;
}

.footer-col strong {
  color: rgba(255,255,255,0.9);
}

.footer-col a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.3);
  text-underline-offset: 2px;
}

.footer-col a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

.footer-bottom {
  background: rgba(0,0,0,0.2);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
}

.footer-bottom p {
  margin: 0;
  color: rgba(255,255,255,0.6);
}

/* ----- Legal disclaimer ----- */
.legal-disclaimer {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid #ccc;
  background: #f8f8f8;
  font-size: 0.78rem;
  color: #555;
  line-height: 1.6;
}
.legal-disclaimer p { margin: 0; }
.legal-disclaimer strong { color: #444; }

/* ----- Responsive ----- */

@media (max-width: 880px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 1rem;
    gap: 0;
  }

  .main-nav a {
    display: block;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 600px) {
  .section { padding: 2.5rem 0; }
  .hero-content { padding: 0 1.5rem; }
  .hero-content p { font-size: 1rem; }
  .feature-grid, .product-grid {
    grid-template-columns: 1fr;
  }
  .logo-img { height: 32px; }
}
