/* Temperatura Perfecta — look luminoso.
   Fondo blanco, banda azul cielo en la portada, azul intenso + naranja vivo.
   Cada categoría tiene su color: calefacción naranja, humedad turquesa, verano sol.
   Lo memorable: el termómetro de la calculadora (azul → sol → naranja). */
:root {
  --bg: #ffffff;
  --sky: #e9f4ff;
  --surface: #ffffff;
  --ink: #0f2b46;
  --muted: #334659;
  --line: #d5e4f2;
  --cold: #0b66d6;
  --cold-soft: #e3f0ff;
  --warm: #ff5b14;
  --warm-ink: #c2410c;
  --warm-soft: #fff0e6;
  --sun: #ffb21e;
  --sun-ink: #8a5a00;
  --teal: #0fa3a3;
  --teal-ink: #0b7373;
  --pending: #fff2b8;
  --shadow: 0 1px 2px rgb(15 43 70 / 0.06), 0 10px 30px -12px rgb(11 102 214 / 0.28);
  --font-display: "Gabarito", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-data: "Gabarito", "Figtree", system-ui, sans-serif;
  --step--1: 0.98rem;
  --step-0: 1.125rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.1rem, 5.2vw, 3.4rem);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1a29; --sky: #10263c; --surface: #132a41; --ink: #eef5fc; --muted: #c6d5e3;
    --line: #23415e; --cold: #6cb2ff; --cold-soft: #16365a; --warm: #ff7a3d; --warm-ink: #ff9a66;
    --warm-soft: #3a2316; --sun: #ffc24d; --sun-ink: #ffd27a; --teal: #3cc9c9; --teal-ink: #6fdcdc;
    --pending: #4a3f12; --shadow: 0 10px 30px -14px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1a29; --sky: #10263c; --surface: #132a41; --ink: #eef5fc; --muted: #c6d5e3;
  --line: #23415e; --cold: #6cb2ff; --cold-soft: #16365a; --warm: #ff7a3d; --warm-ink: #ff9a66;
  --warm-soft: #3a2316; --sun: #ffc24d; --sun-ink: #ffd27a; --teal: #3cc9c9; --teal-ink: #6fdcdc;
  --pending: #4a3f12; --shadow: 0 10px 30px -14px rgb(0 0 0 / 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
}
a { color: var(--cold); text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}
.thermo { height: 3px; background: linear-gradient(90deg, var(--cold), var(--teal) 35%, var(--sun) 65%, var(--warm)); }

/* Cabecera */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; font-size: var(--step--1); font-weight: 600; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.nav a:hover { background: var(--cold-soft); color: var(--cold); }
.nav a[href*="calefaccion"]:hover { background: var(--warm-soft); color: var(--warm-ink); }
.nav a[href*="humedad"]:hover { background: color-mix(in srgb, var(--teal) 14%, transparent); color: var(--teal-ink); }
.nav a[href*="verano"]:hover { background: color-mix(in srgb, var(--sun) 22%, transparent); color: var(--sun-ink); }

/* Inicio */
.hero { background: var(--sky); }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding-block: 64px 72px; }
.hero-text { display: grid; gap: 22px; min-width: 0; }
.hero h1 { max-width: 13ch; }
.eyebrow { font-size: var(--step-0); font-weight: 600; color: var(--cold); }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--muted); max-width: 32ch; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; font-size: var(--step--1); color: var(--muted); }
.facts span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; }
.facts strong { font-family: var(--font-data); color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.calc { background: var(--surface); border-radius: 22px; padding: 26px; display: grid; gap: 18px; min-width: 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.calc h2 { font-size: var(--step-1); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button {
  font: inherit; font-size: var(--step--1); font-weight: 600; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 13px;
}
.presets button:hover { border-color: var(--cold); }
.presets button[aria-pressed="true"] { background: var(--cold); border-color: var(--cold); color: #fff; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fields label { display: grid; gap: 4px; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.fields input {
  font: inherit; font-family: var(--font-data); font-size: 1.1rem; font-weight: 600; color: var(--ink);
  background: var(--sky); border: 1.5px solid transparent; border-radius: 12px; padding: 9px 12px; width: 100%; min-width: 0;
  font-variant-numeric: tabular-nums;
}
.fields input:focus { border-color: var(--cold); outline: none; background: var(--surface); }
.result { padding-top: 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.result .eur { font-family: var(--font-data); font-size: 3.4rem; font-weight: 800; color: var(--warm); font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.02em; }
.result .kwh { color: var(--muted); font-size: var(--step--1); font-weight: 600; font-variant-numeric: tabular-nums; }
.note { font-size: var(--step--1); color: var(--muted); }

/* Termómetro del coste */
.gauge { display: grid; gap: 6px; }
.gauge-track { position: relative; height: 14px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, var(--cold), var(--teal) 30%, var(--sun) 60%, var(--warm)); }
.gauge-rest { position: absolute; top: 0; right: 0; bottom: 0; background: var(--sky); transition: width 0.35s ease; }
.gauge-scale { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Secciones y tarjetas */
.section { padding-block: 56px; }
.section .wrap { display: grid; gap: 24px; }
.section + .section { border-top: 1px solid var(--line); }
.finder-band { background: var(--surface); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--cold);
  border-radius: 16px; padding: 20px 22px 22px; display: grid; gap: 10px; align-content: start;
  color: var(--ink); text-decoration: none;
}
.card:hover { box-shadow: var(--shadow); }
.card:hover h3 { color: var(--cold); }
.card .meta { font-size: var(--step--1); font-weight: 600; color: var(--muted); }
.card p { color: var(--muted); }
.card.c-calor { border-top-color: var(--warm); }
.card.c-calor .meta { color: var(--warm-ink); }
.card.c-calor:hover h3 { color: var(--warm-ink); }
.card.c-humedad { border-top-color: var(--teal); }
.card.c-humedad .meta { color: var(--teal-ink); }
.card.c-humedad:hover h3 { color: var(--teal-ink); }
.card.c-verano { border-top-color: var(--sun); }
.card.c-verano .meta { color: var(--sun-ink); }
.card.c-verano:hover h3 { color: var(--sun-ink); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.section-head a { font-size: var(--step--1); font-weight: 700; }
.crumbs { font-size: var(--step--1); color: var(--muted); }
.crumbs a { color: var(--muted); }
.cat-hero { background: var(--sky); }
.cat-hero .wrap { display: grid; gap: 14px; padding-block: 48px 44px; }
.email { font-family: var(--font-data); font-size: var(--step-1); font-weight: 700; }
.article ol ::marker { color: var(--warm); font-weight: 700; }
.topics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 16px 28px; }
.topics div { display: grid; gap: 6px; }
.topics p { color: var(--muted); font-size: var(--step--1); }

/* Artículos y páginas legales */
.article .wrap { max-width: 46rem; padding-block: 44px 64px; display: grid; gap: 22px; }
.article h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); }
.article .byline { font-size: var(--step--1); color: var(--muted); }
.article h2 { margin-top: 22px; }
.article ul, .article ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.article ul ::marker { color: var(--cold); }
.answer { background: var(--cold-soft); border-radius: 12px; padding: 18px 20px; border-left: 4px solid var(--cold); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--sky); }
th { font-weight: 700; color: var(--ink); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--font-data); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
th.num { text-align: right; }
td.best { color: var(--teal-ink); font-weight: 800; }
.picks { display: grid; gap: 14px; }
.pick { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 8px; }
.pick .for { font-size: var(--step--1); font-weight: 700; color: var(--cold); }
.btn {
  justify-self: start; display: inline-block; background: var(--warm); color: #fff; font-weight: 700;
  text-decoration: none; padding: 11px 20px; border-radius: 999px; font-size: var(--step-0);
  box-shadow: 0 4px 12px -6px rgb(255 91 20 / 0.55); transition: background .15s, transform .15s;
}
.btn:hover { background: var(--warm-ink); text-decoration: none; transform: translateY(-1px); }
.pendiente { background: var(--pending); padding: 0 4px; border-radius: 4px; }

/* Pie */
.site-footer { background: var(--ink); color: #dde7f0; font-size: var(--step--1); }
.site-footer .wrap { display: grid; gap: 12px; padding-block: 36px; }
.site-footer strong { color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #07121d; } }
:root[data-theme="dark"] .site-footer { background: #07121d; }

@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 36px 44px; gap: 28px; }
  .calc { padding: 20px; }
  .result .eur { font-size: 2.8rem; }
  .section { padding-block: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Buscador por modelo */
.finder { display: grid; gap: 14px; background: var(--sky); border-radius: 22px; padding: 24px; min-width: 0; }
.finder-label { font-weight: 700; font-size: var(--step-1); font-family: var(--font-display); }
.finder-box { position: relative; }
.finder-box input {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: 999px; padding: 13px 20px;
}
.finder-box input:focus { border-color: var(--cold); outline: none; }
.suggest {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  max-height: 22rem; overflow-y: auto;
}
.suggest li { display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.suggest li span { font-size: var(--step--1); color: var(--muted); }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--cold-soft); }
.suggest li.none { cursor: default; color: var(--muted); }
.finder-result { display: grid; gap: 14px; background: var(--surface); border-radius: 16px; padding: 20px; }
.finder .fields input { background: var(--sky); }
.fr-head { display: grid; gap: 2px; }
.fr-type { font-size: var(--step--1); font-weight: 700; color: var(--cold); }
.fr-w { color: var(--muted); font-size: var(--step--1); font-weight: 600; }
.fr-out { display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: end; }
.fr-out > div { display: grid; gap: 2px; }
.fr-lab { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.finder .eur { font-family: var(--font-data); font-size: 2.4rem; font-weight: 800; color: var(--warm); font-variant-numeric: tabular-nums; line-height: 1.05; }
.fr-max { font-family: var(--font-data); font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-link { font-weight: 700; }
.article.wide .wrap { max-width: 58rem; }
.site-footer .small { font-size: 0.9rem; color: #c2d2e1; }


/* ===== Rediseño profesional (nov 2026) ===== */
html { scroll-padding-top: 84px; }
body { -webkit-font-smoothing: antialiased; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.18em; }

/* Cabecera fija */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.site-header .wrap { flex-wrap: nowrap; gap: 24px; padding-block: 12px; }
.nav { margin-left: auto; flex-wrap: nowrap; }
.nav a { position: relative; color: var(--ink); }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--sky); }
.hdr-cta { flex: none; background: var(--ink); color: var(--bg); font-weight: 700; font-size: var(--step--1); text-decoration: none; padding: 9px 16px; border-radius: 10px; }
.hdr-cta:hover { background: var(--cold); color: #fff; }

/* Portada */
.trust { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; font-weight: 600; }
.trust li { display: flex; gap: 10px; align-items: center; }
.trust .ic { color: #fff; background: var(--teal); border-radius: 999px; padding: 3px; width: 1.4em; height: 1.4em; stroke-width: 3; }
.calc { border-radius: 18px; }
.stats { background: var(--ink); color: #fff; }
.stats .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-block: 26px; }
.stats div { display: grid; gap: 2px; padding-left: 16px; border-left: 1px solid rgb(255 255 255 / .18); }
.stats div:first-child { border-left: 0; padding-left: 0; }
.stats strong { font-family: var(--font-data); font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stats span { font-size: var(--step--1); color: #d3dfea; }
:root[data-theme="dark"] .stats { background: #07121d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stats { background: #07121d; } }
.finder { border-radius: 16px; }

/* Tarjetas */
.card { border-top-width: 1px; border-radius: 14px; padding: 22px; gap: 10px; transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--cold); }
.card.c-calor::before { background: var(--warm); }
.card.c-humedad::before { background: var(--teal); }
.card.c-verano::before { background: var(--sun); }
.card:hover { transform: translateY(-3px); border-color: transparent; }
.card .meta { display: flex; align-items: center; gap: 6px; text-transform: none; }
.card .more { margin-top: 4px; font-size: var(--step--1); font-weight: 700; color: var(--ink); }
.card:hover .more { color: var(--cold); }
.card.c-calor:hover .more { color: var(--warm-ink); }
.card.c-humedad:hover .more { color: var(--teal-ink); }
.card.c-verano:hover .more { color: var(--sun-ink); }

/* Método */
.method { background: var(--sky); }
.section.method + .section, .section + .section.method { border-top: 0; }
.steps { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 18px; }
.steps li { counter-increment: st; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--cold); color: #fff; font-family: var(--font-data); font-weight: 800; }
.steps strong { font-family: var(--font-display); font-size: var(--step-1); }
.steps p { color: var(--muted); }

/* Tablas */
.table-scroll { border-radius: 12px; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }
tbody tr:hover td { background: color-mix(in srgb, var(--sky) 60%, transparent); }

/* Fichas de modelo: resumen */
.summary { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 16px; align-items: stretch; }
.summary .answer { display: flex; align-items: center; }
.sum-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 2px; align-content: center; box-shadow: var(--shadow); }
.sum-lab { font-size: var(--step--1); font-weight: 600; color: var(--muted); }
.sum-eur { font-family: var(--font-data); font-size: 2.6rem; font-weight: 800; line-height: 1.05; color: var(--warm); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
.sum-unit { font-size: var(--step--1); color: var(--muted); margin-bottom: 12px; }
.sum-box .btn { justify-self: stretch; text-align: center; font-size: var(--step--1); padding: 10px 14px; }
.sum-note { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 4px; }

/* Guías: índice y nota final */
.toc { border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: grid; gap: 8px; }
.toc p { font-size: var(--step--1); font-weight: 700; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; font-size: var(--step--1); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--cold); text-decoration: underline; }
.article h2[id] { scroll-margin-top: 84px; }
.pick { border-radius: 12px; }
.about-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; font-size: var(--step--1); color: var(--muted); }
.about-box strong { color: var(--ink); }

/* Pie */
.site-footer .wrap { gap: 28px; padding-block: 48px 32px; }
.ft-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; }
.ft-brand { display: grid; gap: 12px; align-content: start; max-width: 30ch; }
.site-footer .brand { color: #fff; font-size: 1.15rem; }
.site-footer .brand svg path { stroke: #fff; }
.site-footer h2 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 700; color: #fff; margin-bottom: 10px; letter-spacing: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a, .ft-legal a { color: #dde7f0; text-decoration: none; }
.site-footer ul a:hover, .ft-legal a:hover { color: #fff; text-decoration: underline; }
.ft-bottom { display: grid; gap: 10px; border-top: 1px solid rgb(255 255 255 / .14); padding-top: 22px; }
.ft-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 860px) {
  .ft-grid { grid-template-columns: 1fr 1fr; }
  .ft-brand { grid-column: 1 / -1; }
  .stats .wrap { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .stats div:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 760px) {
  .site-header { position: static; }
  .site-header .wrap { flex-wrap: wrap; gap: 10px 12px; padding-block: 10px; }
  .hdr-cta { margin-left: auto; padding: 8px 12px; }
  .nav { order: 3; width: 100%; margin: 0 -6px; overflow-x: auto; scrollbar-width: none; }
  .nav a { white-space: nowrap; flex: none; }
  .summary { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .brand { font-size: 1.1rem; } .ft-grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; }
.card .more { margin-top: auto; padding-top: 6px; }
@media (max-width: 480px) {
  .hdr-cta { display: none; }
  .nav { gap: 0; }
  .nav a { padding: 6px 10px; }
}

/* Legibilidad */
.card p, .steps p, .lead, .note { color: var(--muted); }
.note, .byline, .crumbs { font-size: 1rem; }
.article p, .article li { font-size: var(--step-0); }
body { font-weight: 460; }
.article .byline, .article .crumbs { font-size: 1rem; }
.card .meta, .sum-lab, .fields label { font-weight: 650; }
