/* ==========================================================
   styles.css — tema oscuro industrial. Mobile-first.
   ========================================================== */
:root {
  --bg: #0b0d10;
  --bg2: #10141a;
  --surface: #161b22;
  --surface2: #1d242d;
  --line: #2a323d;
  --text: #e8ecf1;
  --muted: #a3adba;
  --accent: #f7931a;
  --accent-dark: #c9740a;
  --green: #3ddc84;
  --red: #ff6b6b;
  --radius: 14px;
  --max: 1180px;
  --font-title: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); line-height: 1.6; font-size: 1rem;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: .6rem 1rem; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }
section { padding: 4.5rem 0; position: relative; }
.section-alt { background: var(--bg2); border-block: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-family: var(--font-title); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: .6rem; display: block; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.section-head { margin-bottom: 2.2rem; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1.5px solid transparent; cursor: pointer; font: inherit; font-weight: 600; transition: transform .15s, background .15s, border-color .15s; min-height: 44px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { background: #ffa73d; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: .55rem .9rem; font-size: .9rem; min-height: 40px; }
.btn-wa { background: #25d366; color: #05220f; }

/* Header */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; background: rgba(11,13,16,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; }
.logo svg { width: 34px; height: 34px; }
.logo img { height: 40px; width: auto; display: block; }
@media (max-width: 480px) { .logo img { height: 34px; } }
.menu-btn { background: none; border: 1px solid var(--line); color: var(--text); width: 44px; height: 44px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: var(--text); position: relative; content: ""; transition: .2s; }
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }
.nav { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--line); display: none; flex-direction: column; padding: 1rem 1.1rem 1.4rem; gap: .2rem; max-height: calc(100vh - 64px); overflow-y: auto; }
.nav.open { display: flex; }
.nav a { color: var(--text); text-decoration: none; padding: .75rem .4rem; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: var(--accent); }
.nav .btn { margin-top: .6rem; color: #111; }
.nav .btn:hover { color: #111; }

/* Hero */
.hero { padding: 8.5rem 0 4rem; overflow: hidden; background:
  radial-gradient(900px 400px at 85% 10%, rgba(247,147,26,.14), transparent 60%), var(--bg); }
.hero::before { content: ""; position: absolute; inset: 0; background-image:
  linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .22; mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 95%); }
.hero-grid { position: relative; display: grid; gap: 2.5rem; align-items: center; }
.hero h1 em { font-style: normal; color: var(--accent); }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-art { max-width: 420px; margin-inline: auto; width: 100%; }
.live { position: relative; display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: 3rem; }
.live > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.live dt { color: var(--muted); font-size: .85rem; }
.live dd { margin: 0; font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; text-align: right; }
.live .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: .4rem; box-shadow: 0 0 8px var(--green); }

/* Tarjetas / grids */
.grid { display: grid; gap: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; transition: border-color .2s, transform .2s; }
.card:hover { border-color: #3a4554; }
.servicio .ico { width: 48px; height: 48px; color: var(--accent); background: rgba(247,147,26,.1); border-radius: 12px; padding: 10px; margin-bottom: 1rem; }
.servicio ul, .check { list-style: none; padding: 0; margin: 0 0 1.2rem; color: var(--muted); }
.servicio li, .check li { padding-left: 1.4rem; position: relative; margin-bottom: .35rem; }
.servicio li::before, .check li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }

/* Catálogo */
.filters { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.6rem; }
.field { display: flex; flex-direction: column; gap: .35rem; flex: 1 1 180px; }
label, .label { font-size: .88rem; color: var(--muted); font-weight: 500; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; font: inherit; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(247,147,26,.4); }
textarea { resize: vertical; min-height: 110px; }
.equipo-top { display: flex; justify-content: space-between; margin-bottom: .8rem; }
.tag { font-size: .75rem; padding: .2rem .6rem; border-radius: 99px; background: var(--surface2); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.tag-ok { color: var(--green); border-color: rgba(61,220,132,.35); }
.tag-warn { color: #ffc266; border-color: rgba(255,194,102,.35); }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.specs div { background: var(--bg); border-radius: 10px; padding: .6rem .75rem; }
.specs dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.specs dd { margin: 0; font-weight: 600; }
.disp { color: var(--muted); font-size: .9rem; margin-bottom: .3rem; }
.precio { font-family: var(--font-title); font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.card-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.vacio { color: var(--muted); }

/* Calculadora */
.calc { display: grid; gap: 1.4rem; }
.calc-form, .calc-res { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.calc-form { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.calc-form small { color: var(--muted); font-size: .78rem; }
.res-row { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.res-row:last-of-type { border-bottom: 0; }
.res-row span:first-child { color: var(--muted); }
.res-row strong { font-family: var(--font-title); text-align: right; }
.res-big strong { font-size: 1.5rem; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.aviso { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--accent); padding-left: .8rem; margin-top: 1rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 1rem; }
.timeline li { counter-increment: paso; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem 1.2rem 4.2rem; position: relative; }
.timeline li::before { content: counter(paso); position: absolute; left: 1.1rem; top: 1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--accent); color: #111; font-family: var(--font-title); font-weight: 700; display: grid; place-items: center; }
.timeline h3 { margin-bottom: .3em; }
.timeline p { color: var(--muted); margin: 0; }
.nota { margin-top: 1.6rem; padding: 1rem 1.2rem; border: 1px dashed var(--accent); border-radius: var(--radius); background: rgba(247,147,26,.06); }

/* Por qué */
.why .num { font-family: var(--font-title); font-size: 2rem; color: var(--accent); font-weight: 700; }
.why p { color: var(--muted); margin: 0; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: .8rem; }
summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; min-height: 44px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
details[open] summary::after { content: "−"; }
details > div { padding: 0 1.2rem 1.1rem; color: var(--muted); }

/* Contacto */
.contact { display: grid; gap: 2rem; }
.form { display: grid; gap: 1rem; }
.contact-info a { word-break: break-word; }
.social { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; margin: 1rem 0 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 3rem 0 6rem; background: var(--bg2); color: var(--muted); font-size: .92rem; }
.footer-grid { display: grid; gap: 2rem; }
.footer h4 { color: var(--text); font-size: 1rem; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .4rem; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--accent); }
.legal { margin-top: 2rem; padding-top: 1.4rem; border-top: 1px solid var(--line); font-size: .85rem; }

/* WhatsApp flotante */
.wa-float { position: fixed; right: 16px; bottom: 16px; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; z-index: 60; box-shadow: 0 6px 24px rgba(0,0,0,.5); transition: transform .2s; }
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; }

/* Artículos (aprende.html) */
.page-head { padding: 8rem 0 2rem; }
.toc { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.4rem 0 0; padding: 0; list-style: none; }
.toc a { display: block; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.article { max-width: 760px; margin: 0 auto 3rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.article h2 { margin-top: 0; }
.article h3 { margin-top: 1.8rem; color: var(--accent); }
.article li { margin-bottom: .45rem; color: #cfd6df; }
.article p { color: #cfd6df; }
.callout { background: var(--surface); border-left: 4px solid var(--accent); padding: 1rem 1.2rem; border-radius: 0 12px 12px 0; margin: 1.4rem 0; color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .92rem; display: block; overflow-x: auto; }
th, td { text-align: left; padding: .6rem .8rem; border: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface2); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .wa-float, .card { transition: none; }
  .btn:hover, .wa-float:hover { transform: none; }
  .rack-led { animation: none !important; }
}
.rack-led { animation: blink 2.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* Tablet */
@media (min-width: 640px) {
  .live { grid-template-columns: repeat(3, 1fr); }
  .live > div { flex-direction: column; align-items: flex-start; }
  .live dd { text-align: left; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-form { grid-template-columns: 1fr 1fr; }
  .calc-form .full { grid-column: 1 / -1; }
}
/* Escritorio */
@media (min-width: 960px) {
  section { padding: 6rem 0; }
  .menu-btn { display: none; }
  .nav { position: static; display: flex; flex-direction: row; align-items: center; background: none; border: 0; padding: 0; gap: .1rem; max-height: none; overflow: visible; }
  .nav a { padding: .5rem .7rem; font-size: .93rem; }
  .nav .btn { margin: 0 0 0 .6rem; }
  .hero-grid { grid-template-columns: 1.2fr .8fr; }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .calc { grid-template-columns: 1.1fr .9fr; align-items: start; }
  .timeline { grid-template-columns: repeat(5, 1fr); }
  .timeline li { padding: 4rem 1.1rem 1.2rem; }
  .timeline li::before { left: 1.1rem; top: 1.1rem; }
  .contact { grid-template-columns: 1.2fr .8fr; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

/* Ajustes: el nombre de marca no se parte y el menu cabe en pantallas medianas */
.brand, [class*="brand"] { white-space: nowrap; }
@media (min-width: 960px) and (max-width: 1180px) {
  .nav a { padding: .5rem .45rem; font-size: .86rem; }
  .nav .btn { white-space: nowrap; }
}

/* Ficha técnica en tarjetas de equipos */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.equipo details.ficha { background: var(--bg); border-radius: 10px; margin: 0 0 .9rem; }
.equipo details.ficha summary { padding: .55rem .85rem; font-size: .9rem; min-height: 44px; align-items: center; }
.equipo details.ficha summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.ficha-body { padding: 0 .85rem .8rem; }
.ficha-body table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ficha-body th, .ficha-body td { text-align: left; padding: .35rem 0; vertical-align: top; border-top: 1px solid var(--line); }
.ficha-body th { color: var(--muted); font-weight: 500; width: 42%; padding-right: .6rem; }
.ficha-body td { color: var(--text); overflow-wrap: anywhere; }

.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { color: var(--accent, #f7931a); }

/* Menú con más enlaces: entre 960 y 1139 px se conserva el botón de menú para que el nav no se apriete */
@media (min-width: 960px) and (max-width: 1139px) {
  .menu-btn { display: grid; }
  .nav { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--line); display: none; flex-direction: column; align-items: stretch; padding: 1rem 1.1rem 1.4rem; gap: .2rem; max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav.open { display: flex; }
  .nav a { padding: .75rem .4rem; font-size: 1rem; }
  .nav .btn { margin: .6rem 0 0; }
}
