/* ==========================================================================
   Innovative Market Solutions — hoja de estilos principal
   Paleta de marca: ámbar #e29900 + tinta azul noche (#0f172a)
   Sin frameworks: todo el sitio pesa una fracción del anterior (Tailwind CDN)
   ========================================================================== */

:root {
  --brand: #e29900;
  --brand-600: #c28200;
  --brand-50: #fff6e3;
  --brand-100: #ffe9b8;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --ink-3: #334155;
  --slate: #475569;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f7f7f8;
  --card: #ffffff;
  --good: #15803d;
  --good-bg: #e8f6ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --flat: #92400e;
  --flat-bg: #fff4e0;

  --f-display: "Sora", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .16);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink-2);
  font-family: var(--f-body); font-size: 17px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-display); color: var(--ink); line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.22rem; font-weight: 600; }
h4 { font-size: 1.02rem; font-weight: 600; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--gutter); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Barra superior de contacto ---------- */
.topbar { background: var(--ink); color: #cbd5e1; font-size: .86rem; }
.topbar .container { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: flex-end; align-items: center; padding-block: 7px; }
.topbar a { color: #e2e8f0; text-decoration: none; display: inline-flex; gap: 7px; align-items: center; }
.topbar a:hover { color: var(--brand); }
.topbar svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .topbar .t-mail { display: none; } .topbar .container { justify-content: center; } }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 96px; transition: min-height .2s ease; }
.site-header.compact .container { min-height: 74px; }
/* El archivo del logo tiene mucho margen blanco arriba y abajo: se recorta con CSS para que la marca se vea grande */
.brand-logo { --lh: 60px; display: block; flex: none; position: relative; overflow: hidden; height: var(--lh); width: calc(var(--lh) * 5.16); transition: height .2s ease, width .2s ease; }
.brand-logo img { position: absolute; max-width: none; width: auto; height: calc(var(--lh) * 2.202); top: calc(var(--lh) * -0.5); left: calc(var(--lh) * -0.053); transition: height .2s ease, top .2s ease, left .2s ease; }
.site-header.compact .brand-logo { --lh: 46px; }
.site-header.compact { box-shadow: 0 6px 20px rgba(15,23,42,.08); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink-3); text-decoration: none; font-weight: 500; font-size: .96rem; padding: 8px 11px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--brand-50); }
.nav .btn { margin-left: 8px; }
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; background: var(--brand); }
.nav a.btn-primary:hover { background: var(--brand-600); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.nav-toggle svg { width: 22px; height: 22px; display: block; }
@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; align-items: stretch; padding: 10px var(--gutter) 18px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; }
  .nav .btn { margin: 8px 0 0; text-align: center; justify-content: center; }
  .brand-logo, .site-header.compact .brand-logo { --lh: 42px; }
  .site-header .container, .site-header.compact .container { min-height: 72px; }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 9px; font-family: var(--f-display); font-weight: 600; font-size: .98rem; line-height: 1; padding: 14px 22px; border-radius: 10px; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, color .15s ease; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn-outline { border-color: var(--line-2); color: var(--ink); background: #fff; }
.btn-outline:hover { border-color: var(--ink); color: var(--ink); }
.btn-light { border-color: rgba(255,255,255,.45); color: #fff; background: rgba(255,255,255,.06); }
.btn-light:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn-sm { padding: 10px 16px; font-size: .9rem; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #e2e8f0; background: var(--ink); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: var(--ink) center / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(15,23,42,.97) 0%, rgba(15,23,42,.88) 42%, rgba(15,23,42,.35) 100%); }
.hero .container { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); gap: 48px; align-items: center; padding-block: clamp(56px, 9vw, 110px); }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero .lead { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #cbd5e1; max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: .95rem; color: #cbd5e1; }
.hero-points li { display: inline-flex; gap: 8px; align-items: center; }
.hero-points svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.eyebrow { display: inline-block; font-family: var(--f-display); font-weight: 600; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-600); margin-bottom: 14px; }
.hero .eyebrow { color: var(--brand); }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; } }

/* Tarjeta de muestra en el hero */
.hero-panel { background: rgba(15,23,42,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 24px; backdrop-filter: blur(6px); box-shadow: var(--shadow-lg); }
.hero-panel h2 { font-size: 1.05rem; color: #fff; margin-bottom: 4px; }
.hero-panel p.small { color: #94a3b8; font-size: .88rem; margin-bottom: 16px; }
.hero-panel .field label { color: #cbd5e1; }
.hero-panel select, .hero-panel input { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-panel option { color: var(--ink); }
.hero-result { display: flex; align-items: baseline; gap: 10px; margin: 16px 0 6px; }
.hero-result strong { font-family: var(--f-display); font-size: 2.8rem; color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
.hero-result span { color: #cbd5e1; font-size: .95rem; }
.hero-panel .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hero-panel a { color: var(--brand); }

/* ---------- Secciones ---------- */
.section { padding-block: clamp(60px, 8vw, 104px); }
.section-tight { padding-block: clamp(40px, 6vw, 64px); }
.section-white { background: #fff; }
.section-dark { background: var(--ink); color: #cbd5e1; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--brand); }
.section-head { max-width: 760px; margin-bottom: 44px; }
.section-head p { color: var(--slate); font-size: 1.08rem; }
.section-dark .section-head p { color: #94a3b8; }
.section-head.center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; min-width: 0; }
.card p { color: var(--slate); }
.card ul { color: var(--slate); margin: 0; }

/* Franja de clientes */
.logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 22px 44px; }
.logos img { height: 42px; width: auto; max-width: 130px; object-fit: contain; filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
.logos img:hover { filter: none; opacity: 1; }
.logos-label { text-align: center; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }

/* Cifras */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.stat { padding: 26px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat strong { display: block; font-family: var(--f-display); font-size: 2.3rem; color: var(--ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat strong span { color: var(--brand); }
.stat p { margin: 6px 0 0; color: var(--slate); font-size: .95rem; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat:nth-child(2) { border-right: 0; } .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* Servicios con imagen */
.service { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.service .ph { aspect-ratio: 16 / 9; background: var(--ink-2) center / cover; }
.service .body { padding: 24px 26px 28px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.service .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 12px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; color: var(--ink-3); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

/* Metodologías */
.methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); overflow: hidden; }
.method { background: var(--ink); padding: 28px 26px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: #cbd5e1; transition: background .2s; min-width: 0; }
.method:hover { background: #16213a; color: #cbd5e1; }
.method .abbr { font-family: var(--f-mono); font-size: .8rem; color: var(--brand); letter-spacing: .06em; }
.method h3 { color: #fff; margin: 0; }
.method p { margin: 0; font-size: .96rem; color: #94a3b8; }
.method .q { margin-top: auto; padding-top: 10px; font-size: .9rem; color: #e2e8f0; }
.method .q b { color: var(--brand); font-weight: 600; }
@media (max-width: 900px) { .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .methods { grid-template-columns: 1fr; } }

/* Divisiones */
.division { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; align-items: start; }
.division img { width: 180px; height: 130px; object-fit: cover; border-radius: 10px; background: var(--line); }
@media (max-width: 560px) { .division { grid-template-columns: 1fr; } .division img { width: 100%; height: 170px; } }

/* Sectores */
.sector { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 260px; display: flex; align-items: flex-end; color: #fff; text-decoration: none; background: var(--ink-2) center / cover; isolation: isolate; }
.sector::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(15,23,42,.05) 20%, rgba(15,23,42,.92) 100%); }
.sector .in { padding: 22px; width: 100%; }
.sector .in p { min-height: 6.2em; }
.sector h3 { color: #fff; margin-bottom: 4px; }
.sector p { color: #e2e8f0; font-size: .93rem; margin: 0; }
.sector .kpi { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; margin-top: 10px; font-size: .85rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.14); }
.sector:hover { color: #fff; }
.sector:hover::after { background: linear-gradient(180deg, rgba(226,153,0,.15) 10%, rgba(15,23,42,.94) 100%); }

/* Proceso (secuencia real) */
.steps { counter-reset: paso; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: paso; position: relative; padding-top: 52px; min-width: 0; }
.steps li::before { content: counter(paso, decimal-leading-zero); position: absolute; top: 0; left: 0; font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; color: var(--brand); }
.steps li::after { content: ""; position: absolute; top: 18px; left: 52px; right: 0; height: 1px; background: var(--line-2); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 1.05rem; margin-bottom: 6px; }
.steps p { font-size: .94rem; color: var(--slate); margin: 0; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .steps li::after { display: none; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Banda calculadora / CTA */
.band { background: linear-gradient(120deg, var(--ink) 0%, #1a2540 100%); color: #cbd5e1; border-radius: 20px; padding: clamp(28px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.band h2 { color: #fff; }
@media (max-width: 860px) { .band { grid-template-columns: 1fr; } }

/* Testimonios */
.quote { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.quote p { font-size: 1.08rem; color: var(--ink-2); margin: 0; }
.quote p::before { content: "“"; font-family: var(--f-display); color: var(--brand); font-size: 2.4rem; line-height: 0; vertical-align: -.35em; margin-right: 4px; }
.quote cite { font-style: normal; font-size: .9rem; color: var(--muted); margin-top: auto; }

/* Reconocimientos */
.award { display: flex; flex-direction: column; gap: 4px; }
.award .when { font-size: .85rem; color: var(--brand-600); font-weight: 600; }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 22px; }
.faq summary { cursor: pointer; font-family: var(--f-display); font-weight: 600; color: var(--ink); padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-600); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--slate); padding-bottom: 6px; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: .88rem; font-weight: 600; color: var(--ink-3); }
.field .hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
input, select, textarea { font: inherit; font-size: 1rem; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--slate); }
.check input { width: auto; margin-top: 4px; }
.form-msg { font-weight: 600; margin: 0; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--bad); }

.contact { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 14px; }
.contact-list a { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.contact-list .ic { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-50); color: var(--brand-600); }
.contact-list .ic svg { width: 21px; height: 21px; }
.contact-list small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Encabezado de página interna ---------- */
.page-hero { background: var(--ink); color: #cbd5e1; position: relative; isolation: isolate; overflow: hidden; }
.page-hero .hero-bg { opacity: .35; }
.page-hero .container { padding-block: clamp(46px, 7vw, 84px); }
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); max-width: 22ch; }
.page-hero p { max-width: 64ch; font-size: 1.1rem; color: #cbd5e1; margin: 0; }
.crumbs { font-size: .85rem; margin-bottom: 14px; color: #94a3b8; }
.crumbs a { color: #cbd5e1; text-decoration: none; }
.crumbs a:hover { color: var(--brand); }

/* ---------- Metodologías (página) ---------- */
.toc { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 2px; font-size: .93rem; }
.toc a { color: var(--slate); text-decoration: none; padding: 7px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--ink); border-left-color: var(--brand); }
.with-toc { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 48px; }
@media (max-width: 960px) { .with-toc { grid-template-columns: 1fr; } .toc { display: none; } }
.method-block { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 4vw, 36px); margin-bottom: 22px; scroll-margin-top: 100px; }
.method-block .abbr { font-family: var(--f-mono); font-size: .82rem; color: var(--brand-600); letter-spacing: .06em; }
.method-block h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-top: 4px; }
.method-block .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.method-block .cols > div { background: var(--bg); border-radius: 10px; padding: 16px 18px; min-width: 0; }
.method-block .cols h3 { font-size: .95rem; margin-bottom: 6px; }
.method-block .cols ul { margin: 0; color: var(--slate); font-size: .95rem; }
@media (max-width: 700px) { .method-block .cols { grid-template-columns: 1fr; } }

/* ---------- Prosa (blog, textos largos) ---------- */
.prose { max-width: 70ch; font-size: 1.08rem; color: var(--ink-2); }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.5em; }
.prose p, .prose li { color: var(--ink-3); }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--brand); color: var(--ink); font-size: 1.12rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose .table-wrap { overflow-x: auto; margin: 1.2em 0; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--f-display); font-weight: 600; background: var(--bg); }
.prose code { font-family: var(--f-mono); background: var(--bg); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.prose img { border-radius: 12px; margin: 1.4em 0; }
.formula { font-family: var(--f-mono); background: var(--ink); color: #f8fafc; border-radius: 10px; padding: 16px 20px; overflow-x: auto; font-size: .95rem; line-height: 1.8; }
.formula b { color: var(--brand); font-weight: 600; }

/* ---------- Blog ---------- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
@media (max-width: 960px) { .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .posts { grid-template-columns: 1fr; } }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .2s, transform .2s; min-width: 0; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.post-card .ph { aspect-ratio: 16 / 9; background: var(--ink-2) center / cover; }
.post-card .body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card h3 { font-size: 1.14rem; margin: 0; }
.post-card p { color: var(--slate); font-size: .95rem; margin: 0; }
.post-meta { font-size: .82rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.post-meta .cat { color: var(--brand-600); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.article-hero-img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--radius); margin: -48px 0 36px; box-shadow: var(--shadow-lg); position: relative; background: var(--line); }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.article-aside { position: sticky; top: 100px; display: grid; gap: 18px; }
@media (max-width: 980px) { .article-layout { grid-template-columns: 1fr; } .article-aside { position: static; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font: inherit; font-size: .9rem; font-weight: 600; background: #fff; border: 1px solid var(--line-2); color: var(--ink-3); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Calculadora ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
@media (max-width: 920px) { .calc { grid-template-columns: 1fr; } }
.calc-form { display: grid; gap: 20px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { font: inherit; font-size: .92rem; font-weight: 600; border: 0; background: transparent; color: var(--slate); padding: 8px 14px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; }
input[type="range"] { padding: 0; accent-color: var(--brand); height: 28px; border: 0; }
.calc-out { background: var(--ink); color: #cbd5e1; border-radius: var(--radius); padding: clamp(22px, 4vw, 34px); position: sticky; top: 100px; }
@media (max-width: 920px) { .calc-out { position: static; } }
.calc-out .big { font-family: var(--f-display); font-size: clamp(3rem, 8vw, 4.6rem); font-weight: 700; color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
.calc-out .big-label { color: #fff; font-weight: 600; margin: 6px 0 18px; }
.calc-out dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; margin: 0 0 18px; font-size: .95rem; }
.calc-out dt { color: #94a3b8; }
.calc-out dd { margin: 0; color: #fff; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.calc-out .explain { font-size: .92rem; color: #cbd5e1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; margin: 0; }
.calc-out .formula { background: rgba(255,255,255,.06); margin: 16px 0 0; }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.table-wrap { overflow-x: auto; }
.sens { border-collapse: collapse; width: 100%; font-size: .93rem; font-variant-numeric: tabular-nums; background: #fff; }
.sens th, .sens td { padding: 10px 12px; border: 1px solid var(--line); text-align: right; }
.sens th { background: var(--bg); font-family: var(--f-display); font-weight: 600; color: var(--ink); }
.sens td.hl { background: var(--brand-50); color: var(--ink); font-weight: 700; outline: 2px solid var(--brand); outline-offset: -2px; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 8px; }
.chart-box svg { width: 100%; height: auto; display: block; }

/* ---------- Tendencias ---------- */
.trend-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .trend-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .trend-summary { grid-template-columns: 1fr; } }
.kpi-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; min-width: 0; }
.kpi-tile:hover { border-color: var(--brand); color: inherit; }
.kpi-tile .sec { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kpi-tile .val { font-family: var(--f-display); font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-tile .lbl { font-size: .9rem; color: var(--slate); }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; width: fit-content; font-variant-numeric: tabular-nums; }
.pill.up { color: var(--good); background: var(--good-bg); }
.pill.down { color: var(--bad); background: var(--bad-bg); }
.pill.flat { color: var(--flat); background: var(--flat-bg); }
.sector-block { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin-bottom: 30px; scroll-margin-top: 100px; }
.sector-block .head { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sector-block .head .ph { background: var(--ink-2) center / cover; min-height: 200px; }
.sector-block .head .txt { padding: 26px 30px; }
.sector-block .head h2 { font-size: 1.7rem; margin-bottom: 6px; }
@media (max-width: 760px) { .sector-block .head { grid-template-columns: 1fr; } .sector-block .head .ph { min-height: 150px; } }
.analysis { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.analysis li { position: relative; padding-left: 22px; color: var(--ink-3); font-size: .98rem; }
.analysis li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.ind { background: #fff; padding: 20px 22px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ind h3 { font-size: .98rem; margin: 0; color: var(--ink); font-family: var(--f-body); font-weight: 600; }
.ind .src { font-size: .78rem; color: var(--muted); }
.ind .row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ind .v { font-family: var(--f-display); font-size: 1.55rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ind .p { font-size: .82rem; color: var(--muted); }
.ind svg { width: 100%; height: auto; margin-top: 8px; overflow: visible; }
.ind .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--slate); }
.studies { padding: 20px 30px 26px; background: var(--bg); border-top: 1px solid var(--line); }
.studies h3 { font-size: .95rem; margin-bottom: 10px; }
.studies .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.studies .tag { background: #fff; }
.notice { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--ink-2); border-radius: 12px; padding: 14px 18px; font-size: .93rem; }
.tt { position: fixed; pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: 6px 9px; border-radius: 6px; z-index: 60; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Pie de página ---------- */
.site-footer { background: var(--ink); color: #94a3b8; font-size: .94rem; }
.site-footer .container { padding-block: 56px 28px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: var(--brand); }
.footer-logo { --lh: 46px; background: #fff; display: block; box-sizing: content-box; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; width: calc(var(--lh) * 5.16); height: var(--lh); position: relative; overflow: hidden; }
.footer-logo img { position: absolute; max-width: none; width: auto; height: calc(var(--lh) * 2.202); top: calc(12px - var(--lh) * 0.5); left: calc(16px - var(--lh) * 0.053); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; font-size: .85rem; }

/* Botón flotante de WhatsApp */
.wa-float { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(0,0,0,.25); transition: transform .2s; }
.wa-float:hover { transform: scale(1.06); color: #fff; }
.wa-float svg { width: 30px; height: 30px; }

/* Utilidades */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.fade-in { animation: fade .6s ease both; }
@keyframes fade { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Gráficas de tendencias (SVG generado en el build) */
.ln-grid { stroke: var(--line); stroke-width: 1; }
.ln-area { fill: var(--brand); opacity: .08; }
.ln-cur { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.ln-prev { fill: none; stroke: var(--line-2); stroke-width: 1.6; stroke-dasharray: 4 3; }
.ln-dot { fill: var(--brand); stroke: #fff; stroke-width: 1.5; }
.ln-lbl { font: 600 8.5px var(--f-body); fill: var(--ink); }
.ln-ax { font: 7.5px var(--f-body); fill: var(--muted); }
.hit { fill: transparent; cursor: crosshair; }
.hit:hover { fill: var(--brand); fill-opacity: .25; }
/* Curva de la calculadora */
.cv-line { fill: none; stroke-width: 2.2; }
.cv-90 { stroke: var(--line-2); } .cv-95 { stroke: var(--brand); } .cv-99 { stroke: var(--ink); }
.cv-ax { font: 11px var(--f-body); fill: var(--muted); }
.cv-grid { stroke: var(--line); stroke-width: 1; }
.cv-me { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.cv-key { font: 600 11px var(--f-body); }
.prose .formula { margin: 1em 0 1.2em; }
.kpi-tile .pill { margin-top: auto; }

/* Menú desplegable de servicios */
.nav-drop { position: relative; }
.nav-drop-btn { font: inherit; font-weight: 500; font-size: .96rem; color: var(--ink-3); background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-drop-btn:hover, .nav-drop.open .nav-drop-btn, .nav-drop-btn[aria-current="page"] { color: var(--ink); background: var(--brand-50); }
.nav-drop-btn::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.nav-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: none; z-index: 60; }
.nav-drop:hover .nav-menu, .nav-drop:focus-within .nav-menu, .nav-drop.open .nav-menu { display: grid; gap: 2px; }
.nav-drop::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
.nav-menu a { display: block; padding: 10px 12px; }
.nav-menu a small { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
@media (max-width: 1100px) {
  .nav-drop-btn { display: none; }
  .nav-menu { position: static; display: grid; box-shadow: none; border: 0; padding: 0; min-width: 0; }
  .nav-menu a small { display: none; }
}

/* Tarjetas de servicios especializados */
.feature { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .2s, border-color .2s; min-width: 0; }
.feature:hover { box-shadow: var(--shadow); border-color: var(--brand); color: inherit; }
.feature .ph { background: var(--ink-2) center / cover; aspect-ratio: 21 / 8; max-width: 100%; }
.feature .body { padding: 26px 28px 28px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.feature .abbr { font-family: var(--f-mono); font-size: .8rem; color: var(--brand-600); letter-spacing: .06em; }
.feature h3 { margin: 0; font-size: 1.35rem; }
.feature p { color: var(--slate); margin: 0; }
.feature .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.feature .more { margin-top: auto; padding-top: 10px; font-family: var(--f-display); font-weight: 600; color: var(--brand-600); display: inline-flex; gap: 8px; align-items: center; }
.feature .more svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .feature .ph { aspect-ratio: 16 / 9; } }

/* Mini calculadora NOM-035 */
.nom-calc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }
.nom-calc .out { font-family: var(--f-display); font-size: 2.6rem; font-weight: 700; color: var(--brand); line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .nom-calc { grid-template-columns: 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { position: relative; padding-left: 30px; color: var(--ink-3); }
.checklist li::before { content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 6px; background: var(--brand-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c28200' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; }
.guide-table { border-collapse: collapse; width: 100%; font-size: .95rem; background: #fff; }
.guide-table th, .guide-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.guide-table th { font-family: var(--f-display); font-weight: 600; background: var(--bg); color: var(--ink); }
.article-layout > * { min-width: 0; }
