/* ==========================================================
   Transportes Mejía — hoja de estilos principal
   Paleta tomada del logo: carbón, dorado, naranja, plata
   ========================================================== */
:root {
  --carbon: #2B2D31;
  --grafito: #3A3D42;
  --carbon-deep: #1F2124;
  --dorado: #E0A526;
  --naranja: #E8731A;
  --naranja-hover: #CF6212;
  --plata: #B8BCC2;
  --hueso: #F6F5F2;
  --blanco: #FFFFFF;
  --texto: #1E1F22;
  --texto-suave: #55585E;
  --texto-claro: #F2F2F2;
  --borde: #E3E1DC;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(20, 22, 26, .08);
  --shadow-hover: 0 18px 40px rgba(20, 22, 26, .14);
  --header-h: 76px;

  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--texto);
  background: var(--hueso);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .6em; color: inherit; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--dorado); color: var(--carbon); padding: 8px 14px; border-radius: 6px; z-index: 200; font-weight: 600; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--dorado); outline-offset: 3px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--font-head); font-weight: 700; font-size: .98rem;
  padding: .9em 1.6em; border-radius: var(--radius-sm); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--naranja); color: #fff; }
.btn-primary:hover { background: var(--naranja-hover); }
.btn-ghost { border-color: var(--plata); color: #fff; background: rgba(255,255,255,.04); }
.btn-ghost:hover { border-color: var(--dorado); color: var(--dorado); }
.btn-sm { padding: .6em 1.2em; font-size: .9rem; }
.btn-block { width: 100%; }

.eyebrow {
  font-family: var(--font-head); font-weight: 700; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--naranja); margin-bottom: .8em;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--header-h);
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled { background: rgba(31, 33, 36, .96); box-shadow: 0 4px 20px rgba(0,0,0,.25); backdrop-filter: blur(6px); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.brand img { width: 52px; height: 52px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.brand-text { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; }
.brand-text strong { color: var(--dorado); font-weight: 800; font-style: italic; }

.main-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.main-nav a:not(.btn) {
  display: block; padding: .5em .75em; color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem;
  border-radius: 6px; position: relative;
}
.main-nav a:not(.btn)::after {
  content: ""; position: absolute; left: .75em; right: .75em; bottom: .25em; height: 2px; background: var(--dorado);
  transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.main-nav a:not(.btn):hover::after, .main-nav a.active::after { transform: scaleX(1); }
.nav-cta { margin-left: 8px; }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 2px; background: #fff; margin: 6px 0; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  color: #fff; background: var(--carbon); padding-top: var(--header-h); isolation: isolate;
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(31,33,36,.92) 0%, rgba(31,33,36,.72) 45%, rgba(31,33,36,.35) 100%);
}
.hero-content { padding: 80px 0 140px; }
.hero .eyebrow { color: var(--dorado); }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.4rem); font-weight: 800; font-style: italic; letter-spacing: -.02em;
  text-transform: uppercase; max-width: 16ch; margin-bottom: .4em;
}
.hero h1 span { color: var(--dorado); }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); max-width: 44ch; color: #E4E5E7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-stats { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(31,33,36,.85); border-top: 1px solid rgba(184,188,194,.25); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 12px; text-align: center; border-right: 1px solid rgba(184,188,194,.18); display: flex; flex-direction: column; }
.stat:last-child { border-right: 0; }
.stat strong { font-family: var(--font-head); font-size: 1.9rem; font-weight: 800; color: var(--dorado); line-height: 1.1; }
.stat > span { font-size: .85rem; color: var(--plata); }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 9vw, 110px) 0; }
.section-alt { background: var(--blanco); }
.section-dark { background: var(--carbon); color: var(--texto-claro); }
.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }
.section-head.left { text-align: left; margin: 0; }
.section-head > p:last-child { color: var(--texto-suave); }

.card {
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--dorado); }
.card p { color: var(--texto-suave); margin: 0; }
.icon-badge {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 18px;
  color: var(--carbon); background: linear-gradient(145deg, #F1F2F4, #C9CDD2);
  box-shadow: inset 0 0 0 2px var(--dorado);
}
.icon-badge svg { width: 26px; height: 26px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-mvv { border-top: 4px solid var(--dorado); }

/* Servicios */
.services-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; margin-bottom: 56px; }
.services-intro .section-head p:last-of-type { color: var(--texto-suave); }
.map-figure { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 440px; justify-self: center; }
.grid-services { display: grid; grid-template-columns: repeat(6, 1fr); gap: 22px; }
.grid-services .service { grid-column: span 2; }
.grid-services .service:nth-child(4) { grid-column: 2 / span 2; }
.service h3 { margin-bottom: .4em; }

/* Control */
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.control-img { margin: 0; border-radius: var(--radius); overflow: hidden; position: relative; }
.control-img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(224,165,38,.4); border-radius: inherit; }
.control-img img { width: 100%; aspect-ratio: 4/3.4; object-fit: cover; }
.control .eyebrow { color: var(--dorado); }
.control p { color: #CFD1D5; }
.check-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 34px; font-weight: 500; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%;
  background: var(--naranja) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* Diferenciadores */
.grid-diff { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--borde); border-left: 1px solid var(--borde); }
.diff { padding: 34px 28px; border-right: 1px solid var(--borde); border-bottom: 1px solid var(--borde); background: var(--blanco); transition: background .25s; }
.diff:hover { background: #FFFBF2; }
.diff-num { font-family: var(--font-head); font-weight: 800; font-style: italic; font-size: 2rem; color: var(--dorado); display: block; margin-bottom: 8px; }
.diff p { color: var(--texto-suave); margin: 0; }

/* Banda CTA */
.cta-band { position: relative; color: #fff; padding: 90px 0; isolation: isolate; overflow: hidden; }
.cta-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 70%; z-index: -2; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(31,33,36,.94), rgba(31,33,36,.7)); z-index: -1; }
.cta-inner { text-align: center; max-width: 720px; }
.cta-inner p { color: #D9DBDE; margin-bottom: 28px; }

/* Clientes */
.client { text-align: center; }
.client-logo { height: 110px; display: grid; place-items: center; margin-bottom: 18px; padding: 10px; border-radius: var(--radius-sm); background: #fff; }
.client-logo img { max-height: 90px; width: auto; filter: grayscale(1); opacity: .8; transition: filter .3s, opacity .3s; }
.client:hover .client-logo img { filter: none; opacity: 1; }

/* Seguridad */
.grid-risk { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.risk { background: var(--hueso); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--borde); }
.risk img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.risk div { padding: 18px 20px 22px; }
.risk h3 { margin-bottom: .3em; }
.risk p { color: var(--texto-suave); margin: 0; font-size: .95rem; }
.safety-fact {
  margin-top: 48px; display: flex; align-items: center; gap: 28px; padding: 30px 34px;
  background: var(--carbon); color: #E4E5E7; border-radius: var(--radius); border-left: 6px solid var(--naranja);
}
.fact-num { font-family: var(--font-head); font-weight: 800; font-size: clamp(3rem, 7vw, 4.5rem); color: var(--dorado); line-height: 1; flex-shrink: 0; }
.safety-fact p { margin: 0; font-size: 1.05rem; }
.safety-fact strong { color: #fff; }
.quote {
  margin: 48px auto 0; max-width: 760px; text-align: center; font-family: var(--font-head); font-style: italic;
  font-weight: 700; font-size: clamp(1.2rem, 2.4vw, 1.6rem); color: var(--carbon);
}

/* Contacto */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: start; }
.contact-info > p:not(.eyebrow) { color: var(--texto-suave); }
.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list li[hidden] { display: none; }
.ci-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--carbon); color: var(--dorado); display: grid; place-items: center; flex-shrink: 0; }
.contact-list small { display: block; color: var(--texto-suave); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.contact-list a { font-weight: 600; text-decoration: none; word-break: break-word; }
.contact-list a:hover { color: var(--naranja); }

.quote-form { padding: 34px; }
.quote-form:hover { transform: none; }
.quote-form h3 { font-size: 1.4rem; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; margin-bottom: 22px; }
.span-2 { grid-column: span 2; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: .75em .9em; border: 1.5px solid var(--borde); border-radius: var(--radius-sm);
  background: var(--hueso); color: var(--texto); transition: border-color .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--dorado); background: #fff; box-shadow: 0 0 0 3px rgba(224,165,38,.2); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #C62828; }
.field .error-msg { color: #C62828; font-size: .8rem; margin-top: 4px; display: block; }
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--naranja); flex-shrink: 0; }
.field.check label { font-weight: 400; color: var(--texto-suave); margin: 0; }
.field.check.invalid label { color: #C62828; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin: 14px 0 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: #2E7D32; }
.form-status.err { color: #C62828; }

/* Footer */
.site-footer { background: var(--carbon-deep); color: #C9CBCF; padding: 64px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.footer-brand img { width: 84px; height: 84px; margin-bottom: 14px; }
.footer-slogan { font-family: var(--font-head); font-style: italic; font-weight: 700; color: var(--dorado); }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer li[hidden] { display: none; }
.site-footer a { text-decoration: none; word-break: break-word; }
.site-footer a:hover { color: var(--dorado); }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(184,188,194,.35); display: grid; place-items: center; }
.socials a:hover { border-color: var(--dorado); }
.socials svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.footer-bottom { border-top: 1px solid rgba(184,188,194,.18); padding: 22px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .88rem; }
.footer-bottom p { margin: 0; }

/* Flotantes */
.wa-float, .to-top { position: fixed; right: 18px; z-index: 90; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.wa-float { bottom: 18px; width: 58px; height: 58px; background: #25D366; color: #fff; }
.wa-float svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.wa-float[hidden] { display: none; }
.to-top { bottom: 88px; width: 44px; height: 44px; background: var(--carbon); color: var(--dorado); opacity: 0; pointer-events: none; transition: opacity .3s; }
.to-top.show { opacity: 1; pointer-events: auto; }
body.no-wa .to-top { bottom: 18px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-services { grid-template-columns: repeat(2, 1fr); }
  .grid-services .service, .grid-services .service:nth-child(4) { grid-column: auto; }
  .grid-services .service:last-child { grid-column: span 2; }
  .grid-risk, .grid-diff { grid-template-columns: repeat(2, 1fr); }
  .contact-grid, .control-grid { gap: 40px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--carbon-deep);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .main-nav.open { max-height: 80vh; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
  .main-nav ul { flex-direction: column; align-items: stretch; padding: 12px 16px 20px; gap: 0; }
  .main-nav a:not(.btn) { padding: .9em .5em; border-bottom: 1px solid rgba(184,188,194,.12); }
  .main-nav a:not(.btn)::after { display: none; }
  .nav-cta { margin: 14px 0 0; }
  .nav-cta .btn { width: 100%; }
  .site-header.menu-open { background: var(--carbon-deep); }

  .services-intro, .control-grid, .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: span 2; }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; }
  .brand img { width: 44px; height: 44px; }
  .brand-text { font-size: 1rem; }
  .hero-content { padding: 48px 0 190px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 14px 8px; border-bottom: 1px solid rgba(184,188,194,.18); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n+3) { border-bottom: 0; }
  .stat strong { font-size: 1.5rem; }
  .grid-services, .grid-risk, .grid-diff { grid-template-columns: 1fr; }
  .grid-services .service:last-child { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .quote-form { padding: 24px 18px; }
  .safety-fact { flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
