/* Eco Electric · base compartida (corporativa, landing, privacidad)
   Tokens, fuentes locales, tipografía, botones, cabecera, pie y utilidades. */

/* Tipografía Fase 4.1: Barlow Condensed (titulares) + Source Sans 3 (texto) + Barlow (etiquetas).
   Todas con licencia SIL Open Font License, autoalojadas. */
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../fonts/source-sans-3-var-latin.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root {
  /* Paleta Fase 4.1 · azul tecnológico + verde profundo + claros + acentos solares.
     Exploratoria (no son códigos oficiales de marca); el logo conserva sus colores originales. */
  /* Fase 4.2 · paleta basada en el sitio y el logotipo originales de Eco Electric */
  --ink: #061632;          /* azul más profundo: pie y velos */
  --ink-2: #0b2547;
  --navy: #081D3D;         /* azul profundo: fondo principal oscuro y texto principal */
  --blue: #0D3B73;         /* azul tecnológico: fondo alternativo */
  --blue-2: #0a3160;
  --blue-bright: #4A9BF0;  /* energía de la red en esquemas */
  --green: #80B721;        /* verde corporativo del logotipo: acento y botón principal */
  --green-text: #4C7412;   /* verde para texto sobre claro (≥ 4.8:1) */
  --green-dark: var(--green-text);
  --green-mid: var(--green-text);
  --lime: var(--green);    /* compatibilidad con estilos de la Fase 4.1 */
  --forest: var(--blue);   /* compatibilidad: los bloques «verde profundo» pasan a azul tecnológico */
  --forest-2: var(--blue-2);
  --gold: #F3B548;         /* solo luz solar / energía */
  --paper: #F7F9F6;
  --paper-2: #EEF1F3;
  --white: #ffffff;
  --grey: #9aa6b1;
  --line: #d9e0e6;
  --text: #1a2535;
  --text-2: #3e4f61;
  --muted: rgba(247, 249, 246, .86);
  --muted-2: rgba(247, 249, 246, .74);
  --rule-dark: rgba(247, 249, 246, .18);
  --error: #b5422e;

  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Barlow", "Source Sans 3", system-ui, sans-serif;
  --f-mono: var(--f-label);   /* compatibilidad con estilos de la Fase 4 */

  --r-btn: 16px;
  --r-card: 22px;
  --pad: clamp(20px, 4.4vw, 64px);
  --maxw: 1312px;
  --sec-y: clamp(80px, 10vw, 144px);
  --ease: cubic-bezier(.6, 0, .2, 1);
  --header-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--f-body); font-size: 17px; line-height: 1.55; text-rendering: optimizeLegibility; }
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.on-light :focus-visible, .on-light:focus-visible { outline-color: var(--navy); }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; padding: 12px 16px; background: var(--paper); color: var(--navy); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }
.sec { padding: var(--sec-y) 0; position: relative; }
.sec--ink { background: var(--ink); color: var(--paper); }
.sec--navy { background: var(--navy); color: var(--paper); }
.sec--paper { background: var(--paper); color: var(--text); }
.sec--white { background: var(--white); color: var(--text); }
.sec--forest { background: var(--forest); color: var(--paper); }

/* Encabezado de sección: etiqueta técnica + título */
.eyebrow { margin: 0; font: 600 13px/1.3 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--green-dark); }
.sec--ink .eyebrow, .sec--navy .eyebrow, .sec--forest .eyebrow { color: var(--lime); }
.sec-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px; padding-top: 24px; border-top: 1px solid currentColor; margin-bottom: clamp(40px, 6vw, 72px); }
.sec--ink .sec-head, .sec--navy .sec-head, .sec--forest .sec-head { border-top-color: var(--rule-dark); }
.sec-head .eyebrow { grid-column: 1 / span 3; padding-top: 10px; }
.sec-head__body { grid-column: 4 / span 9; display: flex; flex-direction: column; gap: 20px; }
.h-display { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(40px, 5.4vw, 76px); line-height: .96; letter-spacing: -.005em; }
.h-2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.05; }
.h-3 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.12; }
.lead { margin: 0; max-width: 62ch; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.55; color: var(--text-2); }
.sec--ink .lead, .sec--navy .lead, .sec--forest .lead { color: var(--muted); }
.mono { font-family: var(--f-mono); }
.note { font-size: 13px; line-height: 1.55; color: var(--text-2); }
.sec--ink .note, .sec--navy .note, .sec--forest .note { color: var(--muted-2); }
.tag-illustrative { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1.25 var(--f-label); letter-spacing: .06em; text-transform: uppercase; padding: 6px 10px; border: 1px dashed currentColor; border-radius: 10px; }

@media (max-width: 860px) {
  .sec-head .eyebrow, .sec-head__body { grid-column: 1 / -1; }
  .sec-head .eyebrow { padding-top: 0; }
}

/* ---------- Botones: radio 16 px, estados hover / focus / active ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 1.5px solid transparent; border-radius: var(--r-btn);
  font: 700 16px/1.1 var(--f-body); letter-spacing: .005em; text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, transform .15s var(--ease), box-shadow .2s; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn--primary { background: var(--lime); color: var(--navy); box-shadow: 0 6px 18px -8px rgba(128, 183, 33, .7); }
.btn--primary:hover { background: #b2e35c; }
.btn--primary:active { background: #8fc437; }
.btn--ghost { border-color: rgba(247, 249, 246, .55); color: var(--paper); background: rgba(247, 249, 246, .04); }
.btn--ghost:hover { border-color: var(--paper); background: rgba(247, 249, 246, .1); }
.btn--outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn--outline:hover { background: var(--navy); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--navy); min-height: 44px; padding: 0 20px; font-size: 15px; border-radius: 14px; }
.btn--light:hover { background: #fff; }
.btn--wa { border-color: rgba(247, 249, 246, .55); color: var(--paper); background: transparent; }
.btn--wa:hover { border-color: var(--paper); background: rgba(247, 249, 246, .08); }
.btn--text { min-height: 48px; padding: 0 12px; color: var(--navy); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn--text:hover { transform: none; color: var(--green-dark); }
.sec--forest .btn--outline, .sec--ink .btn--outline, .sec--navy .btn--outline { border-color: rgba(245,248,246,.7); color: var(--paper); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: progress; transform: none; }
.link { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link:hover { text-decoration-thickness: 2px; }
@media (prefers-reduced-motion: reduce) { .btn:hover, .btn:active { transform: none; } }

/* ---------- Cabecera ---------- */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h); padding: 0 var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--paper); transition: background-color .3s, height .3s; }
.site-header.is-scrolled { --header-h: 72px; background: rgba(8, 29, 61, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.brand { display: inline-flex; min-height: 44px; align-items: center; }
.brand img { height: 42px; width: auto; transition: height .3s; }
.site-header.is-scrolled .brand img { height: 36px; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav__list { display: flex; gap: 26px; margin: 0; padding: 0; list-style: none; }
.site-nav__list a { display: inline-block; font-size: 15px; font-weight: 600; text-decoration: none; padding: 12px 0; }
.site-nav__list a:hover { color: var(--gold); }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; align-items: center; justify-content: center; background: transparent; color: var(--paper); border: 1px solid rgba(247, 249, 246, .45); border-radius: 12px; cursor: pointer; }
.nav-toggle svg path { stroke: currentColor; stroke-width: 1.8; fill: none; transition: transform .25s var(--ease); transform-origin: 12px 12px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__a { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__b { transform: translateY(-4px) rotate(-45deg); }

@media (max-width: 1120px) {
  .site-nav { position: fixed; inset: 0; z-index: -1; flex-direction: column; align-items: flex-start; justify-content: center; gap: 32px; padding: 104px var(--pad) 48px; background: var(--ink); overflow-y: auto;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
  .site-nav.is-open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
  .site-nav__list { flex-direction: column; gap: 2px; }
  .site-nav__list a { display: block; font-family: var(--f-display); font-weight: 700; font-size: clamp(30px, 7vw, 40px); padding: 6px 0; }
  .site-nav__cta { min-height: 52px; font-size: 16px; }
  .nav-toggle { display: inline-flex; position: relative; z-index: 2; }
  .brand { position: relative; z-index: 2; }
  html.menu-open { overflow: hidden; }
  html.menu-open .site-header { background: var(--ink); }
}
@media (max-width: 767px) {
  :root { --header-h: 72px; }
  .brand img, .site-header.is-scrolled .brand img { height: 32px; }
}

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: var(--muted); padding: 72px 0 40px; font-size: 14px; }
.site-footer__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 40px; padding-bottom: 48px; border-bottom: 1px solid var(--rule-dark); }
.site-footer__brand { grid-column: span 4; display: flex; flex-direction: column; gap: 16px; }
.site-footer__brand img { height: 44px; width: auto; align-self: flex-start; }
.site-footer__col { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; }
.site-footer__col--wide { grid-column: span 4; }
.site-footer h2 { margin: 0 0 6px; font: 600 13px/1.2 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.site-footer a { text-decoration: none; display: inline-block; padding: 6px 0; }
.site-footer a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__legal { padding-top: 28px; display: flex; flex-direction: column; gap: 10px; font-size: 12px; line-height: 1.6; color: var(--muted-2); }
@media (max-width: 860px) {
  .site-footer__brand, .site-footer__col--wide { grid-column: 1 / -1; }
  .site-footer__col { grid-column: span 6; }
}

/* ---------- Aparición al desplazarse (solo con JS y movimiento permitido) ---------- */
.js-reveal [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s var(--ease); }
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Video en sección con control ---------- */
.media-ctl { position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: var(--paper); background: rgba(8, 29, 61, .6); border: 1px solid rgba(247, 249, 246, .4); }
.media-ctl:hover { border-color: var(--paper); }
.media-ctl svg { width: 18px; height: 18px; }
.media-ctl svg path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.media-ctl .i-play { display: none; }
.media-ctl[aria-pressed="true"] .i-play { display: block; }
.media-ctl[aria-pressed="true"] .i-pause { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js-reveal [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Botón flotante de WhatsApp (Fase 4.2.1) ---------- */
.wa-fab { position: fixed; z-index: 45; right: max(18px, calc(env(safe-area-inset-right) + 12px)); bottom: calc(18px + env(safe-area-inset-bottom));
  display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #25D366; color: #fff;
  box-shadow: 0 10px 28px -8px rgba(8, 29, 61, .55), 0 0 0 3px rgba(255, 255, 255, .9);
  transition: transform .2s var(--ease), box-shadow .2s, opacity .2s, visibility .2s; }
.wa-fab svg { width: 30px; height: 30px; fill: currentColor; }
.wa-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(8, 29, 61, .6), 0 0 0 3px #fff; }
.wa-fab:active { transform: translateY(0); }
.wa-fab:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.wa-fab.is-hidden { opacity: 0; visibility: hidden; transform: scale(.85); pointer-events: none; transition: opacity .12s, visibility 0s, transform .12s; } /* se oculta al instante si taparía un control */
@media (min-width: 1024px) { .wa-fab { right: 28px; bottom: 28px; width: 62px; height: 62px; } .wa-fab svg { width: 32px; height: 32px; } }
@media (prefers-reduced-motion: reduce) { .wa-fab, .wa-fab:hover, .wa-fab.is-hidden { transform: none; transition: opacity .2s, visibility .2s; } }
@media print { .wa-fab { display: none; } }
