/* ============================================================
   EMERTCOM — Design System
   Dark / institutional / operational
   ============================================================ */

:root {
  /* Palette */
  --bg:          #0b0e12;   /* near-black graphite */
  --bg-2:        #11151b;   /* alt section */
  --surface:     #161b22;   /* cards */
  --surface-2:   #1c2530;   /* raised */
  --border:      #232c38;
  --border-2:    #2e3a49;

  --text:        #e8edf2;
  --text-dim:    #9aa7b4;
  --text-mute:   #6b7885;

  --navy:        #0f1e33;
  --accent:      #2f81f7;   /* controlled blue */
  --accent-2:    #4f9dff;
  --accent-soft: rgba(47,129,247,0.12);

  --danger:      #e5484d;   /* controlled emergency red */
  --danger-soft: rgba(229,72,77,0.12);

  --ok:          #3fb950;

  --radius:      14px;
  --radius-sm:   10px;
  --maxw:        1400px;
  --shadow:      0 10px 40px rgba(0,0,0,.45);

  --font:  'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth; scroll-padding-top: 104px;
  width: 100%; overflow-x: hidden;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  width: 100%; max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.center { text-align: center; }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.text-accent { color: var(--accent-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 600; font-size: 15px;
  padding: 13px 24px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(47,129,247,.3); }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px); }
.btn-outline { background: transparent; border-color: var(--border-2); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-dim); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); }
.nav-ingresar { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,14,18,.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,.4); background: rgba(11,14,18,.92); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 92px; }

.logo { display: flex; align-items: center; }
.logo-img { height: 76px; width: auto; display: block; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(79,157,255,.6); }
  70% { box-shadow: 0 0 0 10px rgba(79,157,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(79,157,255,0); }
}
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.logo-accent { color: var(--accent-2); }

.main-nav { display: flex; gap: 26px; margin-left: auto; margin-right: 32px; }
.main-nav a {
  font-size: 14.5px; font-weight: 500; color: var(--text-dim);
  position: relative; padding: 4px 0; transition: color .2s ease;
  white-space: nowrap;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--accent); transition: width .25s ease;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 0; cursor: pointer; padding: 6px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Floating support ---------- */
.floating-support {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--danger); color: #fff; font-weight: 700; font-size: 13.5px;
  letter-spacing: .05em; padding: 12px 18px; border-radius: 40px;
  box-shadow: 0 8px 28px rgba(229,72,77,.4); transition: transform .2s ease, opacity .2s ease;
  border: 0; cursor: pointer; font-family: var(--font);
}
.floating-support:hover { transform: translateY(-3px); }
.floating-support.hidden { opacity: 0; pointer-events: none; transform: scale(.8); }
.fs-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: pulse 1.8s infinite; }

/* Botón volver arriba (inferior izquierda) */
.back-to-top {
  position: fixed; left: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface-2); color: var(--accent-2);
  border: 1px solid var(--border-2); cursor: pointer;
  font-size: 20px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, background .2s ease;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-3px); }

/* ---------- Chat widget ---------- */
.chat-window[hidden] { display: none !important; }
.chat-input-row[hidden] { display: none !important; }
.chat-window {
  position: fixed; right: 20px; bottom: 20px; z-index: 95;
  width: min(370px, calc(100vw - 40px)); height: min(560px, calc(100vh - 100px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.55);
  overflow: hidden; animation: chatIn .28s ease;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(135deg, #2a0f12, var(--navy));
  border-bottom: 1px solid var(--border);
}
.chat-header-info { display: flex; align-items: center; gap: 11px; }
.chat-header-info strong { display: block; font-size: 15px; }
.chat-header-info small { color: var(--text-dim); font-size: 12px; }
.chat-status-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(63,185,80,.6); animation: pulse 2s infinite;
}
.chat-close {
  background: none; border: 0; color: var(--text-dim); font-size: 28px;
  line-height: 1; cursor: pointer; transition: color .2s ease;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 8px; margin: -6px -6px -6px 0;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.chat-close:hover, .chat-close:active { color: var(--text); background: rgba(255,255,255,.06); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(47,129,247,.06), transparent 40%),
    var(--bg-2);
}
.chat-msg { max-width: 82%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.chat-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.system {
  align-self: center; max-width: 90%; text-align: center;
  background: transparent; border: 0; color: var(--text-mute);
  font-size: 12.5px; font-family: var(--mono); padding: 4px 8px;
}
.chat-msg.typing { display: flex; gap: 4px; align-items: center; }
.chat-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-mute); animation: blink 1.2s infinite; }
.chat-msg.typing span:nth-child(2) { animation-delay: .2s; }
.chat-msg.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.chat-options { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; background: var(--bg-2); }
.chat-options:empty { padding: 0; }
.chat-opt {
  background: transparent; border: 1px solid var(--accent); color: var(--accent-2);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  padding: 8px 13px; border-radius: 30px; cursor: pointer; transition: all .18s ease;
}
.chat-opt:hover { background: var(--accent); color: #fff; }
.chat-opt.danger { border-color: var(--danger); color: #ff8b8f; }
.chat-opt.danger:hover { background: var(--danger); color: #fff; }

.chat-input-row {
  display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-row input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 22px; padding: 10px 15px; color: var(--text);
  font-family: var(--font); font-size: 14px;
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row button {
  width: 42px; height: 42px; border-radius: 50%; border: 0; flex-shrink: 0;
  background: var(--accent); color: #fff; font-size: 16px; cursor: pointer;
  transition: background .2s ease;
}
.chat-input-row button:hover { background: var(--accent-2); }

/* ---------- Sections ---------- */
.section { padding: 96px 0; position: relative; }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: 52px; }
.section-head.center, .center .section-head { margin-left: auto; margin-right: auto; }

.section-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent-2); background: var(--accent-soft);
  border: 1px solid rgba(47,129,247,.25); padding: 6px 12px; border-radius: 30px;
  margin-bottom: 18px;
}
.section-tag.accent { color: var(--accent-2); }
.section-tag.danger { color: #ff7b7f; background: var(--danger-soft); border-color: rgba(229,72,77,.28); }

.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 16px; }
.section-intro { color: var(--text-dim); font-size: 17px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 110px 0 90px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg .grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(47,129,247,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,129,247,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 30%, #000 40%, transparent 100%);
}
.hero-bg::before {
  content: ""; position: absolute; top: -20%; right: -10%;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,129,247,.18), transparent 65%);
  filter: blur(20px);
}
.scan-line {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(79,157,255,.5), transparent);
  animation: scan 7s linear infinite; opacity: .5;
}
@keyframes scan { 0% { top: 0; } 100% { top: 100%; } }

.hero-inner {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: 1.15fr .85fr; gap: 50px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 13px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .14em; margin-bottom: 22px;
}
.eyebrow-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.8s infinite; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); font-weight: 800; margin-bottom: 22px; }
.hero-lead { font-size: 19px; color: var(--text-dim); max-width: 560px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-sub { font-family: var(--mono); font-size: 13.5px; color: var(--text-mute); letter-spacing: .03em; }

/* Hero flow */
.hero-flow {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow);
}
.flow-track { display: flex; flex-direction: column; gap: 0; }
.flow-node {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  opacity: .4; transition: all .4s ease;
}
.flow-node.on { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(47,129,247,.4), 0 6px 18px rgba(0,0,0,.3); transform: translateX(4px); }
.flow-icon { font-size: 22px; }
.flow-label { font-weight: 600; font-size: 15px; }
.flow-line { width: 2px; height: 20px; margin-left: 30px; background: var(--border-2); }
.flow-chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border-2);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--text-mute);
}
.flow-chain i { color: var(--accent-2); font-style: normal; }

/* ---------- Cards grids ---------- */
.cards-grid { display: grid; gap: 22px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-5 { grid-template-columns: repeat(5, 1fr); }
.mt { margin-top: 26px; }

.card, .service-card, .case-card, .support-level, .audience-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover, .service-card:hover, .case-card:hover, .support-level:hover, .audience-card:hover {
  transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow);
}

.card-icon { font-size: 30px; display: block; margin-bottom: 14px; }
.card.capability h3 { font-size: 18px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card.capability ul li {
  position: relative; padding-left: 20px; margin-bottom: 9px;
  font-size: 14.5px; color: var(--text-dim);
}
.card.capability ul li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--accent);
}

/* mini cards */
.mini-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px; font-weight: 500;
}
.mini-card span { font-size: 22px; }

/* ---------- Solution blocks ---------- */
.solution-block {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  align-items: center; padding: 44px 0; border-top: 1px solid var(--border);
}
.solution-block.reverse .solution-media { order: -1; }
.solution-kicker { display: block; font-weight: 700; font-size: 15px; color: var(--accent-2); margin-bottom: 12px; }
.solution-text h3 { font-size: 24px; margin-bottom: 12px; }
.solution-text > p { color: var(--text-dim); margin-bottom: 20px; }

.feature-list li {
  position: relative; padding-left: 22px; margin-bottom: 10px; color: var(--text-dim); font-size: 15px;
}
.feature-list li::before {
  content: "▸"; position: absolute; left: 0; color: var(--accent); font-size: 13px; top: 1px;
}
.feature-list.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }

.callout {
  margin-top: 22px; background: var(--accent-soft);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; padding: 16px 18px;
}
.callout strong { display: block; margin-bottom: 5px; }
.callout p { color: var(--text-dim); font-size: 14.5px; }

/* media placeholders */
.media-frame {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.media-frame.wide { margin-top: 8px; }
.media-caption {
  font-family: var(--mono); font-size: 12px; letter-spacing: .05em;
  color: var(--text-dim); padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.media-caption::before { content: "● ● ● "; color: var(--border-2); letter-spacing: 2px; }
.media-placeholder {
  aspect-ratio: 16/10; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px),
    var(--bg-2);
  color: var(--text-mute);
}
.media-placeholder.has-photo { padding: 0; background: var(--bg-2); }
.media-placeholder.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-placeholder span { font-weight: 600; color: var(--text-dim); font-size: 16px; }
.media-placeholder small { font-size: 13px; }
.media-placeholder.tall { aspect-ratio: 21/9; }
.media-placeholder.video .play-btn {
  width: 58px; height: 58px; border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 20px;
  box-shadow: 0 8px 24px rgba(47,129,247,.4);
}

/* software feature */
.solution-feature { padding: 60px 0; border-top: 1px solid var(--border); }
.solution-feature .section-head { margin-bottom: 28px; }
h3.big { font-size: clamp(24px, 3vw, 34px); }
.highlight-line {
  margin-top: 34px; font-size: 19px; font-weight: 500; text-align: center;
  color: var(--text); max-width: 720px; margin-left: auto; margin-right: auto;
}
.highlight-line::before, .highlight-line::after { content: "—"; color: var(--accent-2); margin: 0 10px; }

/* ---------- Case cards ---------- */
.case-icon { font-size: 30px; display: block; margin-bottom: 12px; }
.case-card h3 { font-size: 19px; margin-bottom: 18px; }
.case-row { padding: 12px 0; border-top: 1px solid var(--border); }
.case-row:first-of-type { border-top: 0; }
.case-row b {
  display: inline-block; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--accent-2); margin-bottom: 3px;
}
.case-row p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Service cards ---------- */
.service-card span { font-size: 30px; display: block; margin-bottom: 12px; }
.service-card h3 { font-size: 19px; margin-bottom: 8px; }
.service-card p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Support ---------- */
.support-section {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(229,72,77,.08), transparent 70%),
    var(--bg);
}
.support-level { position: relative; }
.level-num {
  font-family: var(--mono); font-size: 34px; font-weight: 700;
  color: var(--danger); opacity: .5; display: block; margin-bottom: 8px;
}
.support-level h3 { font-size: 19px; margin-bottom: 8px; }
.support-level p { color: var(--text-dim); font-size: 14.5px; }

.base-banner {
  display: flex; gap: 20px; align-items: flex-start; margin-top: 34px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--danger); border-radius: var(--radius); padding: 26px 28px;
}
.base-icon { font-size: 30px; }
.base-banner h3 { font-size: 20px; margin-bottom: 8px; }
.base-banner p { color: var(--text-dim); max-width: 720px; }

/* ---------- Audience ---------- */
.audience-card { text-align: center; }
.audience-card span { font-size: 34px; display: block; margin-bottom: 12px; }
.audience-card h3 { font-size: 17px; margin-bottom: 8px; }
.audience-card p { color: var(--text-dim); font-size: 13.5px; }

/* ---------- Tag cloud ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud span {
  font-family: var(--mono); font-size: 14px; padding: 12px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 40px;
  color: var(--text-dim); transition: all .2s ease;
}
.tag-cloud span:hover { border-color: var(--accent); color: var(--accent-2); transform: translateY(-2px); }

/* ---------- Custom dev ---------- */
.custom-dev {
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(47,129,247,.1), transparent 70%),
    var(--bg);
}
.custom-dev h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 16px; }
.custom-dev .btn { margin-top: 26px; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; position: relative;
}
.step-num {
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  color: var(--accent-2); background: var(--accent-soft);
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 16px;
}
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.about-grid h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 16px 0; }
.about-grid p { color: var(--text-dim); margin-bottom: 16px; }
.about-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.about-pills span {
  font-family: var(--mono); font-size: 13px; padding: 8px 16px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 30px;
}
.about-visual { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.visual-node {
  width: 100%; text-align: center; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
}
.visual-node.danger { border-color: rgba(229,72,77,.4); color: #ff9a9d; }
.visual-arrow { color: var(--accent-2); font-size: 20px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; align-items: start; }
.contact-intro h2 { font-size: clamp(26px, 3.4vw, 38px); margin: 16px 0; }
.contact-intro > p { color: var(--text-dim); margin-bottom: 26px; }
.contact-info li {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  color: var(--text-dim); font-size: 15px; border-bottom: 1px solid var(--border);
}
.contact-info li span { font-size: 18px; }

.contact-form {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
}
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 500; color: var(--text-dim);
  margin-bottom: 7px; letter-spacing: .02em;
}
.field input, .field select, .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 12px 14px; color: var(--text);
  font-family: var(--font); font-size: 15px; transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; }
.form-status { margin-top: 14px; font-size: 14px; text-align: center; min-height: 20px; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--danger); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding-top: 56px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; padding-bottom: 44px; }
.footer-brand .logo-text { font-size: 22px; font-weight: 800; display: inline-block; margin-bottom: 14px; }
.footer-logo-img { height: 44px; width: auto; display: block; margin-bottom: 16px; }
.footer-brand p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 10px; max-width: 480px; }
.footer-tagline { color: var(--text-mute) !important; font-size: 13.5px !important; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.footer-cols h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin-bottom: 14px; }
.footer-cols a, .footer-cols p { display: block; color: var(--text-dim); font-size: 14px; padding: 4px 0; transition: color .2s ease; }
.footer-cols a:hover { color: var(--accent-2); }
.footer-support { color: #ff9a9d !important; font-weight: 600; margin-top: 8px !important; }
.footer-bottom { border-top: 1px solid var(--border); padding: 22px 0; }
.footer-bottom p { color: var(--text-mute); font-size: 13.5px; text-align: center; }

/* ---------- Scroll reveal ---------- */
.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-inner { grid-template-columns: 1fr; gap: 40px; }
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .main-nav {
    position: fixed; top: 76px; right: 0; width: min(300px, 84%);
    height: calc(100vh - 76px); background: var(--bg-2);
    border-left: 1px solid var(--border); flex-direction: column; gap: 0;
    padding: 20px; transform: translateX(100%); transition: transform .3s ease; z-index: 99;
    margin: 0; overflow-y: auto;
  }
  .main-nav.open { transform: none; }
  .main-nav a { padding: 15px 0; border-bottom: 1px solid var(--border); width: 100%; }
  .nav-toggle { display: flex; }
  .header-actions .btn-primary,
  .header-actions .btn-ghost { display: none; }
  .nav-ingresar { display: block; color: var(--accent-2) !important; font-weight: 600; }
  .logo-img { height: 52px; }
  .header-inner { height: 76px; }

  .cards-2, .cards-3, .cards-4, .cards-5 { grid-template-columns: 1fr; }
  .solution-block, .solution-block.reverse { grid-template-columns: 1fr; gap: 28px; }
  .solution-block.reverse .solution-media { order: 0; }
  .feature-list.two-col { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: 1fr; }
  .section { padding: 68px 0; }
  .fs-text { display: none; }
  .floating-support { padding: 14px; }

  /* Chat en pantalla completa en móvil */
  .chat-window {
    right: 0; bottom: 0; left: 0;
    width: 100%; height: 100%;
    max-height: 100dvh; border-radius: 0;
  }
}

/* Ajustes finos para teléfonos */
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .hero { padding: 80px 0 60px; }
  .hero h1 { font-size: clamp(28px, 8vw, 38px); }
  .hero-lead { font-size: 16px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-flow { padding: 22px 18px; }
  .flow-chain { font-size: 10px; }
  .section-head h2 { font-size: clamp(23px, 6.5vw, 30px); }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .footer-inner { text-align: left; }
  /* que los botones flotantes no se pisen con el back-to-top */
  .floating-support { right: 14px; bottom: 14px; }
  .back-to-top { left: 14px; bottom: 14px; width: 42px; height: 42px; }
  /* tablas de admin y catálogo con scroll horizontal si hace falta */
  .prod-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   PRODUCTOS — catálogo + carrito de cotización
   ============================================================ */
.muted-load { color: var(--text-mute); text-align: center; padding: 40px 0; }

/* Botón carrito en el header */
.cart-btn { position: relative; }
.cart-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 6px; margin-left: 4px; border-radius: 20px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
}

/* Filtros de categoría */
.cat-filtros { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.cat-chip {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  padding: 9px 16px; border-radius: 30px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
  transition: all .18s ease;
}
.cat-chip:hover { border-color: var(--accent); color: var(--accent-2); }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Grid de productos */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.prod-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.prod-card:hover { transform: translateY(-4px); border-color: var(--border-2); box-shadow: var(--shadow); }
.prod-img { aspect-ratio: 16/11; background: var(--bg-2); overflow: hidden; display: grid; place-items: center; }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-img.noimg span { font-size: 46px; opacity: .4; }
.prod-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.prod-cat {
  align-self: flex-start; font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--accent-2); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 20px; margin-bottom: 10px;
}
.prod-body h3 { font-size: 17px; margin-bottom: 8px; }
.prod-desc { color: var(--text-dim); font-size: 14px; margin-bottom: 14px; flex: 1; }
.prod-precio { font-weight: 700; font-size: 18px; color: var(--text); margin-bottom: 14px; display: block; }
.prod-precio.consultar { font-size: 14px; font-weight: 600; color: var(--accent-2); }
.prod-acciones { display: flex; flex-direction: column; gap: 10px; }
.prod-agotado { color: var(--danger); font-size: 14px; font-weight: 600; }

/* Selector de cantidad */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 9px; overflow: hidden; width: fit-content; }
.qty-btn {
  width: 36px; height: 38px; background: var(--surface-2); border: 0; color: var(--text);
  font-size: 18px; cursor: pointer; transition: background .15s ease;
}
.qty-btn:hover { background: var(--accent); color: #fff; }
.qty-input {
  width: 48px; height: 38px; text-align: center; border: 0; background: var(--bg-2);
  color: var(--text); font-family: var(--font); font-size: 15px;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Panel de cotización */
.cart-panel[hidden], .cart-overlay[hidden] { display: none !important; }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 110; }
.cart-panel {
  position: fixed; top: 0; right: 0; z-index: 120;
  width: min(400px, 100%); height: 100%; background: var(--surface);
  border-left: 1px solid var(--border-2); box-shadow: -12px 0 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column; animation: cartSlide .28s ease;
}
@keyframes cartSlide { from { transform: translateX(100%); } to { transform: none; } }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 18px; }
.cart-close { background: none; border: 0; color: var(--text-dim); font-size: 28px; line-height: 1; cursor: pointer; width: 38px; height: 38px; border-radius: 8px; }
.cart-close:hover { color: var(--text); background: rgba(255,255,255,.06); }
.cart-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.cart-item { display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.ci-info { flex: 1; min-width: 0; }
.ci-info b { display: block; font-size: 14px; }
.ci-info small { color: var(--text-mute); font-size: 12.5px; }
.ci-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.ci-qty .qty-btn { width: 30px; height: 32px; font-size: 16px; }
.ci-qty .qty-input { width: 38px; height: 32px; font-size: 14px; }
.ci-del { background: none; border: 0; color: var(--text-mute); font-size: 16px; cursor: pointer; padding: 6px; }
.ci-del:hover { color: var(--danger); }
.cart-form { padding: 0 20px 20px; overflow-y: auto; }
.cart-empty { color: var(--text-mute); text-align: center; padding: 30px 0; }
.cart-form h4 { font-size: 14px; margin: 8px 0 14px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.cart-form .field { margin-bottom: 12px; }
.cart-form .field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.cart-form .field input, .cart-form .field textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px 12px; color: var(--text); font-family: var(--font); font-size: 14.5px;
}
.cart-form .field input:focus, .cart-form .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

@media (max-width: 720px) {
  .prod-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .prod-body { padding: 14px; }
  .cart-panel { width: 100%; }
}
@media (max-width: 460px) {
  .prod-grid { grid-template-columns: 1fr; }
}
