/* ============================================================
   AG Electrónica — Hoja de estilos
   Paleta según Manual de Marca 2023:
   Azul #1562EA · Cian #14D0EF · Blanco #F4F4F4 · Gris #292929
   Gradiente de marca: Cian → Azul
   Tipografía institucional: Archivo
   ============================================================ */
:root {
  --azul:        #1562EA;   /* azul de marca (botones, links, acentos)   */
  --azul-oscuro: #0E45A8;   /* sombra del azul de marca (hover, fondos)  */
  --azul-claro:  #14D0EF;   /* cian de marca (detalles, acentos)         */
  --negro:       #292929;   /* gris de marca (textos fuertes)            */
  --navy:        #1D1D1D;   /* fondos oscuros (footer, hero)             */
  --blanco:      #FFFFFF;
  --gris-fondo:  #F4F4F4;   /* blanco de marca (secciones alternas)      */
  --gris-borde:  #E4E4E4;
  --gris-texto:  #5C5C5C;

  --radius: 14px;
  --shadow: 0 4px 24px rgba(41, 41, 41, .08);
  --shadow-hover: 0 12px 32px rgba(41, 41, 41, .16);
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
:focus-visible { outline: 3px solid var(--azul-claro); outline-offset: 2px; border-radius: 4px; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--negro);
  background: var(--blanco);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--azul); text-decoration: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Barra superior ---------- */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar a { color: rgba(255,255,255,.85); transition: color .2s; }
.topbar a:hover { color: #fff; }
.topbar .item { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gris-borde);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; }
/* El manual pide un mínimo de 300 px de ancho para el isologotipo */
.brand img { width: 300px; max-width: 56vw; height: auto; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav > a {
  color: var(--negro); font-weight: 600; font-size: .93rem;
  padding: 9px 15px; border-radius: 8px; transition: all .2s;
}
.nav > a:hover { background: var(--gris-fondo); color: var(--azul); }
.nav > a.active { color: var(--azul); }
.nav .btn-nav {
  background: var(--azul); color: #fff; margin-left: 8px;
}
.nav .btn-nav:hover { background: var(--azul-oscuro); color: #fff; }

/* dropdown productos */
.nav-drop { position: relative; }
.nav-drop > a::after { content: ' ▾'; font-size: .7em; }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 12px;
  box-shadow: var(--shadow-hover); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .18s ease;
}
.nav-drop:hover .dropdown, .nav-drop:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a {
  display: block; padding: 9px 14px; border-radius: 8px;
  color: var(--negro); font-size: .88rem; font-weight: 500;
}
.dropdown a:hover { background: var(--gris-fondo); color: var(--azul); }

/* hamburguesa */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; background: var(--negro); margin: 5px 0; border-radius: 2px; transition: .25s; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul) 60%, var(--azul-claro) 145%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(20,208,239,.28), transparent 60%),
    radial-gradient(500px 400px at 10% 90%, rgba(20,208,239,.12), transparent 60%);
}
.hero .container {
  position: relative; display: flex; flex-direction: column; align-items: center;
  text-align: center; padding-top: 96px; padding-bottom: 96px;
}
.hero .container > div { max-width: 760px; }
.hero p { margin-left: auto; margin-right: auto; }
.hero-actions, .hero-stats { justify-content: center; }
.hero .eyebrow {
  display: inline-block; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 5px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 22px;
}
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.hero h1 span { color: var(--azul-claro); }
.hero h1, .section-head h2, .page-hero h1, .cta-band h2 { font-weight: 900; } /* Archivo Black para títulos */
.hero p { color: rgba(255,255,255,.78); font-size: 1.08rem; max-width: 540px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-img {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px; padding: 18px; backdrop-filter: blur(4px);
}
.hero-img img { border-radius: 12px; width: 100%; object-fit: cover; }
.hero-stats { display: flex; gap: 40px; margin-top: 42px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 1.7rem; font-weight: 800; }
.hero-stats .stat small { color: rgba(255,255,255,.65); font-size: .85rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 26px; border-radius: 10px; font-weight: 700; font-size: .95rem;
  transition: all .2s; border: 0; cursor: pointer; font-family: var(--font);
}
.btn-primary { background: var(--azul); color: #fff; box-shadow: 0 6px 18px rgba(21,98,234,.35); }
.btn-primary:hover { background: var(--azul-oscuro); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-outline { background: transparent; color: var(--azul); border: 1.5px solid var(--azul); }
.btn-outline:hover { background: var(--azul); color: #fff; }

/* ---------- Secciones ---------- */
.section { padding: 84px 0; }
.section.alt { background: var(--gris-fondo); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 52px; }
.section-head .kicker {
  color: var(--azul); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; display: block;
}
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.section-head p { color: var(--gris-texto); }

/* ---------- Grid categorías ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  padding: 28px 24px; text-align: center; transition: all .25s ease; position: relative; overflow: hidden;
}
.cat-card::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--azul); transform: scaleX(0); transition: transform .25s; transform-origin: left;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: transparent; }
.cat-card:hover::after { transform: scaleX(1); }
.cat-card img { height: 110px; width: auto; margin: 0 auto 18px; object-fit: contain; }
.cat-icon {
  width: 92px; height: 92px; border-radius: 26px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--azul);
  background: linear-gradient(135deg, rgba(10,77,211,.07), rgba(59,130,246,.18));
  transition: all .25s ease;
}
.cat-icon svg { width: 48px; height: 48px; }
.cat-icon .a { stroke: var(--azul-claro); }
.cat-icon .af { fill: var(--azul-claro); stroke: none; }
.cat-card:hover .cat-icon {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: #fff; transform: scale(1.06);
  box-shadow: 0 10px 24px rgba(10,77,211,.35);
}
.cat-card:hover .cat-icon .a { stroke: rgba(255,255,255,.8); }
.cat-card:hover .cat-icon .af { fill: rgba(255,255,255,.85); }
.cat-card h3 { font-size: 1.02rem; font-weight: 700; color: var(--negro); letter-spacing: .02em; }
.cat-card small { color: var(--gris-texto); font-size: .84rem; }

/* ---------- Cards de producto ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.prod-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: all .25s;
}
.prod-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.prod-card .ph { background: #fff; padding: 20px; height: 210px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--gris-borde); }
.prod-card .ph img { max-height: 170px; width: auto; object-fit: contain; }
.prod-card .pb { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prod-card .tag {
  align-self: flex-start; background: rgba(21,98,234,.08); color: var(--azul);
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
}
.prod-card h3 { font-size: .98rem; font-weight: 700; line-height: 1.4; flex: 1; }
.model {
  display: inline-block; font-weight: 800; color: var(--azul);
  letter-spacing: .02em;
}
.prod-detail .model {
  background: rgba(20,208,239,.12); border: 1px solid rgba(20,208,239,.4);
  padding: 2px 12px; border-radius: 8px; font-size: 1.05rem; margin-right: 6px;
}
.prod-card h3 a { color: var(--negro); }
.prod-card h3 a:hover { color: var(--azul); }
.prod-card .more { font-weight: 700; font-size: .88rem; }
.prod-card .more::after { content: ' →'; transition: margin .2s; }
.prod-card .more:hover::after { margin-left: 4px; }

/* ---------- Filtros catálogo ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 18px; }
.chip {
  background: #fff; border: 1.5px solid var(--gris-borde); color: var(--gris-texto);
  padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: .86rem;
  cursor: pointer; transition: all .2s; font-family: var(--font);
}
.chip:hover { border-color: var(--azul); color: var(--azul); }
.chip.active { background: var(--azul); border-color: var(--azul); color: #fff; }
.search-wrap { max-width: 460px; margin: 0 auto 40px; position: relative; }
.search-wrap input {
  width: 100%; padding: 13px 20px 13px 46px; border-radius: 999px;
  border: 1.5px solid var(--gris-borde); font-size: .95rem; font-family: var(--font);
  outline: none; transition: border .2s; background: #fff;
}
.search-wrap input:focus { border-color: var(--azul); }
.search-wrap svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--gris-texto); }
.no-results { text-align: center; color: var(--gris-texto); padding: 40px 0; display: none; }

/* ---------- Página de producto ---------- */
.breadcrumb { font-size: .85rem; color: var(--gris-texto); margin-bottom: 28px; }
.breadcrumb a { color: var(--gris-texto); }
.breadcrumb a:hover { color: var(--azul); }
.prod-detail { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.prod-detail .photo {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  padding: 30px; display: flex; align-items: center; justify-content: center;
  position: sticky; top: 96px;
}
.prod-detail .photo img { max-height: 420px; width: auto; object-fit: contain; }
.prod-detail h1 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 800; letter-spacing: -.01em; line-height: 1.3; margin: 6px 0 18px; }
.prod-detail .tag {
  display: inline-block; background: rgba(10,77,211,.08); color: var(--azul);
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.prod-desc { color: #333; }
.prod-desc p { margin-bottom: 14px; }
.prod-desc ul, .prod-desc ol { margin: 0 0 14px 22px; }
.prod-desc li { margin-bottom: 6px; }
.prod-desc img { margin: 18px auto; border-radius: 10px; border: 1px solid var(--gris-borde); }
.prod-desc table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .9rem; }
.prod-desc td, .prod-desc th { border: 1px solid var(--gris-borde); padding: 8px 12px; }
.prod-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--gris-borde); }

/* ---------- Franja CTA ---------- */
/* Gradiente de marca: cian → azul */
.cta-band { background: linear-gradient(120deg, var(--azul-claro), var(--azul) 65%); color: #fff; }
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 56px; padding-bottom: 56px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 800; margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.8); }
.cta-band .btn-primary { background: #fff; color: var(--azul); box-shadow: none; }
.cta-band .btn-primary:hover { background: var(--gris-fondo); transform: translateY(-2px); }

/* ---------- Empresa ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-grid .txt p { color: var(--gris-texto); margin-bottom: 16px; font-size: 1.02rem; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.feature {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: 12px;
  padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; transition: all .2s;
}
.feature:hover { box-shadow: var(--shadow); border-color: rgba(10,77,211,.35); }
.feature .ico {
  flex: 0 0 36px; height: 36px; border-radius: 9px; background: rgba(10,77,211,.1);
  display: flex; align-items: center; justify-content: center; color: var(--azul); font-size: 1rem;
}
.feature p { font-size: .9rem; font-weight: 600; color: var(--negro); line-height: 1.45; }

/* ---------- Distribuidores ---------- */
.prov-title { font-size: 1.05rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--azul); margin: 42px 0 18px; display: flex; align-items: center; gap: 12px; }
.prov-title::after { content: ''; flex: 1; height: 1px; background: var(--gris-borde); }
.dist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dist-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  padding: 22px 24px; transition: all .25s;
}
.dist-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.dist-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; color: var(--negro); }
.dist-card p { font-size: .88rem; color: var(--gris-texto); margin-bottom: 4px; display: flex; gap: 8px; align-items: baseline; }
.dist-card a { font-size: .88rem; word-break: break-all; }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.contact-info .card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  padding: 26px 28px; margin-bottom: 18px;
}
.contact-info h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 14px; }
.contact-info p { color: var(--gris-texto); font-size: .95rem; margin-bottom: 10px; display: flex; gap: 10px; align-items: baseline; }
.contact-info .ico { color: var(--azul); width: 18px; text-align: center; }
.form-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius); padding: 32px;
}
.form-card label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.form-card input, .form-card textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--gris-borde); border-radius: 10px;
  font-family: var(--font); font-size: .95rem; margin-bottom: 18px; outline: none; transition: border .2s;
  background: var(--gris-fondo);
}
.form-card input:focus, .form-card textarea:focus { border-color: var(--azul); background: #fff; }
.form-card textarea { min-height: 140px; resize: vertical; }
.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--gris-borde); margin-top: 48px; }
.map-wrap iframe { display: block; width: 100%; height: 380px; border: 0; }

/* ---------- Page hero (interior) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--azul-oscuro), var(--azul) 80%);
  color: #fff; padding: 64px 0 56px; position: relative; overflow: hidden;
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(500px 250px at 90% 10%, rgba(20,208,239,.3), transparent 60%);
}
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; letter-spacing: -.02em; }
.page-hero p { color: rgba(255,255,255,.75); margin-top: 8px; max-width: 620px; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: rgba(255,255,255,.72); padding: 64px 0 0; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer h4 { color: #fff; font-size: .95rem; font-weight: 700; margin-bottom: 18px; letter-spacing: .04em; text-transform: uppercase; }
.footer a { color: rgba(255,255,255,.72); transition: color .2s; }
.footer a:hover { color: #fff; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }
.footer .flogo { margin-bottom: 18px; }
.footer .flogo img { width: 300px; max-width: 100%; height: auto; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; font-size: .82rem;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* ---------- Circuito animado del hero ---------- */
.hero-circuit { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-circuit .trace { stroke: rgba(255,255,255,.14); }
.hero-circuit .pulse {
  stroke: var(--azul-claro); stroke-linecap: round;
  stroke-dasharray: 60 940; stroke-dashoffset: 1000;
  animation: circuit-flow 7s linear infinite;
  filter: drop-shadow(0 0 6px rgba(20,208,239,.9));
}
.hero-circuit .p2 { animation-delay: 1.8s; }
.hero-circuit .p3 { animation-delay: 3.2s; animation-duration: 9s; }
.hero-circuit .p4 { animation-delay: 5s; animation-duration: 8s; }
@keyframes circuit-flow { to { stroke-dashoffset: -1000; } }
.hero-circuit .nodes circle { fill: rgba(255,255,255,.35); animation: node-blink 3.5s ease-in-out infinite; }
.hero-circuit .nodes circle:nth-child(2n) { animation-delay: 1.2s; }
.hero-circuit .nodes circle:nth-child(3n) { animation-delay: 2.1s; }
@keyframes node-blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* ---------- Scrollytelling: protector en acción ---------- */
.scrolly { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.scrolly-graphic { position: sticky; top: 105px; }
.demo-box {
  background: linear-gradient(160deg, #10233f, #0b1830);
  border-radius: 20px; padding: 26px 18px; box-shadow: var(--shadow-hover);
}
.demo-box svg { width: 100%; height: auto; display: block; }
.demo-box text { font-family: var(--font); }
.demo-box .badge { font-size: 19px; font-weight: 800; letter-spacing: .04em; opacity: 0; transition: opacity .45s; }
.demo-box .badge-1 { fill: #4ADE80; }
.demo-box .badge-2 { fill: #F87171; }
.demo-box .badge-3 { fill: var(--azul-claro); }
.demo-box .wave { stroke-width: 3.5; stroke-linecap: round; transition: opacity .45s; filter: drop-shadow(0 0 5px rgba(20,208,239,.6)); }
.demo-box .wave-normal { stroke: var(--azul-claro); stroke-dasharray: 300; animation: wave-flow 2.4s linear infinite; }
.demo-box .wave-spike { stroke: #F87171; opacity: 0; filter: drop-shadow(0 0 6px rgba(248,113,113,.8)); }
@keyframes wave-flow { from { stroke-dashoffset: 300; } to { stroke-dashoffset: 0; } }
.demo-box .module rect { fill: #F4F4F4; stroke: #C7CDD8; stroke-width: 2; }
.demo-box .module .term { fill: #9AA3B2; stroke: none; }
.demo-box .mlogo { font-size: 34px; font-weight: 900; fill: var(--negro); }
.demo-box .mname { font-size: 13px; font-weight: 700; letter-spacing: .18em; fill: #6B7280; }
.demo-box .mlabel { font-size: 10px; font-weight: 700; letter-spacing: .08em; fill: #6B7280; }
.demo-box .led { transition: fill .3s; }
.demo-box .led-ok { fill: #22C55E; filter: drop-shadow(0 0 6px rgba(34,197,94,.9)); animation: node-blink 2.2s ease-in-out infinite; }
.demo-box .led-cut { fill: #57534E; }
.demo-box .out-closed path, .demo-box .out-open path { stroke: var(--azul-claro); stroke-width: 3.5; stroke-linecap: round; }
.demo-box .out-open { opacity: 0; }
.demo-box .out-open circle { fill: #F4F4F4; }
.demo-box .out-closed, .demo-box .out-open { transition: opacity .45s; }
.demo-box .device circle { fill: none; stroke: #F4F4F4; stroke-width: 3; transition: stroke .45s; }
.demo-box .device text { font-size: 22px; font-weight: 800; fill: #F4F4F4; transition: fill .45s; }

/* Estados del demo */
#demo[data-state="1"] .badge-1 { opacity: 1; }
#demo[data-state="2"] .badge-2 { opacity: 1; animation: node-blink .8s ease-in-out infinite; }
#demo[data-state="2"] .wave-normal { opacity: 0; }
#demo[data-state="2"] .wave-spike { opacity: 1; }
#demo[data-state="2"] .led-cut { fill: #EF4444; filter: drop-shadow(0 0 7px rgba(239,68,68,.9)); animation: node-blink .5s ease-in-out infinite; }
#demo[data-state="3"] .badge-3 { opacity: 1; }
#demo[data-state="3"] .wave-normal { opacity: 0; }
#demo[data-state="3"] .wave-spike { opacity: 1; }
#demo[data-state="3"] .out-closed { opacity: 0; }
#demo[data-state="3"] .out-open { opacity: 1; }
#demo[data-state="3"] .led-cut { fill: #EF4444; filter: drop-shadow(0 0 7px rgba(239,68,68,.9)); }
#demo[data-state="3"] .device circle { stroke: #4ADE80; filter: drop-shadow(0 0 8px rgba(74,222,128,.7)); }
#demo[data-state="3"] .device text { fill: #4ADE80; }

.scrolly-steps .step { min-height: 58vh; display: flex; align-items: center; }
.step-card {
  background: #fff; border: 1px solid var(--gris-borde); border-radius: var(--radius);
  padding: 30px 32px; opacity: .35; transform: translateY(10px);
  transition: opacity .4s, transform .4s, box-shadow .4s;
}
.step.active .step-card { opacity: 1; transform: none; box-shadow: var(--shadow-hover); border-color: rgba(21,98,234,.35); }
.step-num { font-size: .85rem; font-weight: 800; color: var(--azul-claro); letter-spacing: .15em; }
.step-card h3 { font-size: 1.25rem; font-weight: 800; margin: 6px 0 10px; }
.step-card p { color: var(--gris-texto); }

@media (max-width: 980px) {
  .scrolly { grid-template-columns: 1fr; gap: 24px; }
  .scrolly-graphic { top: 88px; z-index: 5; }
  .scrolly-steps .step { min-height: 46vh; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-circuit .pulse, .hero-circuit .nodes circle, .demo-box .wave-normal,
  .demo-box .led-ok, #demo[data-state="2"] .badge-2, #demo[data-state="2"] .led-cut { animation: none; }
}

/* ---------- WhatsApp ---------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.45); transition: transform .2s, box-shadow .2s;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 12px 30px rgba(37,211,102,.55); }
.wa-float img { display: block; }
.btn-wa { background: #25D366; color: #fff; box-shadow: 0 6px 18px rgba(37,211,102,.35); }
.btn-wa:hover { background: #1EBE5A; transform: translateY(-2px); color: #fff; }
.btn-wa img { display: inline-block; }

/* ---------- Animación de aparición ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 64px; padding-bottom: 64px; }
  .hero-img { display: none; }
  .cat-grid, .prod-grid, .dist-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid, .prod-detail { grid-template-columns: 1fr; }
  .prod-detail .photo { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav {
    position: fixed; inset: 72px 0 auto 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 12px 20px 20px; gap: 2px; border-bottom: 1px solid var(--gris-borde);
    box-shadow: var(--shadow-hover); display: none;
  }
  .nav.open { display: flex; }
  .nav > a { padding: 13px 14px; }
  .nav .btn-nav { margin: 8px 0 0; text-align: center; justify-content: center; }
  .nav-toggle { display: block; }
  .nav-drop .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 16px; display: none; }
  .nav-drop.open .dropdown { display: block; }
  .cat-grid, .prod-grid, .dist-grid, .feature-list, .footer-grid { grid-template-columns: 1fr; }
  .topbar .container { justify-content: center; }
  .section { padding: 56px 0; }
}
