/* ============================================================
   UltraCalc.es — Hoja de estilos principal
   Dirección visual: "Fintech sereno" — azul confianza + verde dinero
   Tipografía: Space Grotesk (display/cifras) + Manrope (texto/UI)
   Light + Dark mode. Vanilla, sin dependencias.
   ============================================================ */

:root {
  /* Marca */
  --brand: #2451E6;
  --brand-strong: #1B3FC4;
  --brand-soft: #EAF0FF;
  --brand-ring: rgba(36,81,230,.35);
  --positive: #0E9F6E;
  --positive-soft: #E3F7EF;
  --negative: #E0435B;
  --negative-soft: #FCEBEE;
  --accent: #F4A52A; /* acento cálido para destacados puntuales */

  /* Neutros (light) */
  --bg: #FFFFFF;
  --surface: #F6F8FC;
  --surface-2: #EEF2FA;
  --ink: #0C1428;
  --text: #3A4660;
  --text-soft: #56617D;
  --muted: #7A8499;
  --border: #E4E9F3;
  --border-strong: #D2DAEA;
  --card: #FFFFFF;
  --footer-bg: #0B1426;
  --footer-text: #97A4C4;
  --shadow-sm: 0 1px 2px rgba(12,20,40,.06), 0 2px 6px rgba(12,20,40,.05);
  --shadow-md: 0 6px 18px rgba(12,20,40,.08);
  --shadow-lg: 0 18px 44px rgba(12,20,40,.14);

  /* Tipografía */
  --display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --maxw: 1180px;
  --header-h: 68px;
}

[data-theme="dark"] {
  --brand: #5B82FF;
  --brand-strong: #7A99FF;
  --brand-soft: #16213E;
  --brand-ring: rgba(91,130,255,.4);
  --positive: #3BD89B;
  --positive-soft: #10271F;
  --negative: #FF6B81;
  --negative-soft: #2A1419;

  --bg: #0A0F1C;
  --surface: #0F1729;
  --surface-2: #16203A;
  --ink: #EAF0FB;
  --text: #B6C2DC;
  --text-soft: #94A2C2;
  --muted: #6E7C9C;
  --border: #1E2A45;
  --border-strong: #2A3A5C;
  --card: #111A2E;
  --footer-bg: #060B16;
  --footer-text: #8493B5;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 22px 50px rgba(0,0,0,.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  font-size: 1.0625rem; /* 17px */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
/* Capa de fondo a pantalla completa: garantiza el color de fondo (claro/oscuro)
   incluso si el contenedor fuerza body transparente. */
body::before { content: ""; position: fixed; inset: 0; background: var(--bg); z-index: -1; transition: background .25s ease; }

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; font-weight: 600; }
.tnum { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 12px 20px; z-index: 300; font-weight: 700; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: var(--header-h); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 1.32rem; letter-spacing: -0.03em; flex: none; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; border-radius: 9px; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%); display: grid; place-items: center; box-shadow: 0 4px 12px var(--brand-ring); }
.brand .mark svg { width: 20px; height: 20px; }
.brand b { color: var(--brand); font-weight: 700; }

/* Contenedor colapsable: nav + buscador (se pliega en móvil) */
.nav-collapse { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.site-nav { display: flex; gap: 2px; }
.site-nav a { color: var(--text-soft); font-size: .98rem; font-weight: 600; padding: 9px 13px; border-radius: 9px; white-space: nowrap; }
.site-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.menu-btn { display: none; }

/* Buscador del header (popover) */
.search-pop { position: relative; margin-left: auto; flex: none; }
.search-pop .field { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; height: 40px; width: 230px; transition: border-color .15s, box-shadow .15s; }
.search-pop .field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--card); }
.search-pop .field svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search-pop input { flex: 1; border: 0; background: transparent; font-family: var(--sans); font-size: .95rem; color: var(--ink); }
.search-pop input:focus { outline: none; }
.search-pop input::placeholder { color: var(--muted); }
.search-suggest { position: absolute; top: 48px; left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; }
.search-suggest.open { display: block; }
.search-suggest a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: var(--text); font-size: .95rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.search-suggest .ico { width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: .9rem; flex: none; }
.search-suggest .none { padding: 16px; color: var(--muted); font-size: .92rem; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 700; font-size: 1rem; padding: 13px 24px; border-radius: 12px; border: 0; cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px var(--brand-ring); }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 9px 16px; font-size: .92rem; border-radius: 10px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Migas ---------- */
.breadcrumbs { padding: 22px 0 0; font-size: .9rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.breadcrumbs a { color: var(--text-soft); }
.breadcrumbs .sep { opacity: .5; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 36px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .82rem; letter-spacing: .03em; padding: 6px 14px; border-radius: 999px; text-transform: uppercase; }
.hero h1 { font-size: 3.1rem; margin-top: 18px; text-wrap: balance; font-weight: 700; }
.hero h1 .hl { color: var(--brand); }
.hero p.lead { font-size: 1.2rem; color: var(--text-soft); margin-top: 18px; max-width: 30ch; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero .trust { margin-top: 26px; display: flex; gap: 22px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.hero .trust span { display: flex; align-items: center; gap: 7px; }
.hero .trust svg { width: 16px; height: 16px; color: var(--positive); }

/* Mini-calculadora del hero */
.hero-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 26px; }
.hero-card .hc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hero-card .hc-head h3 { font-size: 1.15rem; }
.hero-card .hc-head .pill { font-size: .74rem; font-weight: 700; color: var(--positive); background: var(--positive-soft); padding: 4px 10px; border-radius: 999px; }

/* ---------- Campos de formulario ---------- */
.field-group { margin-bottom: 18px; }
.field-group > label { display: block; font-weight: 700; font-size: .92rem; color: var(--ink); margin-bottom: 7px; }
.field-group .hint { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .affix { position: absolute; color: var(--muted); font-weight: 700; font-size: .95rem; pointer-events: none; }
.input-wrap .affix.pre { left: 14px; }
.input-wrap .affix.suf { right: 14px; }
input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%; font-family: var(--sans); font-size: 1.05rem; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 12px;
  padding: 13px 15px; transition: border-color .15s, box-shadow .15s, background .15s;
  -moz-appearance: textfield;
}
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap.has-pre input { padding-left: 32px; }
.input-wrap.has-suf input { padding-right: 42px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--card); }
input::placeholder { color: var(--muted); font-weight: 500; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237A8499' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 4px; gap: 3px; }
.segmented button { font-family: var(--sans); font-weight: 700; font-size: .92rem; color: var(--text-soft); background: transparent; border: 0; padding: 9px 16px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.segmented button.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow-sm); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Slider */
.slider-row { display: flex; align-items: center; gap: 14px; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px; background: var(--surface-2); flex: 1; padding: 0; border: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid var(--card); box-shadow: var(--shadow-md); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid var(--card); box-shadow: var(--shadow-md); cursor: pointer; }

/* ---------- Resultado de calculadora ---------- */
.result-card { background: linear-gradient(160deg, var(--brand) 0%, var(--brand-strong) 100%); color: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-md); }
.result-card .rc-label { font-size: .9rem; font-weight: 600; opacity: .85; }
.result-card .rc-value { font-family: var(--display); font-size: 2.9rem; font-weight: 700; line-height: 1.05; margin-top: 4px; letter-spacing: -0.02em; }
.result-card .rc-sub { font-size: .95rem; opacity: .85; margin-top: 8px; }

.breakdown { margin-top: 18px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.breakdown .brow { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 1rem; }
.breakdown .brow:last-child { border-bottom: 0; }
.breakdown .brow .k { color: var(--text-soft); font-weight: 600; }
.breakdown .brow .v { color: var(--ink); font-weight: 700; font-family: var(--display); }
.breakdown .brow.total { background: var(--surface); }
.breakdown .brow.total .k { color: var(--ink); }
.breakdown .brow .v.pos { color: var(--positive); }
.breakdown .brow .v.neg { color: var(--negative); }

/* Layout de página de calculadora */
.calc-layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; padding: 8px 0 40px; align-items: start; }
.calc-main { min-width: 0; }
.calc-aside { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 22px; }
.calc-head { padding: 18px 0 22px; }
.calc-head h1 { font-size: 2.3rem; }
.calc-head p { color: var(--text-soft); font-size: 1.1rem; margin-top: 10px; max-width: 60ch; }
.calc-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.calc-inputs h2, .calc-output h2 { font-size: 1.1rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* ---------- Tarjetas de calculadora ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cards-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.calc-card { display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.calc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }
.calc-card .cc-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.calc-card .cc-ico svg { width: 24px; height: 24px; }
.calc-card h3 { font-size: 1.12rem; }
.calc-card p { font-size: .92rem; color: var(--text-soft); flex: 1; }
.calc-card .cc-foot { display: flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 700; font-size: .9rem; }
.calc-card .cc-foot svg { width: 15px; height: 15px; }
.calc-card.soon { opacity: .72; }
.calc-card.soon .cc-foot { color: var(--muted); }
.badge-soon { font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); padding: 3px 8px; border-radius: 999px; }

/* Categoría chips de color */
.cc-ico.cat-fin { background: var(--brand-soft); color: var(--brand); }
.cc-ico.cat-imp { background: var(--positive-soft); color: var(--positive); }
.cc-ico.cat-viv { background: #FFF1E0; color: #C77A14; }
.cc-ico.cat-aut { background: #F0EBFF; color: #6B4DD6; }
[data-theme="dark"] .cc-ico.cat-viv { background: #2A2012; }
[data-theme="dark"] .cc-ico.cat-aut { background: #1C1834; }

/* ---------- Secciones ---------- */
.section { padding: 44px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.9rem; }
.section-head p { color: var(--text-soft); margin-top: 6px; }
.section-head .more { font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; gap: 6px; }
.section-head .more svg { width: 15px; height: 15px; }
.eyebrow-sm { color: var(--brand); font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; }

/* Banda de categorías */
.cat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.cat-tile .ct-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.cat-tile .ct-ico svg { width: 23px; height: 23px; }
.cat-tile h3 { font-size: 1.1rem; }
.cat-tile p { font-size: .88rem; color: var(--text-soft); }
.cat-tile .count { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* Banda "cómo funciona" / valores */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.value-card { padding: 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.value-card .vc-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; color: var(--brand); margin-bottom: 14px; }
.value-card .vc-ico svg { width: 22px; height: 22px; }
.value-card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.value-card p { font-size: .95rem; color: var(--text-soft); }

/* ---------- Anuncios (AdSense) ---------- */
.ad-slot { margin: 32px 0; }
.ad-slot .ad-box { border: 1.5px dashed var(--border-strong); border-radius: 12px; min-height: 100px; display: grid; place-items: center; color: var(--muted); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; background: var(--surface); }
.ad-slot.banner .ad-box { min-height: 90px; }
.ad-slot.sidebar .ad-box { min-height: 600px; max-height: 600px; }
.ad-slot.inline .ad-box { min-height: 120px; }
.ad-label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; text-align: center; margin-bottom: 4px; }

/* Sticky ad móvil */
.sticky-ad { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: var(--card); border-top: 1px solid var(--border); padding: 6px; box-shadow: 0 -4px 18px rgba(0,0,0,.1); }
.sticky-ad .ad-box { min-height: 60px; border-radius: 8px; margin: 0; }
.sticky-ad .close-ad { position: absolute; top: -28px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--card); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1; display: grid; place-items: center; }

/* ---------- Tablas ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .96rem; margin: 18px 0; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: 12px 14px; text-align: left; }
.data-table th { color: var(--ink); font-weight: 700; background: var(--surface); font-family: var(--display); font-size: .9rem; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr:hover td { background: var(--surface); }

/* ---------- FAQ ---------- */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.faq-item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chev { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); transition: transform .2s; }
.faq-item[open] summary .chev { transform: rotate(45deg); }
.faq-item .ans { padding: 0 22px 20px; color: var(--text-soft); font-size: .98rem; }
.faq-item .ans p { margin-bottom: 10px; }

/* ---------- Blog ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.post-card .ph { height: 168px; background: var(--surface-2); position: relative; overflow: hidden; }
.post-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.post-card .bd { padding: 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.post-card .cat { font-size: .76rem; font-weight: 800; letter-spacing: .06em; color: var(--brand); text-transform: uppercase; }
.post-card h3 { font-size: 1.18rem; line-height: 1.28; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--brand); text-decoration: none; }
.post-card p { font-size: .92rem; color: var(--text-soft); flex: 1; }
.post-card .meta { font-size: .82rem; color: var(--muted); display: flex; gap: 12px; }

.idea-list { columns: 2; column-gap: 36px; }
.idea-list .idea-cat { break-inside: avoid; margin-bottom: 22px; }
.idea-list h3 { font-size: 1.05rem; color: var(--brand); margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.idea-list ul { list-style: none; }
.idea-list li { font-size: .95rem; padding: 5px 0; color: var(--text-soft); display: flex; gap: 8px; }
.idea-list li::before { content: "›"; color: var(--brand); font-weight: 800; }

/* ---------- Página de artículo ---------- */
.article-page { padding: 0 0 30px; }
.art-head { padding: 14px 0 4px; }
.art-head .cat { font-size: .82rem; font-weight: 800; letter-spacing: .06em; color: var(--brand); text-transform: uppercase; }
.art-head h1 { font-size: 2.5rem; margin-top: 12px; text-wrap: balance; }
.art-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: .9rem; color: var(--muted); padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-body { font-size: 1.08rem; }
.article-body h2 { font-size: 1.6rem; margin: 36px 0 14px; }
.article-body h3 { font-size: 1.25rem; margin: 26px 0 10px; }
.article-body p { margin: 0 0 18px; text-wrap: pretty; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; }
.article-body li { margin-bottom: 9px; }
.article-body strong { color: var(--ink); }
.article-body a { font-weight: 600; }
.callout { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; }
.callout h3 { margin: 0 0 10px; font-size: 1.1rem; color: var(--brand); }
.callout p:last-child { margin-bottom: 0; }
.calc-embed-cta { display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin: 28px 0; }
.calc-embed-cta .ce-ico { width: 50px; height: 50px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.calc-embed-cta .ce-ico svg { width: 26px; height: 26px; }
.calc-embed-cta div { flex: 1; }
.calc-embed-cta h4 { font-family: var(--display); font-size: 1.1rem; color: var(--ink); margin-bottom: 3px; }
.calc-embed-cta p { font-size: .9rem; color: var(--text-soft); margin: 0; }

/* ---------- Página de listado ---------- */
.page-title { padding: 30px 0 8px; }
.page-title h1 { font-size: 2.4rem; }
.page-title p { color: var(--text-soft); margin-top: 8px; font-size: 1.12rem; max-width: 64ch; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 22px 0 26px; }
.filters button { font-family: var(--sans); font-size: .94rem; font-weight: 700; cursor: pointer; background: var(--card); color: var(--text-soft); border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 18px; transition: all .15s; }
.filters button:hover { border-color: var(--brand); color: var(--brand); }
.filters button.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Páginas legales ---------- */
.legal-page { padding: 0 0 40px; }
.legal-page h1 { font-size: 2.2rem; padding: 30px 0 8px; }
.legal-page .updated { color: var(--muted); font-size: .92rem; margin-bottom: 24px; }
.legal-page h2 { font-size: 1.4rem; margin: 30px 0 12px; }
.legal-page h3 { font-size: 1.15rem; margin: 22px 0 10px; }
.legal-page p, .legal-page li { margin-bottom: 13px; }
.legal-page ul, .legal-page ol { margin: 0 0 16px 24px; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .94rem; }
.legal-page th, .legal-page td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.legal-page th { background: var(--surface); color: var(--ink); }

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; padding: 8px 0 40px; }
.contact-info .ci-item { display: flex; gap: 14px; margin-bottom: 22px; }
.contact-info .ci-item .ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.contact-info .ci-item h3 { font-size: 1.05rem; margin-bottom: 3px; }
.contact-info .ci-item p { font-size: .95rem; color: var(--text-soft); }
.form-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm); }
.form-note { display: none; background: var(--positive-soft); color: var(--positive); border-radius: 12px; padding: 14px 18px; font-weight: 700; font-size: .95rem; margin-bottom: 18px; }

/* ---------- Newsletter ---------- */
.newsletter { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%); border-radius: var(--radius-lg); padding: 44px; color: #fff; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.newsletter h2 { color: #fff; font-size: 1.9rem; }
.newsletter p { opacity: .9; margin-top: 10px; }
.newsletter form { display: flex; gap: 10px; }
.newsletter input { background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.3); color: #fff; }
.newsletter input::placeholder { color: rgba(255,255,255,.7); }
.newsletter input:focus { background: rgba(255,255,255,.24); border-color: #fff; box-shadow: none; }
.newsletter .btn-primary { background: #fff; color: var(--brand); box-shadow: none; }
.newsletter .btn-primary:hover { background: #EAF0FF; }

/* ---------- Pie ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 60px; }
.site-footer .cols { max-width: var(--maxw); margin: 0 auto; padding: 52px 24px 32px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; }
.site-footer .brand { color: #fff; margin-bottom: 14px; }
.site-footer .brand b { color: var(--brand-strong); }
.site-footer .about { font-size: .92rem; line-height: 1.6; max-width: 36ch; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; font-family: var(--sans); font-weight: 800; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: var(--footer-text); font-size: .94rem; }
.site-footer a:hover { color: #fff; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: var(--maxw); margin: 0 auto; font-size: .86rem; }
.site-footer .disclaimer { max-width: var(--maxw); margin: 0 auto; padding: 0 24px 24px; font-size: .8rem; color: color-mix(in srgb, var(--footer-text) 75%, transparent); line-height: 1.55; }

/* ---------- Banner de cookies ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 300; max-width: 560px; margin: 0 auto; background: var(--card); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.cookie-banner .in { padding: 22px 24px; }
.cookie-banner h4 { font-size: 1.1rem; margin-bottom: 8px; }
.cookie-banner p { font-size: .92rem; margin-bottom: 16px; }
.cookie-banner a { font-weight: 700; }
.cookie-banner .acts { display: flex; gap: 10px; }

/* ---------- Utilidades ---------- */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.divider { height: 1px; background: var(--border); margin: 36px 0; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: .8rem; font-weight: 700; color: var(--text-soft); background: var(--surface-2); padding: 5px 12px; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .calc-aside > * { flex: 1; min-width: 260px; }
  .ad-slot.sidebar .ad-box { min-height: 120px; max-height: none; }
}
@media (max-width: 940px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 2.6rem; }
  .hero p.lead { max-width: none; }
  .cards-grid, .cards-grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .cat-band { grid-template-columns: repeat(2, 1fr); }
  .value-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }

  /* Header: colapsar nav + buscador en un panel desplegable */
  .menu-btn { display: grid; }
  .nav-collapse { display: none; }
  .nav-collapse.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--border);
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav-collapse.open .site-nav { flex-direction: column; gap: 2px; order: 2; }
  .nav-collapse.open .site-nav a { padding: 13px 14px; font-size: 1.05rem; }
  .nav-collapse.open .search-pop { order: 1; margin: 0 0 6px; }
  .nav-collapse.open .search-pop .field { width: 100%; height: 46px; }
  .nav-collapse.open .search-suggest { position: static; box-shadow: none; margin-top: 6px; border-color: var(--border); }
}
@media (max-width: 640px) {
  .wrap, .wrap-narrow { padding: 0 16px; }
  .site-header .bar { padding: 0 16px; gap: 10px; }
  .calc-panel { grid-template-columns: 1fr; padding: 22px; }
  .cards-grid, .cards-grid.c4, .cat-band, .post-grid { grid-template-columns: 1fr; }
  .idea-list { columns: 1; }
  .hero { padding: 40px 0 28px; }
  .hero h1 { font-size: 2.15rem; }
  .hero .cta-row .btn { flex: 1; justify-content: center; }
  .art-head h1 { font-size: 1.9rem; }
  .calc-head h1 { font-size: 1.85rem; }
  .section-head h2, .page-title h1 { font-size: 1.6rem; }
  .result-card .rc-value { font-size: 2.2rem; }
  .row-2 { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding: 9px 10px; font-size: .86rem; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 26px; }
  .sticky-ad { display: block; }
  .newsletter { padding: 30px 22px; }
  .newsletter form { flex-direction: column; }
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; }
}

@media print {
  .site-header, .site-footer, .cookie-banner, .ad-slot, .sticky-ad, .calc-aside { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
