/* ==========================================================================
   Metalsur Mexicana — Hoja de estilos principal
   ========================================================================== */

:root {
  --navy-950: #06121f;
  --navy-900: #0a1b2d;
  --navy-800: #10263d;
  --navy-700: #193a5c;
  --accent: #f26b1d;
  --accent-600: #d85a10;
  --accent-50: #fff3eb;
  --steel: #64748b;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #16212e;
  --muted: #556274;
  --border: #e3e8ef;

  --font-head: "Barlow", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10, 27, 45, .06), 0 2px 8px rgba(10, 27, 45, .05);
  --shadow: 0 10px 30px -10px rgba(10, 27, 45, .25);
  --container: 1180px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-600); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 .6em;
  color: var(--navy-900);
  letter-spacing: -.01em;
}

p { margin: 0 0 1.1em; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--navy-950);
  color: #c4cfdc;
  font-size: .82rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 40px;
}
.topbar a { color: #c4cfdc; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-list { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
.topbar-list li { display: flex; align-items: center; gap: 8px; }
.topbar svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

/* ---------- Encabezado / navegación ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: .04em;
  color: var(--navy-900);
}
.brand-name span { color: var(--accent); }
.brand-tag {
  margin-top: 5px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--steel);
}

.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--navy-800);
  text-decoration: none;
  transition: color .2s, background .2s;
}
.nav-list a:hover { color: var(--accent-600); background: var(--accent-50); }
.nav-list a[aria-current="page"] { color: var(--accent-600); position: relative; }
.nav-list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.nav-list .nav-cta a {
  margin-left: 8px;
  background: var(--accent);
  color: #fff;
}
.nav-list .nav-cta a:hover { background: var(--accent-600); color: #fff; }
.nav-list .nav-cta a[aria-current="page"]::after { display: none; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px; height: 2px;
  background: var(--navy-900);
  border-radius: 2px;
  position: relative;
  transition: transform .25s, background .25s;
}
.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: .02em;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-600); color: #fff; }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, .1); color: #fff; }
.btn-dark { background: var(--navy-900); color: #fff; }
.btn-dark:hover { background: var(--navy-700); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(82vh, 720px);
  display: flex;
  align-items: center;
  color: #fff;
  background: var(--navy-900) center / cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(6, 18, 31, .92) 0%, rgba(6, 18, 31, .75) 45%, rgba(6, 18, 31, .2) 100%);
}
.hero .container { padding-top: 80px; padding-bottom: 80px; }
.hero-content { max-width: 680px; }
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  margin-bottom: .4em;
}
.hero-lead { font-size: 1.12rem; color: #d7e0ea; max-width: 600px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 32px; height: 2px; background: currentColor; }

/* Encabezado de páginas internas */
.page-hero {
  position: relative;
  padding: 110px 0 90px;
  color: #fff;
  background: var(--navy-900) center / cover no-repeat;
  isolation: isolate;
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(6, 18, 31, .9) 0%, rgba(6, 18, 31, .6) 60%, rgba(6, 18, 31, .35) 100%);
}
.page-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  font-weight: 800;
  margin: 0;
  max-width: 760px;
}
.breadcrumb {
  display: flex;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  color: #b8c4d2;
}
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: #7c8da0; }

/* ---------- Secciones ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--surface); }
.section-head { max-width: 720px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow::after { content: ""; width: 32px; height: 2px; background: currentColor; }
.section-title { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; }
.lead { font-size: 1.1rem; color: var(--muted); }
.text-justify { text-align: justify; hyphens: auto; }

.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 64px;
  align-items: center;
}
.split-media { position: relative; isolation: isolate; }
.split-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.split-media::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -18px; bottom: -18px;
  width: 55%; height: 55%;
  border-radius: var(--radius);
  background: var(--accent);
  opacity: .9;
}

/* Franja de datos */
.stats {
  background: var(--navy-900);
  color: #fff;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 36px 28px;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.stat:last-child { border-right: 1px solid rgba(255, 255, 255, .08); }
.stat-value {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--accent);
}
.stat-label { display: block; margin-top: 6px; font-size: .92rem; color: #b8c4d2; line-height: 1.45; }

/* ---------- Tarjetas ---------- */
.cards { display: grid; gap: 32px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .3s ease, box-shadow .3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 30px 32px 34px; display: flex; flex-direction: column; flex: 1; }
.card-body h2,
.card-body h3 { font-size: 1.5rem; font-weight: 700; }
.card-body p { color: var(--muted); }
.card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  text-decoration: none;
}
.card-link svg { width: 18px; height: 18px; transition: transform .2s; }
.card-link:hover svg { transform: translateX(4px); }

.tag {
  position: absolute;
  top: 18px; left: 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Servicios detallados ---------- */
.service {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 56px;
  align-items: start;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.service:first-child { border-top: 0; padding-top: 0; }
.service:nth-child(even) { grid-template-columns: 1fr 420px; }
.service:nth-child(even) .service-media { order: 2; }
.service-media { position: relative; }
.service-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.service-media.contain img { object-fit: contain; background: #fff; padding: 20px; }
.service-num {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .2em;
  color: var(--accent);
  margin-bottom: 10px;
}
.service h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: .01em; }
.service p { color: var(--muted); }

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 8px;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-50);
  color: var(--navy-900);
  font-weight: 600;
}
.callout svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 2px; }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.check-list.two-col { grid-template-columns: repeat(2, 1fr); column-gap: 28px; }
.check-list li {
  position: relative;
  padding-left: 34px;
  color: var(--text);
  line-height: 1.55;
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d85a10' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}

/* ---------- Misión / Visión / valores ---------- */
.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.mv-card {
  position: relative;
  padding: 40px 40px 36px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.mv-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 4px;
  background: var(--accent);
}
.mv-card.dark { background: var(--navy-900); border-color: var(--navy-900); }
.mv-card.dark p { color: #d0dae5; }
.mv-card.dark h2 { color: #fff; }
.mv-card h2 { font-size: 1.6rem; }
.mv-card p { margin: 0; font-size: 1.05rem; color: var(--muted); }
.mv-card .highlight { color: var(--accent); }

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--accent-50);
  color: var(--accent);
  margin-bottom: 20px;
}
.mv-card.dark .icon-badge { background: rgba(242, 107, 29, .15); }
.icon-badge svg { width: 28px; height: 28px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature {
  padding: 34px 32px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.feature h3 { font-size: 1.3rem; }
.feature p { margin: 0; color: var(--muted); text-align: justify; hyphens: auto; }

/* ---------- CTA ---------- */
.cta {
  position: relative;
  padding: 80px 0;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(10, 27, 45, .96) 0%, rgba(16, 38, 61, .9) 60%, rgba(242, 107, 29, .85) 100%),
    var(--navy-900) center / cover no-repeat;
}
.cta .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .3em; max-width: 640px; }
.cta p { margin: 0; color: #d0dae5; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; }
.contact-cards { display: grid; gap: 20px; }
.contact-card {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.contact-card .icon-badge { margin: 0; flex: none; }
.contact-card h2 { font-size: 1.2rem; margin-bottom: .4em; }
.contact-card p { margin: 0; color: var(--muted); }
.contact-card a { word-break: break-word; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.people li { display: flex; flex-direction: column; }
.people a { font-weight: 600; text-decoration: none; }
.people a:hover { text-decoration: underline; }
.people span { font-size: .92rem; color: var(--muted); }

.map {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.map iframe { display: block; width: 100%; height: 100%; min-height: 520px; border: 0; }

.english-note {
  margin-top: 20px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--navy-900);
  color: #d0dae5;
}
.english-note a { color: #fff; font-weight: 600; }

/* ---------- Pie de página ---------- */
.site-footer {
  background: var(--navy-950);
  color: #9fb0c3;
  font-size: .94rem;
}
.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr;
  gap: 48px;
  padding: 72px 0 56px;
}
.site-footer .brand-name { color: #fff; }
.site-footer .brand-mark .hex { fill: var(--navy-700); }
.site-footer .brand-tag { color: #7c8da0; }
.footer-about { margin-top: 20px; max-width: 360px; }
.site-footer h2 {
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a { color: #9fb0c3; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.footer-contact li { display: flex; gap: 12px; align-items: flex-start; }
.footer-contact svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 4px; }
.footer-contact a { color: #c4cfdc; text-decoration: none; word-break: break-word; }
.footer-contact a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 22px 0;
  font-size: .84rem;
}
.footer-bottom .container {
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { color: #9fb0c3; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ---------- Animaciones de entrada ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card, .card-media img, .btn { transition: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .service,
  .service:nth-child(even) { grid-template-columns: 340px 1fr; gap: 40px; }
  .service:nth-child(even) { grid-template-columns: 1fr 340px; }
  .features { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px 24px 24px;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav-open .site-nav { opacity: 1; transform: none; visibility: visible; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list a { padding: 14px 12px; }
  .nav-list a[aria-current="page"]::after { left: 12px; right: auto; width: 24px; }
  .nav-list .nav-cta a { margin: 10px 0 0; text-align: center; }

  .split, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 1px solid rgba(255, 255, 255, .08); }
  .stat:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .cards-3 { grid-template-columns: 1fr 1fr; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-main > :first-child { grid-column: 1 / -1; }

  .service,
  .service:nth-child(even) { grid-template-columns: 1fr; gap: 28px; }
  .service:nth-child(even) .service-media { order: 0; }
  .service-media img { aspect-ratio: 16 / 9; }
  .service-media.contain img { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .topbar .topbar-hide-sm { display: none; }
  .section { padding: 68px 0; }
  .hero { min-height: auto; }
  .hero .container { padding-top: 72px; padding-bottom: 72px; }
  .page-hero { padding: 80px 0 64px; }
  .cards-2, .cards-3, .mv-grid, .features { grid-template-columns: 1fr; }
  .check-list.two-col { grid-template-columns: 1fr; }
  .text-justify, .feature p { text-align: left; }
  .split-media::after { right: -10px; bottom: -10px; }
  .card-body { padding: 24px; }
  .mv-card { padding: 32px 26px 28px; }
  .contact-card { flex-direction: column; padding: 24px; }
  .map iframe { min-height: 360px; }
  .footer-main { grid-template-columns: 1fr; gap: 36px; }
  .brand-name { font-size: 1.12rem; }
  .brand-mark { width: 38px; height: 38px; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: 1px solid rgba(255, 255, 255, .08); border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .topbar-list { gap: 14px; }
  .brand-tag { letter-spacing: .1em; }
}
