/* ═══════════════════════════════════════════════════════════════
   THERMAL — Sistema de componentes compartido
   Tokens y patrones extraídos de index.html. Usado por las páginas
   de contenido (silos). La home mantiene su CSS propio (hero animado).
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --night:    #08111F;
  --night-1:  #0C1828;
  --night-2:  #101F30;
  --night-3:  #152638;
  --cyan:     #28D6D3;
  --cyan-dim: rgba(40,214,211,.12);
  --cyan-2:   #6FB7D6;
  --thermal:  #F24B3A;
  --text:     #EAF2F4;
  --text-2:   #9BAAB2;
  --text-3:   #8494A0;
  --border:   #162030;
  --border-2: #1E2E40;
  --fd: 'Chakra Petch', sans-serif;
  --fb: 'Saira', sans-serif;
  --fm: 'IBM Plex Mono', monospace;
}

html { scroll-behavior: smooth; font-size: 16px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  background: var(--night);
  color: var(--text);
  font-family: var(--fb);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(40,214,211,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40,214,211,.012) 1px, transparent 1px);
  background-size: 80px 80px;
}

a { color: inherit; }
img { max-width: 100%; }

/* ─── SKIP LINK ───────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--cyan);
  color: var(--night);
  font-family: var(--fb);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 3px;
  z-index: 200;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ─── UTILS ───────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 28px; }
.container-narrow { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 28px; }
section { padding: 90px 0; position: relative; }
@media (max-width: 640px) { section { padding: 60px 0; } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fb);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--cyan);
  border: 1px solid rgba(40,214,211,.3);
  border-radius: 20px;
  padding: 6px 14px;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); flex-shrink: 0; }

.section-label {
  font-family: var(--fb);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.section-label::after { content: ''; width: 36px; height: 1px; background: var(--cyan); opacity: .4; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: var(--border-2); }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ─── NAV ─────────────────────────────────────────────────────── */
#nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  padding: 20px 0;
  transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
  background: rgba(8,17,31,.7);
  backdrop-filter: blur(10px);
}
#nav.solid { background: rgba(8,17,31,.94); backdrop-filter: blur(16px) saturate(1.6); padding: 14px 0; border-color: var(--border); }

.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.logo { font-family: var(--fd); font-weight: 900; font-size: 22px; letter-spacing: -.01em; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo img { height: 40px; width: auto; display: block; }

.nav-links { display: none; list-style: none; gap: 8px; align-items: center; }
.nav-links > li { position: relative; }
.nav-links a, .nav-links button {
  font-family: var(--fb);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color .2s;
  letter-spacing: .02em;
  background: none; border: none; cursor: pointer;
  padding: 10px 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-links a:hover, .nav-links button:hover, .nav-links [aria-expanded="true"] { color: var(--text); }

/* Megamenu */
.megamenu {
  display: none;
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  min-width: 900px;
  max-width: calc(100vw - 56px);
  background: var(--night-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  gap: 28px;
}
.nav-links li:hover .megamenu,
.nav-links li:focus-within .megamenu,
.megamenu.open { display: flex; }
.megamenu .mm-col { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.megamenu a { display: block; padding: 8px 10px; border-radius: 5px; font-size: 13px; }
.megamenu a:hover { background: var(--cyan-dim); color: var(--cyan); }
.megamenu .mm-madre { font-family: var(--fm); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 2px; }
.megamenu .mm-all { color: var(--cyan); font-weight: 600; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }

.nav-cta {
  font-family: var(--fb); font-size: 13px; font-weight: 600; color: var(--night);
  background: var(--cyan); text-decoration: none; padding: 9px 22px; border-radius: 3px;
  white-space: nowrap; transition: background .2s, box-shadow .2s;
}
.nav-cta:hover { background: #40E0DD; box-shadow: 0 4px 16px rgba(40,214,211,.3); }

.burger { display: flex; flex-direction: column; justify-content: space-between; width: 24px; height: 16px; background: none; border: none; cursor: pointer; }
.burger span { display: block; height: 1.5px; background: var(--text); transition: all .3s; }

#mob-menu { display: none; position: fixed; inset: 0; background: rgba(8,17,31,.98); z-index: 89; flex-direction: column; align-items: center; justify-content: center; gap: 24px; overflow-y: auto; padding: 80px 20px; }
#mob-menu.open { display: flex; }
#mob-menu a { font-family: var(--fd); font-weight: 700; font-size: 28px; color: var(--text); text-decoration: none; text-transform: uppercase; transition: color .2s; text-align: center; }
#mob-menu a:hover { color: var(--cyan); }
#mob-close { position: absolute; top: 22px; right: 28px; font-size: 26px; color: var(--text-2); background: none; border: none; cursor: pointer; }

@media (min-width: 900px) { .nav-links { display: flex; } .burger { display: none; } }

/* ─── PAGE HERO (páginas de contenido, no home) ──────────────── */
.page-hero { padding: 156px 0 64px; }
@media (max-width: 640px) { .page-hero { padding: 128px 0 44px; } }

.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-family: var(--fm); font-size: 12.5px; color: var(--text-3);
  margin-bottom: 28px; list-style: none;
}
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb li[aria-current] { color: var(--text); }
.breadcrumb .sep { opacity: .5; }

h1.page-h1 {
  font-family: var(--fd);
  font-weight: 800;
  font-size: clamp(32px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--text);
  max-width: 18ch;
  margin-bottom: 20px;
}
h1.page-h1 em { font-style: normal; color: var(--cyan); }

.page-lede { font-size: clamp(15px, 1.6vw, 17.5px); color: var(--text-2); line-height: 1.72; max-width: 640px; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; background: var(--cyan); color: var(--night);
  font-family: var(--fb); font-size: 14px; font-weight: 700; letter-spacing: .03em; text-decoration: none;
  padding: 15px 28px; border-radius: 3px; border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(40,214,211,.2); transition: background .2s, box-shadow .2s, transform .2s;
}
.btn-primary:hover { background: #40E0DD; box-shadow: 0 8px 28px rgba(40,214,211,.35); transform: translateY(-2px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px; background: transparent; color: var(--text);
  font-family: var(--fb); font-size: 14px; font-weight: 500; letter-spacing: .03em; text-decoration: none;
  padding: 15px 28px; border: 1px solid var(--border-2); border-radius: 3px;
  transition: border-color .2s, background .2s, transform .2s;
}
.btn-secondary:hover { border-color: rgba(40,214,211,.4); background: rgba(40,214,211,.04); transform: translateY(-2px); }

.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

/* ─── CONTENT TYPOGRAPHY ─────────────────────────────────────── */
.prose h2 {
  font-family: var(--fd); font-weight: 700; font-size: clamp(24px, 3vw, 34px);
  color: var(--text); margin: 0 0 16px; line-height: 1.1;
}
.prose h3 {
  font-family: var(--fd); font-weight: 600; font-size: 19px;
  color: var(--text); margin: 28px 0 10px; line-height: 1.2;
}
.prose p { color: var(--text-2); font-size: 15.5px; line-height: 1.75; margin-bottom: 16px; max-width: 72ch; }
.prose ul, .prose ol { color: var(--text-2); font-size: 15.5px; line-height: 1.75; margin: 0 0 16px 20px; max-width: 68ch; }
.prose li { margin-bottom: 6px; }
.prose a.inline-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); }

/* ─── CARDS: servicios / hallazgos / features ────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .card-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }

.info-card {
  background: var(--night-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 26px 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: background .25s, border-color .25s, box-shadow .25s, transform .25s;
}
.info-card:hover { background: var(--night-3); border-color: rgba(40,214,211,.22); box-shadow: 0 16px 36px rgba(0,0,0,.35); transform: translateY(-2px); }
.info-card .ic-icon { width: 30px; height: 30px; color: var(--cyan); }
.info-card h3 { font-family: var(--fd); font-weight: 700; font-size: 18px; color: var(--text); line-height: 1.15; }
.info-card p { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.info-card .ic-link { margin-top: auto; font-family: var(--fb); font-size: 13px; font-weight: 700; color: var(--cyan); text-decoration: none; padding-top: 10px; }
.info-card .ic-link:hover { text-decoration: underline; }

/* ─── PROCESS STEPS ───────────────────────────────────────────── */
.process-grid { display: grid; grid-template-columns: 1fr; gap: 2px; }
@media (min-width: 800px) { .process-grid { grid-template-columns: repeat(3, 1fr); } }
.process-step { background: var(--night-2); border: 1px solid var(--border); border-radius: 6px; padding: 28px; }
.step-num { font-family: var(--fm); color: var(--cyan); font-size: 12px; letter-spacing: .1em; margin-bottom: 22px; }
.process-step h3 { font-family: var(--fd); font-size: 22px; line-height: 1.05; text-transform: uppercase; margin-bottom: 12px; }
.process-step p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }

/* ─── CREDENTIALS BAR ─────────────────────────────────────────── */
.creds-row { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; background: var(--night-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
@media (min-width: 900px) { .creds-row { grid-template-columns: repeat(4, 1fr); } }
.cred-item { padding: 22px 20px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
@media (min-width: 900px) { .cred-item { padding: 24px 26px; border-bottom: none; } .cred-item:last-child { border-right: none; } }
.cred-icon { width: 24px; height: 24px; color: var(--cyan); flex-shrink: 0; margin-top: 2px; }
.cred-label { font-family: var(--fb); font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cred-sub { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.4; }

/* ─── FAQ ─────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 2px; }
.faq-item { background: var(--night-2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.faq-item + .faq-item { margin-top: 8px; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--fb); font-size: 15px; font-weight: 600; color: var(--text);
}
.faq-q::after { content: '+'; font-family: var(--fm); font-size: 20px; color: var(--cyan); flex-shrink: 0; transition: transform .2s; }
.faq-q[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a { padding: 0 22px; max-height: 0; overflow: hidden; transition: padding .25s, max-height .25s; }
.faq-a p { color: var(--text-2); font-size: 14.5px; line-height: 1.7; padding-bottom: 0; }
.faq-item.open .faq-a { padding: 0 22px 20px; max-height: 600px; }

/* ─── CTA BANNER ──────────────────────────────────────────────── */
.cta-banner { background: var(--night-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta-banner-inner { padding: 44px 0; display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; }
@media (min-width: 800px) { .cta-banner-inner { grid-template-columns: 1fr auto; } }
.cta-banner h2 { font-family: var(--fd); font-size: clamp(24px, 3vw, 32px); font-weight: 800; text-transform: uppercase; line-height: 1.05; }
.cta-banner p { color: var(--text-2); max-width: 560px; margin-top: 8px; line-height: 1.6; }

/* ─── FORM (cotizar) ─────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--fb); font-size: 13px; font-weight: 600; color: var(--text); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field input, .field select, .field textarea {
  background: var(--night-2); border: 1px solid var(--border-2); border-radius: 5px; color: var(--text);
  font-family: var(--fb); font-size: 14px; padding: 12px 14px; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); outline: 2px solid var(--cyan); outline-offset: 2px; }
.field textarea { resize: vertical; min-height: 110px; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--thermal); }
.field .error-msg { font-size: 12.5px; color: var(--thermal); display: none; }
.field.error .error-msg { display: block; }
.form-status { font-family: var(--fm); font-size: 13px; padding: 12px 16px; border-radius: 5px; display: none; margin-top: 8px; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(40,214,211,.1); border: 1px solid var(--cyan); color: var(--cyan); }
.form-status.err { background: rgba(242,75,58,.1); border: 1px solid var(--thermal); color: var(--thermal); }
.form-alt { margin-top: 20px; font-size: 13.5px; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 16px; }
.form-alt a { color: var(--cyan); text-decoration: none; font-weight: 600; }
.form-alt a:hover { text-decoration: underline; }
.consent { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--text-2); padding: 8px; border-radius: 5px; border: 1px solid transparent; }
.consent.error { border-color: var(--thermal); }
.consent.error label { color: var(--thermal); }
.consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--cyan); }

/* ─── TABLE (comparativas, informes) ─────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
table.data-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
table.data-table th, table.data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
table.data-table thead th { background: var(--night-2); font-family: var(--fm); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
table.data-table td { color: var(--text-2); }
table.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── SIDEBAR LINKS (silo internal linking) ──────────────────── */
.related { background: var(--night-1); border: 1px solid var(--border); border-radius: 8px; padding: 24px; }
.related h3 { font-family: var(--fd); font-size: 15px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-3); margin-bottom: 14px; }
.related ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.related a { color: var(--text); text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.related a:hover { color: var(--cyan); }
.related a::before { content: '→'; color: var(--cyan); font-family: var(--fm); flex-shrink: 0; }

/* ─── FOOTER ──────────────────────────────────────────────────── */
footer { background: var(--night); border-top: 1px solid var(--border); padding: 56px 0 32px; }
.foot-grid { display: grid; grid-template-columns: 1fr; gap: 36px; margin-bottom: 40px; }
@media (min-width: 800px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.foot-col h3 { font-family: var(--fm); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.foot-col a { color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.foot-col a:hover { color: var(--cyan); }
.foot-col p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; max-width: 320px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 28px; border-top: 1px solid var(--border); }
.foot-copy { font-family: var(--fm); font-size: 12px; color: var(--text-3); }
.cert-pills { display: flex; gap: 8px; }
.cert-pill { font-family: var(--fm); font-size: 10.5px; letter-spacing: .05em; color: var(--cyan); border: 1px solid rgba(40,214,211,.3); border-radius: 12px; padding: 4px 10px; }

/* ─── GALERÍA TÉRMICA (evidencia con imágenes reales) ────────── */
.therm-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--border); border: 1px solid var(--border); }
@media (min-width: 900px) { .therm-gallery { grid-template-columns: 1fr 1fr 1fr; } }
@media (max-width: 639px) { .therm-gallery { grid-template-columns: 1fr; } }
.tg-item { background: var(--night-2); display: flex; flex-direction: column; overflow: hidden; }
.tg-wide { grid-column: 1 / -1; }
@media (max-width: 639px) { .tg-wide { grid-column: auto; } .tg-wide img { aspect-ratio: 16/9; } }
.tg-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; transition: transform .5s ease; filter: brightness(.95); }
.tg-wide img { aspect-ratio: 21/9; object-fit: cover; }
.tg-item:hover img { transform: scale(1.03); filter: brightness(1); }
.tg-caption { padding: 20px 22px 24px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tg-tag { font-family: var(--fm); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--thermal); opacity: .9; }
.tg-caption strong { color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; display: block; }
.tg-caption p { font-size: 13px; line-height: 1.65; color: var(--text-2); }

/* ─── REVEAL (progresivo: sin JS, el contenido queda visible) ──── */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
html.js .reveal.vis { opacity: 1; transform: translateY(0); }
