/* ==========================================================================
   EGSG Energía — hoja de estilos
   ========================================================================== */

:root {
  --ink: #12211d;
  --navy: #0f2438;
  --navy-deep: #0a1a29;
  --forest: #1b3a2f;
  --copper: #b8712f;
  --copper-light: #d99248;
  --paper: #faf7f1;
  --paper-dim: #f1ece1;
  --line: rgba(15, 36, 56, 0.14);
  --line-strong: rgba(15, 36, 56, 0.28);
  --muted: #56645f;

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max: 1120px;
  --pad: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--muted); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  font-weight: 600;
  margin-bottom: 1em;
}
.eyebrow::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: var(--copper);
  display: inline-block;
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 241, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--navy);
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.brand-name {
  font-family: var(--serif);
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-name small {
  display: block;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-top: 1px;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 2.1rem;
}
nav.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--navy);
  font-weight: 500;
  position: relative;
}
nav.main-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
nav.main-nav a:not(.btn):hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.78em 1.4em;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn svg { width: 1.1em; height: 1.1em; }
.btn-primary {
  background: var(--forest);
  color: #fff;
}
.btn-primary:hover { background: #142e25; }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--navy); }
.btn-copper {
  background: var(--copper);
  color: #fff;
}
.btn-copper:hover { background: #a15f24; }

/* ---- Hero ---- */
.hero {
  padding: clamp(3.5rem, 9vw, 7.5rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  color: var(--navy);
  max-width: 14ch;
}
.hero .lede {
  font-size: 1.12rem;
  max-width: 46ch;
  color: var(--ink);
  opacity: 0.78;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.9rem;
}
.hero-meta {
  display: flex;
  gap: 1.6rem;
  margin-top: 2.6rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero-meta div { font-size: 0.85rem; color: var(--muted); }
.hero-meta strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--navy);
  font-weight: 600;
}

.hero-graphic {
  aspect-ratio: 1 / 1.08;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-deep) 62%, #081420 100%);
  position: relative;
  overflow: hidden;
}
.hero-graphic svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---- Section scaffolding ---- */
section { padding: clamp(3.2rem, 7vw, 6rem) 0; }
.section-head {
  max-width: 62ch;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--navy);
}
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }

/* ---- Services ---- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.service-card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2rem 1.7rem;
  transition: background 0.2s ease;
}
.service-card:hover { background: var(--paper-dim); }
.service-card .num {
  font-family: var(--serif);
  font-size: 0.8rem;
  color: var(--copper);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.service-card svg {
  width: 30px;
  height: 30px;
  margin: 1.1rem 0 1rem;
  color: var(--navy);
}
.service-card h3 {
  font-size: 1.12rem;
  color: var(--navy);
  margin-bottom: 0.4em;
}
.service-card p { font-size: 0.92rem; margin: 0; }

/* ---- Why us ---- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.6rem 3rem;
}
.why-item { display: flex; gap: 1.1rem; }
.why-item svg {
  width: 24px; height: 24px; flex: none; color: var(--copper); margin-top: 0.15rem;
}
.why-item h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: 0.3em; }
.why-item p { font-size: 0.94rem; margin: 0; }

/* ---- About ---- */
.about {
  background: var(--navy);
  color: #eef2ef;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.about .wrap {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about h2 { color: #fff; }
.about p { color: rgba(238, 242, 239, 0.75); }
.about .eyebrow { color: var(--copper-light); }
.about .eyebrow::before { background: var(--copper-light); }
.about-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin-top: 0.5rem;
}
.about-facts dt {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(238, 242, 239, 0.55);
  margin-bottom: 0.35em;
}
.about-facts dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: #fff;
  line-height: 1.4;
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.contact-list li {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.contact-list li:first-child { padding-top: 0; }
.contact-list svg { width: 22px; height: 22px; color: var(--copper); flex: none; margin-top: 0.15rem; }
.contact-list a { text-decoration: none; color: var(--navy); font-weight: 600; }
.contact-list a:hover { text-decoration: underline; }
.contact-list .label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25em;
}
.map-frame {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  overflow: hidden;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; filter: grayscale(0.35) contrast(1.05); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem 0;
  background: var(--paper-dim);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-legal {
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 46ch;
}
.footer-legal strong { color: var(--navy); }
.footer-links {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.85rem;
  color: var(--navy);
  text-decoration: none;
}
.footer-links a:hover { text-decoration: underline; }

/* ---- WhatsApp floating button ---- */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  padding: 0.85em 1.2em;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(10, 26, 41, 0.22);
  font-weight: 600;
  font-size: 0.88rem;
}
.wa-float svg { width: 1.2em; height: 1.2em; }
.wa-float:hover { background: #142e25; }

/* ---- Legal pages ---- */
.legal-page { padding: clamp(3rem, 6vw, 5rem) 0; }
.legal-page .wrap { max-width: 76ch; }
.legal-page h1 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); color: var(--navy); }
.legal-page h2 { font-size: 1.25rem; color: var(--navy); margin-top: 2em; }
.legal-page p, .legal-page li { color: var(--ink); opacity: 0.85; font-size: 0.98rem; }
.legal-page .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 2.5rem; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: flex; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-graphic { order: -1; aspect-ratio: 16/9; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .about .wrap { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { flex-direction: column; }
}

@media (max-width: 560px) {
  .services-grid { grid-template-columns: 1fr; }
  .about-facts { grid-template-columns: 1fr; }
}

nav.main-nav.open {
  display: flex;
  position: absolute;
  top: 76px;
  left: 0;
  right: 0;
  background: var(--paper);
  flex-direction: column;
  padding: 1.2rem var(--pad) 1.8rem;
  border-bottom: 1px solid var(--line);
  gap: 1.1rem;
}
