/* ============================================
   ELECSOL - Estilos
   Azul marino de base + amarillo de seguridad como acento
   ============================================ */

:root {
  --navy-900: #071A33;
  --navy-800: #0A2647;
  --navy-700: #144272;
  --blue-600: #205295;
  --blue-500: #2C74B3;
  --gold: #FDB813;
  --gold-dark: #E0A100;
  --ink: #15202B;
  --muted: #5B6676;
  --line: #E3E8EF;
  --bg-light: #F4F7FA;
  --white: #FFFFFF;
  --radius: 16px;
  --shadow-sm: 0 2px 10px rgba(10, 38, 71, .06);
  --shadow-md: 0 12px 32px rgba(10, 38, 71, .12);
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn { font-weight: 600; border-radius: 999px; padding: .7rem 1.5rem; transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1rem; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--navy-900); border: 0; box-shadow: 0 8px 20px rgba(253, 184, 19, .3); }
.btn-gold:hover { background: var(--gold-dark); color: var(--navy-900); }
.btn-danger { background: #DC3545; border: 0; }
.btn-whatsapp { background: #25D366; color: #fff; border: 0; }
.btn-whatsapp:hover { background: #1EBE5A; color: #fff; }

/* ---------- Navegación ---------- */
.site-header { background: rgba(7, 26, 51, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: box-shadow .3s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.navbar { min-height: var(--nav-h); padding: .5rem 0; }
.navbar-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.5rem; color: var(--white) !important; letter-spacing: .02em; }
.brand-logo i { color: var(--gold); font-size: 1.6rem; }
.navbar-toggler { border: 0; color: var(--white); font-size: 1.4rem; padding: .25rem .5rem; }
.navbar-toggler:focus { box-shadow: none; }
.nav-link { color: rgba(255, 255, 255, .85) !important; font-weight: 500; padding: .5rem .9rem !important; position: relative; }
.nav-link:hover, .nav-link.active { color: var(--gold) !important; }
.nav-cta { border-radius: 999px; border-color: rgba(255,255,255,.4); font-weight: 600; padding: .45rem 1rem; }
.nav-cta:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); color: var(--white); text-decoration: none; margin-left: .4rem; }
.btn-icon-wa { background: #25D366; }
@media (max-width: 991.98px) {
  .navbar-collapse { padding: .5rem 0 1rem; }
}

/* ---------- Hero con mosaico ---------- */
.hero {
  position: relative;
  min-height: clamp(460px, 60vh, 560px);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 36px) 0 84px;
  color: var(--white);
  overflow: hidden;
  background: var(--navy-900);
}
.hero-mosaic {
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
}
.hero-mosaic img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); }
.hero-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 26, 51, .97) 0%, rgba(7, 26, 51, .88) 42%, rgba(10, 38, 71, .55) 75%, rgba(10, 38, 71, .35) 100%),
    linear-gradient(0deg, rgba(7, 26, 51, .6) 0%, rgba(7, 26, 51, 0) 35%);
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center;
  font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold); background: rgba(253, 184, 19, .12); border: 1px solid rgba(253, 184, 19, .35);
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.hero-title { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; line-height: 1.12; margin-bottom: 1.1rem; letter-spacing: -.01em; }
.hero-title span { color: var(--gold); }
.hero-lead { font-size: clamp(1rem, 1.6vw, 1.15rem); color: rgba(255, 255, 255, .85); max-width: 560px; margin-bottom: 1.8rem; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.8rem; }
.hero-trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .92rem; color: rgba(255, 255, 255, .9); }
.hero-trust i { color: var(--gold); margin-right: .35rem; }
@media (max-width: 767.98px) {
  .hero-mosaic { grid-template-columns: repeat(2, 1fr); }
  .hero-mosaic img:nth-child(n+5) { display: none; }
  .hero-overlay { background: rgba(7, 26, 51, .86); }
}

/* ---------- Estadísticas (tarjeta sobre el hero) ---------- */
.stats-section { position: relative; z-index: 2; margin-top: -56px; }
.stats-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat { display: flex; align-items: center; gap: .9rem; padding: 1.4rem 1.5rem; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px; display: grid; place-items: center; background: rgba(253, 184, 19, .15); color: var(--gold-dark); font-size: 1.2rem; }
.stat-number { display: block; font-size: 1.6rem; font-weight: 800; color: var(--navy-800); line-height: 1.1; }
.stat-label { display: block; font-size: .85rem; color: var(--muted); }
@media (max-width: 991.98px) {
  .stats-card { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 420px) {
  .stat { padding: 1rem; gap: .6rem; }
  .stat-icon { width: 40px; height: 40px; flex-basis: 40px; }
  .stat-number { font-size: 1.3rem; }
}

/* ---------- Secciones ---------- */
.section { padding: 88px 0; }
.section-light { background: var(--bg-light); }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-kicker { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-600); margin-bottom: .5rem; }
.section-title { font-size: clamp(1.8rem, 3.2vw, 2.4rem); font-weight: 800; color: var(--navy-800); margin-bottom: .6rem; }
.section-subtitle { color: var(--muted); font-size: 1.05rem; margin: 0; }
.section-header::after { content: ""; display: block; width: 64px; height: 4px; border-radius: 4px; background: var(--gold); margin: 1.2rem auto 0; }
.section-header-dark .section-title { color: var(--white); }
.section-header-dark .section-subtitle { color: rgba(255, 255, 255, .8); }
.section-header-dark .section-kicker { color: var(--gold); }

/* ---------- Servicios ---------- */
.service-card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.service-card.featured { box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm); border-color: transparent; }
.service-card.featured:hover { box-shadow: 0 0 0 2px var(--gold), var(--shadow-md); }
.featured-badge { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--gold); color: var(--navy-900); font-size: .75rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; }
.service-media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-light); }
.service-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.service-card:hover .service-media img { transform: scale(1.06); }
.service-media-logo { background: var(--white); display: grid; place-items: center; padding: 1rem; }
.service-media-logo img { object-fit: contain; }
.service-body { position: relative; padding: 2.4rem 1.5rem 1.6rem; flex: 1; }
.service-icon {
  position: absolute; top: -26px; left: 1.5rem;
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--gold); color: var(--navy-900); font-size: 1.3rem;
  box-shadow: 0 8px 18px rgba(253, 184, 19, .35);
}
.service-title { font-size: 1.15rem; font-weight: 700; color: var(--navy-800); margin-bottom: .9rem; }
.service-list { list-style: none; padding: 0; margin: 0; }
.service-list li { position: relative; padding: .4rem 0 .4rem 1.6rem; color: var(--muted); font-size: .95rem; border-top: 1px dashed var(--line); }
.service-list li:first-child { border-top: 0; }
.service-list li::before { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; top: .45rem; color: var(--gold-dark); font-size: .85rem; }

/* ---------- Trabajos realizados (mosaico) ---------- */
.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 210px;
  grid-auto-flow: dense;
  gap: 14px;
}
.work { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: var(--navy-800); box-shadow: var(--shadow-sm); }
.work.tall { grid-row: span 2; }
.work img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s ease; }
.work::after { content: "\f00e"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(7, 26, 51, .75); color: var(--gold); opacity: 0; transition: opacity .3s ease; }
.work:hover img { transform: scale(1.06); opacity: .9; }
.work:hover::after, .work:focus-visible::after { opacity: 1; }
@media (max-width: 991.98px) { .works-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 190px; } }
@media (max-width: 575.98px) { .works-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; gap: 10px; } }

/* Escritorio: posición fija de cada foto para que el mosaico quede completo (4 x 4) */
@media (min-width: 992px) {
  .works-grid { grid-template-rows: repeat(4, 210px); grid-auto-flow: row; }
  .work:nth-child(1)  { grid-area: 1 / 1 / 3 / 2; }
  .work:nth-child(2)  { grid-area: 1 / 2 / 2 / 3; }
  .work:nth-child(3)  { grid-area: 1 / 3 / 2 / 4; }
  .work:nth-child(4)  { grid-area: 1 / 4 / 3 / 5; }
  .work:nth-child(5)  { grid-area: 2 / 3 / 4 / 4; }
  .work:nth-child(6)  { grid-area: 2 / 2 / 3 / 3; }
  .work:nth-child(7)  { grid-area: 3 / 1 / 5 / 2; }
  .work:nth-child(8)  { grid-area: 3 / 4 / 4 / 5; }
  .work:nth-child(9)  { grid-area: 4 / 4 / 5 / 5; }
  .work:nth-child(10) { grid-area: 3 / 2 / 5 / 3; }
  .work:nth-child(11) { grid-area: 4 / 3 / 5 / 4; }
}

.tools { margin-top: 56px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.tools-header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: 1.2rem; }
.tools-header h3 { font-size: 1.15rem; font-weight: 700; color: var(--navy-800); margin: 0; }
.tools-header h3 i { color: var(--gold-dark); }
.tools-header p { margin: 0; color: var(--muted); font-size: .92rem; }
.tools-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .4rem; }
.tools-strip img { flex: 0 0 auto; height: 120px; width: 120px; object-fit: contain; background: var(--bg-light); border-radius: 12px; padding: .5rem; scroll-snap-align: start; }

/* ---------- Beneficios ---------- */
.benefits-section { background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 60%, var(--blue-500) 120%); color: var(--white); }
.benefit-card { height: 100%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 2rem 1.6rem; transition: transform .25s ease, background-color .25s ease; }
.benefit-card:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .1); }
.benefit-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--gold); color: var(--navy-900); font-size: 1.4rem; margin-bottom: 1.2rem; }
.benefit-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .6rem; }
.benefit-card p { color: rgba(255, 255, 255, .8); margin: 0; }

/* ---------- Contacto ---------- */
.contact-panel { height: 100%; background: var(--navy-800); color: var(--white); border-radius: var(--radius); padding: 2rem; }
.contact-panel h3 { font-weight: 700; font-size: 1.5rem; }
.contact-panel > p { color: rgba(255, 255, 255, .8); margin-bottom: 1.5rem; }
.contact-details { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.contact-details li { display: flex; gap: .9rem; align-items: flex-start; }
.contact-details strong { display: block; font-size: .85rem; color: var(--gold); font-weight: 600; }
.contact-details a, .contact-details span { color: var(--white); text-decoration: none; overflow-wrap: anywhere; }
.contact-details a:hover { color: var(--gold); }
.contact-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--gold); }
.contact-form { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); height: 100%; }
.contact-form .form-label { font-weight: 600; font-size: .9rem; color: var(--navy-800); }
.contact-form .form-control { border-radius: 12px; border: 1px solid var(--line); background: var(--bg-light); padding: .75rem 1rem; }
.contact-form .form-control:focus { border-color: var(--blue-500); box-shadow: 0 0 0 .2rem rgba(44, 116, 179, .15); background: var(--white); }

/* ---------- WhatsApp flotante ---------- */
#whatsapp {
  position: fixed; right: 20px; bottom: 20px; z-index: 1030;
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff; font-size: 1.9rem; text-decoration: none;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .45);
  animation: pulse 2.4s infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); } 70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); } }

/* ---------- Visor de fotos ---------- */
.lightbox { position: fixed; inset: 0; z-index: 1060; background: rgba(4, 12, 24, .92); display: flex; align-items: center; justify-content: center; padding: 3rem 4rem; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.2rem; }
.lightbox button:hover { background: var(--gold); color: var(--navy-900); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-nav.prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 575.98px) { .lightbox { padding: 4rem .75rem; } .lightbox-nav { top: auto !important; bottom: 14px; transform: none !important; } }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(255, 255, 255, .8); }
.footer-brand { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.footer-brand i { color: var(--gold); }
.footer-text { font-size: .95rem; }
.footer-title { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.footer-links, .footer-contact { list-style: none; padding: 0; margin: 0; }
.footer-links li, .footer-contact li { margin-bottom: .55rem; font-size: .93rem; overflow-wrap: anywhere; }
.footer a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.footer a:hover { color: var(--gold); }
.footer-contact i { color: var(--gold); }
.social-links { display: flex; gap: .6rem; }
.social-links a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.social-links a:hover { background: var(--gold); color: var(--navy-900); }
.footer-divider { border-color: rgba(255, 255, 255, .12); margin: 2rem 0 1.2rem; opacity: 1; }
.footer-copyright { font-size: .85rem; color: rgba(255, 255, 255, .6); }

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