/* herramientas.css — hoja compartida por el hub y todas las calculadoras.
   Mismos tokens que el resto del sitio (Inter, naranja/tinta de marca) para que
   /herramientas/ se sienta parte del sitio, no una sub-marca aparte. Mobile-first:
   la mayoría del tráfico llega desde Meta Ads en celular. */

:root {
  --ink: #20232B;
  --text: #20232B;
  --orange: #F98E1C;
  --orange-deep: #D9750A;
  --cream: #F5EFE2;
  --paper: #FFFFFF;
  --bg-soft: #F6F5FB;
  --steel: #6B7280;
  --steel-light: #E4E3EC;
  --white: #FFFFFF;
  --max: 1180px;
  --radius: 22px;
  --radius-pill: 999px;
  --grad-1: #FFDCC0;
  --grad-2: #FFC89B;
  --grad-3: #FFEFD6;
  --ok: #1D7A46;
  --ok-bg: #E7F5EC;
  --warn: #C43D3D;
  --warn-bg: #FBEAEA;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em 0;
  line-height: 1.15;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange-deep);
  margin-bottom: 0.6rem;
  display: inline-block;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  padding: 0.85rem 1.7rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-deep); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(217,117,10,0.28); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--steel-light); }
.btn-outline:hover { background: var(--bg-soft); transform: translateY(-2px); }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--orange-deep); outline-offset: 2px;
}

/* ---------- HEADER / NAV ---------- */
header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--steel-light); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 1.5rem; max-width: var(--max); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { height: 44px; width: auto; }
.brand-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--ink); }
.flag-co { border-radius: 2px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 0.9rem; font-family: 'Inter', sans-serif; font-weight: 500; opacity: 0.75; transition: opacity 0.15s, color 0.15s; }
.nav-links a:hover { opacity: 1; color: var(--orange-deep); }
.nav-links a.is-active { opacity: 1; color: var(--orange-deep); }
.nav-cta { background: var(--orange); color: #fff !important; opacity: 1 !important; padding: 0.55rem 1.2rem; border-radius: var(--radius-pill); }
.nav-cta:hover { background: var(--orange-deep) !important; color: #fff !important; }
.burger { display: none; background: none; border: none; color: var(--ink); font-size: 1.6rem; cursor: pointer; }
#nav-toggle { display: none; }
@media (max-width: 860px) {
  .burger { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: flex-start; padding: 1.2rem 1.5rem 1.5rem; gap: 1.1rem; display: none; border-bottom: 1px solid var(--steel-light); }
  #nav-toggle:checked ~ .nav-links { display: flex; }
}

.breadcrumb { padding: 1.4rem 0 0; font-family: 'Inter', sans-serif; font-size: 0.85rem; }
.breadcrumb a { color: var(--steel); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange-deep); }

/* ---------- COTA / línea de dimensión (motivo de marca) ---------- */
.cota { display: flex; align-items: center; gap: 1rem; max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
.cota-line { flex: 1; height: 1px; background: var(--steel-light); position: relative; }
.cota-line::before { content: ''; position: absolute; top: -5px; width: 1px; height: 11px; background: var(--steel-light); }
.cota-line.left::before { right: 0; }
.cota-line.right::before { left: 0; }
.cota-label { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--steel); white-space: nowrap; }
.cota-section { padding: 2.2rem 0 1.4rem; }

/* ---------- CALCULADORA: cabecera ---------- */
.calc-hero { padding: 1.2rem 0 0.4rem; }
.calc-hero h1 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); color: var(--ink); margin: 0.3rem 0 0.6rem; }
.calc-hero p.lead { color: var(--steel); font-size: 1rem; max-width: 640px; }
.calc-meta { color: var(--steel); font-size: 0.8rem; margin-top: 0.6rem; }

/* ---------- CALCULADORA: layout ---------- */
.calc-layout { display: grid; grid-template-columns: 1fr; gap: 1.6rem; padding: 1.2rem 0 2.4rem; }
@media (min-width: 900px) {
  .calc-layout { grid-template-columns: 1fr 1fr; align-items: start; gap: 2.4rem; }
}

.calc-panel {
  background: #fff; border: 1px solid var(--steel-light); border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
}
.calc-panel h2 { font-size: 1.05rem; margin-bottom: 1rem; }

.campo { margin-bottom: 1.1rem; }
.campo label {
  display: block; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.85rem;
  color: var(--ink); margin-bottom: 0.4rem;
}
.campo .ayuda { font-size: 0.78rem; color: var(--steel); margin-top: 0.3rem; }
.campo input[type="text"], .campo input[type="number"], .campo select {
  width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--steel-light); border-radius: 14px;
  font-family: 'Inter', sans-serif; font-size: 0.98rem; color: var(--ink); background: #fff;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--orange); }
.campo-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 420px) { .campo-fila { grid-template-columns: 1fr; } }

.toggle-row { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.9rem 0; }
.toggle-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--orange); margin-top: 0.15rem; }
.toggle-row label { font-size: 0.88rem; color: var(--ink); font-weight: 500; }
.toggle-row .ayuda { font-size: 0.78rem; color: var(--steel); margin-top: 0.2rem; }

.lista-dinamica-item {
  border: 1px solid var(--steel-light); border-radius: 16px; padding: 1rem; margin-bottom: 0.8rem; position: relative;
}
.lista-dinamica-quitar {
  position: absolute; top: 0.6rem; right: 0.6rem; background: none; border: none; color: var(--steel);
  font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 0.2rem 0.4rem;
}
.lista-dinamica-quitar:hover { color: var(--warn); }

/* ---------- CALCULADORA: resultado (enmarcado con la cota) ---------- */
.resultado-panel {
  background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 1.6rem 1.7rem;
}
.resultado-cota { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.2rem; }
.resultado-cota .cota-line { background: rgba(255,255,255,0.2); }
.resultado-cota .cota-line::before { background: rgba(255,255,255,0.2); }
.resultado-cota .cota-label { color: var(--steel-light); }

.resultado-principal { text-align: center; padding: 0.6rem 0 1.4rem; }
.resultado-principal .cifra {
  font-family: 'Inter', sans-serif; font-weight: 800; font-size: clamp(1.9rem, 6vw, 2.6rem);
  color: var(--orange); letter-spacing: -0.02em; line-height: 1.1;
}
.resultado-principal .etiqueta { font-size: 0.85rem; color: var(--steel-light); margin-top: 0.4rem; }

.resultado-tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 0.6rem; }
.resultado-tabla th, .resultado-tabla td { padding: 0.55rem 0; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.12); }
.resultado-tabla th { font-weight: 600; color: var(--steel-light); }
.resultado-tabla td.num { text-align: right; font-variant-numeric: tabular-nums; }
.resultado-tabla tr.total td { font-weight: 700; color: #fff; border-bottom: none; padding-top: 0.9rem; }

.semaforo { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; padding: 0.3rem 0.7rem; border-radius: var(--radius-pill); }
.semaforo.ok { background: var(--ok-bg); color: var(--ok); }
.semaforo.warn { background: var(--warn-bg); color: var(--warn); }

.resultado-acciones { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }
.resultado-acciones .btn { flex: 1; justify-content: center; }

/* ---------- Explicación / ejemplo / FAQ ---------- */
.calc-body { max-width: 760px; margin: 0 auto; padding: 1rem 0 2.4rem; }
.calc-body h2 { font-size: 1.3rem; margin-top: 2rem; color: var(--ink); }
.calc-body p { color: var(--text); margin-bottom: 1.05rem; }
.calc-body ul, .calc-body ol { margin-bottom: 1.05rem; padding-left: 1.3rem; color: var(--text); }
.calc-body li { margin-bottom: 0.4rem; }
.calc-body strong { color: var(--ink); }
.calc-body a { color: var(--orange-deep); text-decoration: underline; }

.p-faq { padding: 0.4rem 0 1rem; max-width: 760px; margin: 0 auto; }
.faq-list details { border-bottom: 1px solid var(--steel-light); padding: 1.1rem 0; }
.faq-list summary { cursor: pointer; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; color: var(--ink); }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--orange-deep); margin-left: 1rem; }
.faq-list details[open] summary::after { content: '\2013'; }
.faq-list details p { color: var(--steel); margin: 0.8rem 0 0; }

/* ---------- CTA / disclaimer / comunidad ---------- */
.calc-cta { background: var(--bg-soft); border: 1px solid var(--steel-light); border-radius: var(--radius); padding: 1.4rem 1.6rem; max-width: 760px; margin: 0 auto 1.6rem; }
.calc-cta h3 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.calc-cta p { color: var(--steel); margin-bottom: 1rem; }
.calc-cta-ctas { display: flex; gap: 0.7rem; flex-wrap: wrap; }

.disclaimer { max-width: 760px; margin: 0 auto 1rem; font-size: 0.8rem; color: var(--steel); }
.parametros-fecha { max-width: 760px; margin: 0 auto 1.6rem; font-size: 0.78rem; color: var(--steel); }

/* ---------- HUB (index de calculadoras) ---------- */
.hub-hero { padding: 2rem 0 1rem; }
.hub-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); color: var(--ink); margin: 0.4rem 0 0.6rem; }
.hub-hero p { color: var(--steel); font-size: 1.05rem; max-width: 640px; }
.hub-buscador { margin: 1.4rem 0 0; max-width: 420px; }
.hub-buscador input {
  width: 100%; padding: 0.8rem 1.1rem; border: 1.5px solid var(--steel-light); border-radius: var(--radius-pill);
  font-family: 'Inter', sans-serif; font-size: 0.95rem; color: var(--ink); background: #fff;
}
.hub-buscador input:focus { outline: none; border-color: var(--orange); }

.hub-categoria { padding: 1.6rem 0 0.4rem; }
.hub-categoria h2 { font-size: 1.05rem; color: var(--steel); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 0.8rem 0 1.6rem; }
@media (max-width: 900px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hub-grid { grid-template-columns: 1fr; } }

.hub-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--steel-light); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s;
}
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(32,35,43,0.08); }
.hub-card h3 { font-size: 1.02rem; margin: 0.2rem 0 0.5rem; }
.hub-card p { color: var(--steel); font-size: 0.88rem; margin: 0; flex: 1; }
.hub-card .estado { margin-top: 0.9rem; font-weight: 600; font-size: 0.82rem; color: var(--orange-deep); }
.hub-card.proximamente { opacity: 0.6; cursor: default; }
.hub-card.proximamente:hover { transform: none; box-shadow: none; }
.hub-card.proximamente .estado { color: var(--steel); }
.hub-card[aria-disabled="true"] { pointer-events: none; }

/* ---------- FOOTER (mismo patrón del sitio) ---------- */
footer { background: var(--ink); color: var(--steel-light); padding: 3rem 0 1.6rem; }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid #383B45; }
.foot-brand { display: flex; align-items: center; gap: 0.7rem; }
.foot-brand img { height: 38px; }
.foot-brand span { font-family: 'Inter', sans-serif; font-weight: 700; color: #fff; font-size: 0.95rem; }
.foot-cta p { margin: 0 0 0.8rem; font-size: 0.9rem; }
.social-icon { color: var(--cream); opacity: 0.85; transition: opacity 0.15s, color 0.15s; display: inline-flex; }
.social-icon:hover { opacity: 1; color: var(--orange); }
.foot-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; padding-top: 1.4rem; font-size: 0.78rem; font-family: 'Inter', sans-serif; color: var(--steel-light); opacity: 0.7; }
.foot-bottom a { color: inherit; text-decoration: underline; }

.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta { display: flex; gap: 0.6rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; background: #fff; padding: 0.7rem 0.9rem; border-top: 1px solid var(--steel-light); box-shadow: 0 -4px 14px rgba(0,0,0,0.1); }
  .sticky-cta .btn { flex: 1; justify-content: center; font-size: 0.78rem; padding: 0.8rem 0.6rem; }
  body { padding-bottom: 64px; }
}

/* ---------- GATE DE REGISTRO POR WHATSAPP (primera visita a una herramienta) ---------- */
.ec-gate-wa {
  display: none; position: fixed; inset: 0; z-index: 99999;
  align-items: center; justify-content: center; padding: 1.2rem;
  background: rgba(32,35,43,0.92);
}
.ec-gate-wa-box {
  background: var(--paper); border-radius: var(--radius); padding: 2rem 1.8rem;
  max-width: 420px; width: 100%; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.ec-gate-wa-box img { height: 48px; width: auto; margin: 0 auto 1rem; }
.ec-gate-wa-box h2 { font-size: 1.25rem; margin: 0 0 0.7rem; color: var(--ink); }
.ec-gate-wa-box p { font-size: 0.92rem; color: var(--steel); margin: 0 0 1.4rem; line-height: 1.55; }
.ec-gate-wa-box .btn { width: 100%; justify-content: center; }
@media (max-width: 420px) {
  .ec-gate-wa-box { padding: 1.6rem 1.3rem; }
}

/* ---------- COOKIE BANNER (mismo patrón del sitio) ---------- */
.cookie-banner { display: none; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; background: var(--ink); color: var(--steel-light); padding: 0.9rem 1.5rem; text-align: center; }
.cookie-banner p { margin: 0; font-size: 0.85rem; max-width: 720px; }
.cookie-banner p a { color: var(--orange); text-decoration: underline; }
.cookie-banner .btn { flex-shrink: 0; padding: 0.6rem 1.3rem; font-size: 0.85rem; }

/* ---------- IMPRESIÓN (botón "Descargar resultado (PDF)") ---------- */
@media print {
  header, footer, .sticky-cta, .cookie-banner, .calc-cta, .p-faq, .calc-body,
  .breadcrumb, .no-imprimir, .hub-buscador { display: none !important; }
  body { background: #fff; }
  .calc-layout { display: block; padding: 0; }
  .calc-panel { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  .resultado-panel { background: #fff !important; color: #111 !important; border: 1px solid #ccc; }
  .resultado-panel .cifra { color: #111 !important; }
  .resultado-panel .etiqueta, .resultado-cota .cota-label, .resultado-tabla th { color: #555 !important; }
  .resultado-tabla tr.total td { color: #111 !important; }
  .resultado-tabla th, .resultado-tabla td { border-bottom-color: #ddd !important; }
  .print-header { display: flex !important; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 2px solid #111; }
  .print-header img { height: 36px; }
  .print-footer { display: block !important; margin-top: 1.2rem; font-size: 0.72rem; color: #555; }
}
.print-header, .print-footer { display: none; }
