html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}


:root{
  --blue-900:#0a2a5e;
  --blue-800:#123a7a;
  --blue-700:#1a4b99;
  --accent:#00b5ff;
  --muted:#6b7280;
  --bg:#f7f9fc;
}
*{box-sizing:border-box}
body{margin:0;font-family:Segoe UI, Arial, sans-serif;color:var(--blue-900);background:var(--bg);line-height:1.6}
.hero{position:relative;min-height:52vh;display:flex;align-items:center;justify-content:center;background-size:cover;background-position:center center;}
.hero .overlay{position:relative;width:100%;max-width:1100px;padding:2rem;background:linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.45));border-radius:12px;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.08)}
.hero h1{margin:0;font-weight:800;font-size:clamp(1.4rem,3.6vw,2.2rem);color:var(--blue-900)}
.hero h2{margin:.5rem 0 0;font-style:italic;color:var(--blue-800)}
.navbar{position:sticky;top:0;z-index:1000}
/* --- Anchor offset robust fix (applies to all pages) --- */
:root { --nav-offset: 180px; }
html { scroll-padding-top: var(--nav-offset); }
[id] { scroll-margin-top: var(--nav-offset); }
:target::before { content: ""; display: block; height: var(--nav-offset); margin-top: calc(-1 * var(--nav-offset)); }
/* --- End anchor offset fix --- */

.nav-row{display:flex;justify-content:center;gap:1rem;padding:.45rem 1rem}
.nav-row.primary{background:var(--blue-800);color:#fff}
.nav-row.secondary{background:var(--blue-700);color:#fff}
.nav-row.tertiary { background-color: #004080; color: white; }
.nav-row a{color:#fff;text-decoration:none;font-weight:700;padding:.45rem .6rem}
.nav-row a:hover{text-decoration:underline}
.section{padding:3rem 6vw}
.section .section-title{text-align:center;color:var(--blue-900);margin:0 0 1rem;font-size:1.6rem;font-weight:800}
.about{display:grid;grid-template-columns:1fr 240px;gap:2rem;align-items:center;max-width:1100px;margin:0 auto}
.about p{margin:0 0 1rem;text-align:justify;color:#1f2a37}
.about-logo img{width:120px;display:block;margin-left:auto}
.grid{display:grid;gap:1.2rem;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));max-width:1100px;margin:0 auto}
.card{background:#fff;border-radius:12px;padding:1.2rem;border:1px solid rgba(0,0,0,.06);box-shadow:0 8px 24px rgba(0,0,0,.06);display:flex;flex-direction:column;align-items:center;transition:transform .28s cubic-bezier(.2,.9,.2,1), box-shadow .28s}
.card:hover{transform:translateY(-6px) scale(1.02);box-shadow:0 18px 40px rgba(0,0,0,.12)}
.card .icon{font-size:2.4rem;margin-bottom:.6rem}
.card h3{color:var(--blue-900);margin:0 0 .6rem;text-align:center;min-height:3.2em;display:flex;align-items:flex-end;justify-content:center}
.card p{margin:0;color:var(--muted);text-align:center}
.results{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:1rem;max-width:1100px;margin:0 auto}
.result-box{border-radius:12px;padding:1.2rem;color:#fff;text-align:center;box-shadow:0 10px 30px rgba(0,0,0,.08)}
.result-box.blue{background:linear-gradient(180deg,var(--blue-700),var(--blue-900))}
.result-box .num{font-weight:900;font-size:1.4rem;display:block}
.cases{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;max-width:1200px;margin:0 auto}
@media(max-width:1100px){.cases{grid-template-columns:repeat(3,1fr)}}
@media(max-width:800px){.cases{grid-template-columns:repeat(2,1fr)}}
.case-card{background:#fff;border-radius:12px;overflow:hidden;border:1px solid rgba(0,0,0,.06);transition:transform .28s, box-shadow .28s}
.case-card img{width:100%;height:180px;object-fit:cover;display:block}
.case-card .content{padding:.8rem;text-align:center}
.case-card:hover{transform:translateY(-6px) scale(1.02);box-shadow:0 18px 40px rgba(0,0,0,.12)}
.contact{display:flex;justify-content:center;padding:2.5rem}
.btn-primary{background:var(--blue-700);color:#fff;padding:1rem 2rem;border-radius:999px;text-decoration:none;font-weight:800;font-size:1.1rem;box-shadow:0 10px 30px rgba(0,0,0,.12);display:inline-block;transition:transform .2s}
.btn-primary:hover{transform:translateY(-4px);background:var(--blue-600)}
.privacy{max-width:900px;margin:0 auto;text-align:left;padding:0 1rem}
.privacy h3{color:#000}
footer{background:var(--blue-900);color:#fff;text-align:center;padding:1.6rem;margin-top:2rem}
footer a{color:#9ddcff;text-decoration:underline}
.center{text-align:center}

/* v9 mobile navbar compaction */
@media(max-width:768px){
  .navbar .nav-row{min-height:44px;padding:.25rem .5rem;gap:.5rem}
  .navbar .nav-row a{padding:.25rem .4rem;font-size:.92rem}
  .navbar .nav-row.tertiary a{font-size:.85rem;white-space:nowrap}
}

/* Anchor scroll offset so titles are visible under sticky nav */
.section .section-title{scroll-margin-top:var(--nav-offset, 140px)}

/* Mobile about layout: logo above text, centered */
@media(max-width:768px){
  .about{grid-template-columns:1fr;text-align:center}
  .about .about-logo{order:-1;display:flex;justify-content:center}
  .about .about-logo img{margin:0 auto}
}

/* Energia: 5-up grid on wide screens */
@media(min-width:1100px){
  #soluciones .grid{grid-template-columns:repeat(5,1fr)}
}

.nav-row.primary{background:var(--blue-800)!important;color:#fff}

.unit-box {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 20px;
  border-radius: 10px;
  background: #f0f6ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.unit-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.unit-box h3, .unit-box p {
  text-decoration: none;
}

.energia-description {
  color: #003366;
  font-weight: 600;
}

.inversiones-description {
  color: #003366;
  font-weight: 600;
}

.consultoria-description {
  color: #003366;
  font-weight: 600;
}

@media (max-width: 768px) {
  .main-title {
    font-size: 1.4em;
    font-weight: bold;
  }
  .subtitle {
    font-size: 0.9em;
  }
  .navbar .nav-row {
    min-height: 40px;
    height: 40px;
  }
}


/* Remove underline from boxes */
.business-unit a, .business-unit h3, .business-unit p {
  text-decoration: none;
}

/* Slight blue shading background for business unit boxes */
.business-unit {
  background-color: #f0f6ff;
  border: 1px solid #004080;
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.business-unit:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.6em;
    font-weight: bold;
  }
  .hero-subtitle {
    font-size: 0.9em;
  }
}

/* Dark blue bolder text for descriptions */
.description-text {
  color: #002b5c;
  font-weight: 600;
}

/* Section titles bolder */
section h2, section h3 {
  font-weight: 700;
}

/* Navbar buttons - remove filled blue boxes */
.navbar a {
  background: none !important;
  border: none !important;
  color: #002b5c;
  font-weight: 500;
}

/* Ensure 3rd row in energia has blue background */
.energia-nav-row {
  background-color: #004080;
  color: white;
}


/* Button bar text updates */
.navbar a, .button-bar a {
  color: white !important;
  text-decoration: none !important;
  transition: transform 0.2s ease, color 0.2s ease;
}
.navbar a:hover, .button-bar a:hover {
  transform: scale(1.05);
  color: #cce4ff !important;
}

/* Escríbenos button style same as Contact page */
.escribenos-btn {
  background-color: #0056b3;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s ease;
}
.escribenos-btn:hover {
  background-color: #003f80;
}

/* Footer cleanup */
footer {
  background-color: #003366;
  color: white;
  text-align: center;
  padding: 20px 10px;
  font-size: 14px;
}
footer a {
  color: white;
  text-decoration: none;
}

/* v9h-aos-v3: Navbar/button-bar links plain, white, no boxes */
.navbar a, .button-bar a, .button-row a {
  background: transparent !important;
  border: none !important;
  text-decoration: none !important;
  color: #ffffff !important;
}
.navbar a:hover, .button-bar a:hover, .button-row a:hover {
  text-decoration: none !important;
}

/* v9h-aos-v3: Footer privacy link color */
footer a { color: #69b4ff !important; }


/* Fix underline removal */
.business-box u, .business-box h3 u, .business-box p u {
  text-decoration: none;
}

/* Add dark blue outline to Unidades de Negocio boxes */
.styled-box {
  border: 2px solid #003366;
  border-radius: 8px;
  padding: 20px;
}

/* Fix button bars: remove box styles */
.navbar a, .button-bar a {
  border: none !important;
  background: transparent !important;
}

/* Mobile version font adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8em;
    font-weight: bold;
  }
  .hero-subtitle {
    font-size: 1em;
  }
}

/* Prevent section title overlap for anchor links */
section {
  scroll-margin-top: 120px;
}


/* --- Inicio page nav buttons: remove boxes --- */
.inicio .navbar .nav-row a {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

/* --- Inicio: Unidades de Negocio boxes styling & remove underline --- */
.card-link, .card-link * {
  text-decoration: none !important;
}
.card {
  border: 2px solid #002b5c;
  background: #f8fbff;
}

/* --- Mobile hero sizing (Inicio only) --- */
@media (max-width: 768px) {
  .inicio .hero h1 { font-size: 1.6rem; font-weight: 800; }
  .inicio .hero h2 { font-size: 1.0rem; font-weight: 600; }
}

/* --- Energia: ensure anchor offset so titles are visible when clicking from top --- */
#soluciones, #resultados, #casos {
  scroll-margin-top: 180px;
}


/* ===== Modern corporate card/box style (applied globally) ===== */
.card, .business-box, .solution-card, .service-card, .unit-box, .inv-card {
  background: #ffffff;
  border: 1px solid rgba(10,42,94,0.12);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(10,42,94,0.08);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover, .business-box:hover, .solution-card:hover, .service-card:hover, .unit-box:hover, .inv-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(10,42,94,0.12);
  border-color: rgba(10,42,94,0.2);
}

.card a, .business-box a, .solution-card a, .service-card a, .unit-box a, .inv-card a {
  text-decoration: none;
}

/* Icons/emoji inside cards */
.card .icon, .business-box .icon, .solution-card .icon, .service-card .icon, .unit-box .icon, .inv-card .icon {
  font-size: 2rem;
  display: inline-block;
  margin-bottom: .25rem;
  text-decoration: none !important;
}

/* Remove any underline from headings/paragraphs inside boxes */
.card h3, .card p,
.business-box h3, .business-box p,
.solution-card h3, .solution-card p,
.service-card h3, .service-card p,
.unit-box h3, .unit-box p,
.inv-card h3, .inv-card p {
  text-decoration: none !important;
}

/* Slightly shaded blue background container variation used previously */
.box-surface {
  background: linear-gradient(0deg, rgba(229,239,255,0.55), rgba(229,239,255,0.55));
  border-radius: 16px;
  padding: 1rem;
}

/* ===== Inicio navbar: ensure NO boxes around nav links (match Inversiones) ===== */
body.inicio .navbar .nav-row a {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
}
body.inicio .navbar .nav-row a:hover {
  transform: translateY(-1px);
}

/* ===== Unidades de Negocio: remove any underline from link and its children ===== */
.card-link, .card-link * { text-decoration: none !important; }

/* ===== Mobile hero sizing (Inicio) ===== */
@media (max-width: 768px) {
  body.inicio .hero h1 { font-size: 1.6rem; font-weight: 800; }
  body.inicio .hero h2 { font-size: 1rem; font-weight: 600; }
}

/* Clean underline on navbar links all states */
.navbar a, .navbar a:visited, .navbar a:active, .navbar a:hover, .navbar a:focus {
  text-decoration: none !important;
}

/* Ensure target sections leave room for sticky bars (Energia) */
#soluciones, #resultados, #casos, #casos-de-exito, #casos_de_exito {
  scroll-margin-top: 190px;
}
section[id] { scroll-margin-top: 150px; }


/* Hero Title (Inicio page) */
.hero-title-main {
  font-size: 3rem;
  font-weight: bold;
  color: white;
}
@media (max-width: 768px) {
  .hero-title-main {
    font-size: 1.8rem;
    font-weight: bold;
  }
  .overlay h1 {
    font-size: 1.2rem;
  }
}

/* Fix jump-to-section overlap */
.scroll-section {
  scroll-margin-top: 100px; /* Adjust to navbar height */
}

/* Mobile: make section titles and box titles bold */
@media (max-width: 768px) {
  section h2, section h3, .box h3, .box h2 {
    font-weight: bold !important;
  }
}

/* Ensure anchor targets account for sticky nav height */
#overview, #soluciones, #resultados, #casos { scroll-margin-top: calc(var(--nav-offset, 0px) + 12px); }

/* Energia description spacing aligned to Consultoría */
body.page-energia #overview .center { margin: 0 auto; } /* remove extra top spacing */

/* Reduce spacing between Energia sections */
body.page-energia .section { margin: 40px 0; }

/* Mobile hero title sizing & spacing */
@media (max-width: 768px){
  .overlay .hero-title-main{
    font-weight: 800;
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 0.25rem;
  }
  /* site title directly after main title slightly smaller */
  .overlay .hero-title-main + h1{
    font-size: clamp(1.2rem, 5.5vw, 1.6rem);
    margin-top: 0.15rem;
  }
  /* Make section titles and card titles bold for mobile */
  .section-title{ font-weight: 800; }
  .card h3{ font-weight: 700; }
  /* Keep Consultoría site title to one line on mobile */
  body.page-consultoria .overlay h1:last-of-type{ white-space: nowrap; }
}
