/* ==========================================================
   EKM Soluciones Electromecánicas — hoja de estilos principal
   ========================================================== */

:root {
  --ink: #0d1b16;
  --ink-2: #1d2b26;
  --text: #3d4a45;
  --muted: #6b7873;
  --line: #e3e8e5;
  --bg: #ffffff;
  --bg-soft: #f4f7f5;
  --brand: #0b6b3a;        /* verde EKM */
  --brand-dark: #064d29;
  --brand-soft: #e6f2eb;
  --accent: #f5b301;       /* amarillo eléctrico */
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(13, 27, 22, .06);
  --shadow: 0 12px 32px rgba(13, 27, 22, .10);
  --container: 1180px;
  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
p { margin: 0 0 1em; }

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

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #ffc629; color: var(--ink); }
.btn-ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--ink); }
.btn-green { background: var(--brand); color: #fff; }
.btn-green:hover { background: var(--brand-dark); color: #fff; }

/* ---------- Encabezado ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background .3s, box-shadow .3s, padding .3s;
  padding: 18px 0;
}
.site-header.scrolled {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { display: flex; align-items: center; gap: 12px; color: #fff; }
.logo:hover { color: #fff; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(11,107,58,.35);
  flex-shrink: 0;
}
.logo-mark svg { width: 26px; height: 26px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text strong { font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; }
.logo-text span { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.site-header.scrolled .logo, .site-header.scrolled .logo:hover { color: var(--ink); }

.nav { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block;
  padding: .55em 1em;
  border-radius: 999px;
  color: rgba(255,255,255,.9);
  font-weight: 500;
  font-size: .93rem;
  transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav a.active { background: var(--accent); color: var(--ink); }
.site-header.scrolled .nav a { color: var(--ink-2); }
.site-header.scrolled .nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.site-header.scrolled .nav a.active { background: var(--brand); color: #fff; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 10px;
  background: rgba(255,255,255,.15);
  color: #fff;
  cursor: pointer;
}
.site-header.scrolled .nav-toggle { background: var(--brand-soft); color: var(--brand-dark); }
.nav-toggle svg { width: 24px; height: 24px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  color: #fff;
  background: var(--ink) center/cover no-repeat;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(6,30,18,.92) 0%, rgba(6,40,22,.75) 45%, rgba(6,40,22,.25) 100%);
}
.hero .container { position: relative; padding-top: 110px; padding-bottom: 70px; }
.hero-content { max-width: 680px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1em;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 800; margin-bottom: .4em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,.85); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2em; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 40px;
  margin-top: 3.5em; padding-top: 2em;
  border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stats div strong { display: block; font-family: var(--font-head); font-size: 2rem; color: #fff; line-height: 1; }
.hero-stats div span { font-size: .85rem; color: rgba(255,255,255,.7); }

/* Hero de páginas interiores */
.page-hero { min-height: min(52vh, 480px); }
.page-hero h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
.breadcrumb { font-size: .88rem; color: rgba(255,255,255,.75); }
.breadcrumb a { color: rgba(255,255,255,.9); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Secciones ---------- */
.section { padding: 100px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head .eyebrow { color: var(--brand); }
.section-head h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* Bienvenida */
.welcome { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.welcome-media { position: relative; }
.welcome-media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.welcome-badge {
  position: absolute; right: -24px; bottom: 40px;
  background: var(--accent); color: var(--ink);
  padding: 20px 24px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-head); font-weight: 800; line-height: 1.1;
}
.welcome-badge strong { display: block; font-size: 2.2rem; }
.welcome-badge span { font-size: .85rem; font-weight: 600; }
.welcome h2 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 800; }
.welcome p { text-align: justify; }

/* Tarjetas de servicio */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
  transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.card-img { aspect-ratio: 4/3; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.07); }
.card-body { padding: 20px 22px 24px; }
.card-body h3 { font-size: 1.12rem; margin: 0; }
.card-tag { font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }

.group-title {
  display: flex; align-items: center; gap: 16px;
  font-size: 1.05rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand-dark); margin: 0 0 24px;
}
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.group + .group { margin-top: 64px; }

/* Lista detallada (servicios / productos) */
.feature-list { display: flex; flex-direction: column; gap: 40px; }
.feature {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center;
  background: #fff; border-radius: var(--radius-lg); padding: 28px;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.feature:nth-child(even) .feature-media { order: 2; }
.feature-media img { border-radius: var(--radius); aspect-ratio: 16/11; object-fit: cover; width: 100%; }
.feature-num { font-family: var(--font-head); font-weight: 800; font-size: .9rem; color: var(--brand); letter-spacing: .1em; }
.feature h3 { font-size: clamp(1.4rem, 2.5vw, 1.8rem); font-weight: 800; margin-top: .3em; }
.feature p { text-align: justify; }

/* Misión / Visión / Valores */
.mvv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.mvv .card-body { padding: 26px 26px 30px; }
.mvv .card-body h3 { font-size: 1.35rem; margin-bottom: .5em; }
.mvv .card-body p { text-align: justify; margin: 0; }
.icon-chip {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin: -50px 0 16px; position: relative;
  border: 4px solid #fff;
}
.icon-chip svg { width: 22px; height: 22px; }

/* Quiénes somos */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center; }
.about img { border-radius: var(--radius-lg); box-shadow: var(--shadow); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.about h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); font-weight: 800; }
.about p { text-align: justify; }
.check-list { list-style: none; padding: 0; margin: 1.5em 0 0; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; color: var(--ink-2); }
.check-list svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--brand); margin-top: 2px; }

/* Contacto */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: stretch; }
.contact-media img { border-radius: var(--radius-lg); width: 100%; height: 100%; min-height: 360px; object-fit: cover; box-shadow: var(--shadow); }
.contact-info h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); font-weight: 800; }
.info-list { list-style: none; padding: 0; margin: 2em 0; display: grid; gap: 18px; }
.info-item {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--line);
}
.info-item .icon-chip { margin: 0; border: 0; flex-shrink: 0; }
.info-item p { margin: 0; color: var(--ink-2); }
.info-item small { display: block; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* Banda de llamada a la acción */
.cta {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff; border-radius: var(--radius-lg);
  padding: 56px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.cta::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(245,179,1,.18);
}
.cta h2 { color: #fff; margin: 0 0 .3em; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta p { margin: 0; color: rgba(255,255,255,.85); }
.cta > * { position: relative; z-index: 1; }

/* ---------- Pie de página ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.7); padding: 72px 0 0; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 48px; padding-bottom: 48px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 1.2em; }
.site-footer .logo { color: #fff; margin-bottom: 1.2em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--accent); }
.site-footer .highlight { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 22px 0; font-size: .85rem;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-bottom a { color: rgba(255,255,255,.55); }

/* ---------- Animaciones ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .welcome, .about { gap: 40px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav {
    position: absolute; top: 100%; left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; padding: 12px; border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s, visibility .25s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a, .site-header .nav a { color: var(--ink-2); padding: .8em 1em; }
  .nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
  .nav a.active, .site-header.scrolled .nav a.active { background: var(--brand); color: #fff; }

  .welcome, .about, .contact, .feature, .footer-grid, .mvv { grid-template-columns: 1fr; }
  .feature:nth-child(even) .feature-media { order: 0; }
  .feature { gap: 24px; padding: 20px; }
  .welcome-badge { right: 16px; }
  .mvv { gap: 48px; }
  .section { padding: 72px 0; }
  .cta { padding: 36px 28px; }
}

@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .welcome p, .about p, .feature p, .mvv .card-body p { text-align: left; }
  .cards { grid-template-columns: 1fr; }
  .logo-text span { display: none; }
  .hero-stats { gap: 24px; }
  .hero { min-height: min(88vh, 760px); }
  .page-hero { min-height: min(46vh, 420px); }
}
