/* =============================================================
   Centro de Ahorro Energético — hoja de estilos única
   Sin frameworks. Sin dependencias externas más allá de la fuente.
   Orden: tokens · base · layout · componentes · secciones · utilidades
   ============================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Color */
  /* ---------------------------------------------------------------
     Paleta derivada del logotipo. El granate #7f092c se extrajo del
     propio PNG de marca; el resto de la escala se generó en OKLCH
     manteniendo su tono (13°) y validando contraste sobre blanco.
     No añadas colores sueltos: usa una de estas variables.
     --------------------------------------------------------------- */

  /* Neutros cálidos: mismo tono que la marca, croma casi nulo */
  --ink:            #221012;   /* titulares y bandas oscuras · 18,3:1 */
  --ink-2:          #3D2B2C;
  --body:           #5B4B4C;   /* texto corrido · 8,2:1 */
  --muted:          #857677;   /* secundario · 4,3:1 */
  --line:           #E9E2E2;
  --line-strong:    #D5CBCB;
  --bg:             #FFFFFF;
  --bg-soft:        #FAF5F6;
  --bg-tint:        #FDE6E8;

  /* Marca */
  --brand:          #7F092C;   /* color exacto del logotipo · 10,6:1 */
  --brand-600:      #64001F;   /* hover */
  --brand-500:      #A02340;
  --brand-300:      #DE7D89;   /* acento sobre fondo oscuro · 6,4:1 */
  --brand-200:      #F5B8BD;
  --brand-tint:     #FDE6E8;

  /* Dorado: reservado para avisos y advertencias */
  --accent:         #B88000;
  --accent-600:     #9D6800;
  --accent-ink:     #885800;
  --accent-tint:    #FEF1DD;

  /* WhatsApp: color de marca ajeno, no se toca */
  --wa:             #25D366;
  --wa-dark:        #128C7E;

  --danger:         #C0392B;
  --danger-tint:    #FDEDEA;

  /* Tipografía */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Espaciado y forma */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --r-full: 999px;

  --shadow-sm: 0 1px 2px rgba(34, 16, 18, .06), 0 1px 3px rgba(34, 16, 18, .04);
  --shadow: 0 4px 12px rgba(34, 16, 18, .07), 0 12px 32px rgba(34, 16, 18, .06);
  --shadow-lg: 0 18px 48px rgba(34, 16, 18, .13);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.35rem + 2.6vw, 3.35rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.35rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.08rem; font-weight: 700; }

p { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

strong, b { color: var(--ink); font-weight: 700; }

img, video { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; display: block; }

/* Red de seguridad: un <svg> sin atributo width hereda height:auto y se
   estira hasta el ancho del contenedor (así apareció una flecha de 760 px
   al pie de las fichas). Esto le da un tamaño de icono por defecto; las
   reglas de cada componente, que van más abajo, lo sobrescriben. */
svg:not([width]) {
  display: inline-block;
  width: 1.1em; height: 1.1em;
  flex: none; vertical-align: -.2em;
}

ul, ol { margin: 0 0 1.15em; padding-left: 1.35em; }
li { margin-bottom: .5em; }
li::marker { color: var(--brand-300); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

small { font-size: .875rem; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- 3. Layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.wrap--narrow { max-width: var(--wrap-narrow); }

.section { padding-block: clamp(3.25rem, 6vw, 5.5rem); }
.section--soft { background: var(--bg-soft); }
.section--tint { background: var(--bg-tint); }
.section--tight { padding-block: clamp(2.25rem, 4vw, 3.25rem); }

.section-head { max-width: 720px; margin-bottom: 2.75rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.06rem; margin-bottom: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--brand-600); margin-bottom: .9rem;
}
.eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--brand-300); border-radius: 2px;
}
.eyebrow--center { justify-content: center; }

.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ---------- 4. Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2;
  padding: .95rem 1.6rem; border-radius: var(--r-full); border: 1.5px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, color .18s, border-color .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(127, 9, 44, .26); }
.btn--primary:hover { background: var(--brand-600); color: #fff; box-shadow: 0 10px 26px rgba(127, 9, 44, .32); }

.btn--wa { background: var(--wa); color: #06261A; box-shadow: 0 6px 18px rgba(37, 211, 102, .3); }
.btn--wa:hover { background: #1FBF5B; color: #06261A; }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-2); color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); background: var(--bg-soft); }

.btn--light { background: #fff; color: var(--ink); }
.btn--light:hover { color: var(--ink); background: #fff; }

.btn--block { width: 100%; }
.btn--lg { padding: 1.1rem 2rem; font-size: 1.06rem; }
.btn--sm { padding: .6rem 1.1rem; font-size: .92rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; align-items: center; }

/* ---------- 5. Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1.25rem; min-height: 72px; }

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; }
.brand-logo { width: auto; height: 42px; flex: none; }
.brand-logo--foot { height: 52px; }
@media (max-width: 1024px) { .brand-logo { height: 36px; } }
@media (max-width: 420px)  { .brand-logo { height: 30px; } }

.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { color: var(--ink); font-size: 1.02rem; font-weight: 800; letter-spacing: -.02em; }
.brand-name span { color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.nav-links {
  display: flex; align-items: center; gap: .35rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-links > li { margin: 0; position: relative; }

.nav-link {
  display: inline-flex; align-items: center; gap: .3rem;
  font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink-2);
  background: none; border: 0; cursor: pointer;
  padding: .55rem .8rem; border-radius: var(--r-sm); text-decoration: none;
  transition: background-color .16s, color .16s;
}
.nav-link:hover { background: var(--bg-soft); color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--brand-600); }
.nav-link .caret { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.has-menu[aria-expanded="true"] .caret { transform: rotate(180deg); }

.submenu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 20;
  min-width: 310px; padding: .6rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, transform .18s var(--ease), visibility .18s;
}
.has-menu:hover .submenu,
.has-menu[aria-expanded="true"] .submenu { opacity: 1; visibility: visible; transform: translateY(0); }

.submenu a {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .7rem .75rem; border-radius: var(--r-sm); text-decoration: none;
  transition: background-color .16s;
}
.submenu a:hover { background: var(--bg-soft); }
.submenu .ic {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-600); border-radius: 9px;
}
.submenu .ic svg { width: 18px; height: 18px; }
.submenu strong { display: block; color: var(--ink); font-size: .94rem; line-height: 1.3; }
.submenu small { color: var(--muted); font-size: .82rem; line-height: 1.35; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: .5rem; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 72px 0 auto; z-index: 90;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: .75rem 20px 1.5rem;
    max-height: calc(100dvh - 72px); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s var(--ease), visibility .2s;
  }
  .nav-links.is-open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-link { width: 100%; justify-content: space-between; padding: .85rem .4rem; font-size: 1.02rem; }
  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-left: 2px solid var(--line);
    border-radius: 0; min-width: 0; padding: 0 0 .5rem .6rem; margin-left: .4rem;
    display: none;
  }
  .has-menu[aria-expanded="true"] .submenu { display: block; }
  .nav-cta .btn { width: 100%; margin-top: .75rem; }
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(127, 9, 44, .13), transparent 62%),
    radial-gradient(700px 380px at 4% 8%, rgba(184, 128, 0, .10), transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 5vw, 4.25rem);
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: .6rem; }
.hero-lead { font-size: clamp(1.05rem, .98rem + .35vw, 1.22rem); color: var(--body); max-width: 34em; }

.trust-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-full);
  padding: .4rem .9rem .4rem .45rem; font-size: .85rem; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--shadow-sm); margin-bottom: 1.1rem;
}
.trust-badge .dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-600);
}
.trust-badge .dot svg { width: 13px; height: 13px; }

.hero-points { list-style: none; padding: 0; margin: 1.5rem 0 1.75rem; display: grid; gap: .6rem; }
.hero-points li { display: flex; align-items: flex-start; gap: .6rem; margin: 0; font-size: .98rem; }
.hero-points svg { width: 19px; height: 19px; flex: none; color: var(--brand); margin-top: 2px; }

.hero-note { font-size: .85rem; color: var(--muted); margin-top: 1rem; }

/* ---------- 7. Comparador (widget) ---------- */
.calc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.calc-head {
  background: var(--ink); color: #fff; padding: 1.15rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.calc-head h2, .calc-head p { color: #fff; margin: 0; }
.calc-head h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; }
.calc-head p { font-size: .83rem; opacity: .72; }

.calc-steps { display: flex; gap: .3rem; }
.calc-steps i {
  width: 26px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22);
  transition: background-color .25s;
}
.calc-steps i.is-done { background: var(--brand-300); }

.calc-body { padding: 1.5rem; }

.calc-step { display: none; }
.calc-step.is-active { display: block; animation: fade-up .3s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.calc-q { font-size: 1.06rem; font-weight: 700; color: var(--ink); margin: 0 0 .35rem; }
.calc-hint { font-size: .87rem; color: var(--muted); margin: 0 0 1.1rem; }

.opt-grid { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

.opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem;
  padding: 1.05rem .75rem; text-align: center; cursor: pointer;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r);
  font-weight: 600; font-size: .95rem; color: var(--ink);
  transition: border-color .16s, background-color .16s, transform .16s var(--ease);
}
.opt:hover { border-color: var(--brand-300); background: var(--brand-tint); transform: translateY(-2px); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.opt input:checked ~ * { color: var(--brand-600); }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 3px rgba(127, 9, 44, .12); }
.opt:has(input:focus-visible) { outline: 3px solid var(--brand-300); outline-offset: 2px; }
.opt svg { width: 26px; height: 26px; color: var(--brand); }
.opt small { font-weight: 500; font-size: .8rem; color: var(--muted); line-height: 1.3; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .9rem; font-weight: 650; color: var(--ink); margin-bottom: .4rem; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .85rem 1rem; background: #fff;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color .16s, box-shadow .16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(127, 9, 44, .14);
}
.field input::placeholder, .field textarea::placeholder { color: #A5989A; }
.field-help { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.field-error { font-size: .84rem; color: var(--danger); margin-top: .35rem; display: none; }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.consent { display: flex; align-items: flex-start; gap: .6rem; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.consent input { width: 18px; height: 18px; flex: none; margin-top: 2px; accent-color: var(--brand); }

.calc-nav { display: flex; gap: .7rem; align-items: center; margin-top: 1.25rem; }
.calc-back {
  background: none; border: 0; font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--muted); cursor: pointer; padding: .5rem .25rem;
}
.calc-back:hover { color: var(--ink); }

.calc-foot {
  padding: .9rem 1.5rem; background: var(--bg-soft); border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .5rem;
}
.calc-foot svg { width: 15px; height: 15px; flex: none; color: var(--brand); }

/* Resumen final antes del envío */
.summary {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem 1.15rem; margin-bottom: 1.1rem; font-size: .92rem;
}
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; color: var(--ink); font-weight: 650; text-align: right; }

/* ---------- 8. Tarjetas ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--body); font-size: .96rem; margin-bottom: 0; }
.card .ic {
  width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 1rem;
  background: var(--brand-tint); color: var(--brand-600); border-radius: 11px;
}
.card .ic svg { width: 23px; height: 23px; }
.card--link { display: block; text-decoration: none; }
.card--link .more {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem;
  font-size: .92rem; font-weight: 650; color: var(--brand-600);
}
.card--link:hover .more { gap: .6rem; }
.card--link .more svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }

/* Pasos numerados */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 1.15rem; }
.steps li {
  position: relative; padding-left: 3.4rem; margin: 0; counter-increment: s;
}
.steps li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 2.35rem; height: 2.35rem; display: grid; place-items: center;
  background: var(--ink); color: #fff; border-radius: 50%;
  font-size: .84rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.steps strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: .2rem; }
.steps p { font-size: .96rem; margin: 0; }

/* Lista de comprobación */
.checklist { list-style: none; padding: 0; margin: 0 0 1.15em; display: grid; gap: .65rem; }
.checklist li { display: flex; align-items: flex-start; gap: .65rem; margin: 0; }
.checklist svg { width: 19px; height: 19px; flex: none; color: var(--brand); margin-top: 3px; }

/* ---------- 9. Tablas ---------- */
.table-scroll { overflow-x: auto; margin-bottom: 1.5rem; border-radius: var(--r); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; background: #fff; }
caption { text-align: left; font-size: .86rem; color: var(--muted); padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
th, td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: .87rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 10. FAQ ---------- */
.faq { display: grid; gap: .75rem; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .18s, box-shadow .18s;
}
.faq details[open] { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.35rem; cursor: pointer; list-style: none;
  font-weight: 650; font-size: 1.02rem; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 11px; height: 11px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform .22s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq .faq-body { padding: 0 1.35rem 1.25rem; font-size: .97rem; }
.faq .faq-body > :last-child { margin-bottom: 0; }

/* ---------- 11. Contenido editorial ---------- */
.article-head { padding-block: clamp(2.25rem, 4vw, 3.25rem) 1.5rem; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .86rem; color: var(--muted); margin-top: 1rem; }
.article-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.article-meta svg { width: 15px; height: 15px; }

.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 2.5rem; }
.prose h3 { margin-top: 1.85rem; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.25em; }

.lede { font-size: 1.16rem; line-height: 1.6; color: var(--ink-2); }

.callout {
  border-left: 3px solid var(--brand); background: var(--brand-tint);
  padding: 1.15rem 1.35rem; border-radius: 0 var(--r) var(--r) 0; margin: 1.75rem 0;
  font-size: .98rem;
}
.callout strong:first-child { display: block; margin-bottom: .3rem; }
.callout--warn { border-left-color: var(--accent); background: var(--accent-tint); }
.callout--data { border-left-color: var(--muted); background: var(--bg-soft); font-size: .9rem; color: var(--muted); }
.callout > :last-child { margin-bottom: 0; }

.toc {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.25rem 1.5rem; margin-bottom: 2.25rem;
}
.toc h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 .75rem; }
.toc ol { margin: 0; padding-left: 1.2em; font-size: .95rem; }
.toc li { margin-bottom: .35rem; }

/* Breadcrumbs */
.crumbs { font-size: .85rem; color: var(--muted); padding-block: .9rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.crumbs li { margin: 0; display: flex; align-items: center; gap: .35rem; }
.crumbs li + li::before { content: "›"; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-600); text-decoration: underline; }

/* Listado de artículos */
.post-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.post {
  display: flex; flex-direction: column; gap: .5rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.5rem; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.post:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.post .tag {
  align-self: flex-start; font-size: .74rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--brand-600); background: var(--brand-tint);
  padding: .25rem .6rem; border-radius: var(--r-full);
}
.post h3 { font-size: 1.14rem; margin: .3rem 0 0; }
.post p { font-size: .94rem; color: var(--body); margin: 0; }
.post time { font-size: .82rem; color: var(--muted); margin-top: auto; padding-top: .75rem; }

/* ---------- 12. Bandas y cierres ---------- */
.cta-band {
  background:
    radial-gradient(700px 320px at 82% 0%, rgba(222, 125, 137, .30), transparent 62%),
    var(--ink);
  color: #fff; border-radius: var(--r-lg); padding: clamp(2.25rem, 4vw, 3.25rem);
  display: grid; grid-template-columns: 1.25fr auto; gap: 2rem; align-items: center;
}
.cta-band h2 { color: #fff; margin-bottom: .5rem; }
.cta-band p { color: rgba(255, 255, 255, .74); margin: 0; max-width: 46ch; }
.cta-band--accent {
  background:
    radial-gradient(700px 320px at 82% 0%, rgba(184, 128, 0, .30), transparent 62%),
    var(--ink);
}
.eyebrow--on-dark { color: var(--brand-200); }
.eyebrow--on-dark::before { background: var(--brand-300); }
@media (max-width: 800px) { .cta-band { grid-template-columns: 1fr; } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.25rem; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 1.35rem;
}
.stat b { display: block; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.15rem); color: var(--ink); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { font-size: .89rem; color: var(--muted); }

/* Logos de comercializadoras */
.logos { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: center; }
.logos li {
  margin: 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-full);
  padding: .5rem 1.1rem; font-size: .92rem; font-weight: 650; color: var(--ink-2);
}

/* ---------- 13. Pie ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .68); padding-block: 3.5rem 2rem; margin-top: 0; }
.site-footer a { color: rgba(255, 255, 255, .68); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-grid--wide { grid-template-columns: 1.6fr repeat(4, 1fr); gap: 1.75rem; }
@media (max-width: 1024px) { .footer-grid--wide { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .footer-grid, .footer-grid--wide { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid, .footer-grid--wide { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.footer-col nav { display: grid; gap: .55rem; font-size: .94rem; }
.footer-about p { font-size: .92rem; max-width: 34ch; }
.footer-about .brand-name b { color: #fff; }
.footer-about .brand-name span { color: rgba(255, 255, 255, .5); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  padding-top: 1.5rem; font-size: .85rem;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-legal { font-size: .8rem; color: rgba(255, 255, 255, .42); margin-top: 1.25rem; line-height: 1.6; max-width: 90ch; }

/* ---------- 14. WhatsApp flotante ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 95;
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--wa); color: #06261A; font-weight: 700; font-size: .95rem;
  padding: .85rem 1.25rem; border-radius: var(--r-full); text-decoration: none;
  box-shadow: 0 8px 26px rgba(37, 211, 102, .42);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.wa-float:hover { transform: translateY(-3px); color: #06261A; box-shadow: 0 12px 32px rgba(37, 211, 102, .5); }
.wa-float svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 520px) {
  .wa-float { right: 14px; bottom: 14px; padding: .85rem; }
  .wa-float span { display: none; }
}

/* ---------- 15. Comercializadoras ---------- */

/* Etiqueta de categoría */
.chip {
  display: inline-block; margin-bottom: .35rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-600); background: var(--brand-tint);
  padding: .25rem .65rem; border-radius: var(--r-full);
}
.chip--sm { font-size: .68rem; padding: .18rem .55rem; }

/* Servicios que ofrece (Luz / Gas / Renovable) */
.badges { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.badges li {
  margin: 0; font-size: .82rem; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .3rem .7rem;
}
.badges--sm { margin: .6rem 0 0; }
.badges--sm li { font-size: .74rem; padding: .18rem .55rem; background: var(--bg-soft); }

/* Cabecera de ficha */
.com-hero {
  background:
    radial-gradient(800px 380px at 90% -10%, rgba(127, 9, 44, .11), transparent 62%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(1.75rem, 4vw, 3rem);
}
.com-hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}
@media (max-width: 940px) { .com-hero__grid { grid-template-columns: 1fr; } }

.com-hero__brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.com-hero__brand img {
  width: 108px; height: 81px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: .6rem; flex: none;
}
.com-hero h1 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.6rem); }

/* Dónde destaca / qué vigilar */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 2rem 0; }
@media (max-width: 720px) { .pros-cons { grid-template-columns: 1fr; } }
.pros-cons > div { border-radius: var(--r); padding: 1.35rem 1.5rem; border: 1px solid var(--line); }
.pros-cons h3 { font-size: 1.02rem; margin-bottom: .9rem; }
.pros-cons .checklist { margin: 0; font-size: .95rem; }
.pros { background: var(--brand-tint); border-color: rgba(127, 9, 44, .20); }
.pros .checklist svg { color: var(--brand); }
.cons { background: var(--accent-tint); border-color: rgba(184, 128, 0, .30); }
.cons .checklist svg { color: var(--accent-ink); }

/* Listado de fichas del hub */
.com-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.com-item {
  display: flex; align-items: flex-start; gap: 1.1rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.35rem; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.com-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.com-item img {
  width: 84px; height: 63px; object-fit: contain; flex: none;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: .4rem;
}
.com-item__body { flex: 1; min-width: 0; }
.com-item__body h3 { font-size: 1.08rem; margin: .1rem 0 .35rem; }
.com-item__body p { font-size: .92rem; color: var(--body); margin: 0; }
.com-item__go { flex: none; color: var(--brand-600); align-self: center; }
.com-item__go svg { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.com-item:hover .com-item__go svg { transform: translateX(3px); }

/* Tarjetas de navegación entre fichas */
.com-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.com-card {
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1.25rem 1rem; text-decoration: none; text-align: center;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.com-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.com-card img { width: 92px; height: 69px; object-fit: contain; }
.com-card__name { font-size: .92rem; font-weight: 650; color: var(--ink); }

/* Rejilla del resto de comercializadoras */
.com-grid {
  display: grid; gap: .85rem; list-style: none; padding: 0; margin: 0;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.com-grid li {
  display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem .75rem;
}
.com-grid img { width: 84px; height: 63px; object-fit: contain; filter: grayscale(1); opacity: .78; transition: filter .2s, opacity .2s; }
.com-grid li:hover img { filter: none; opacity: 1; }
.com-grid span { font-size: .8rem; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.3; }

/* ---------- 16. Precio de la luz (widget en vivo) ---------- */
.pl {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.pl__head {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: baseline; justify-content: space-between;
}
.pl__head h2 { margin: 0; font-size: 1.12rem; }
.pl__head p { margin: 0; font-size: .84rem; color: var(--muted); }
.pl__body { padding: 1.5rem; }

/* Estados: mientras carga y si la fuente falla */
.pl__loading, .pl__error { padding: 2.5rem 1.5rem; text-align: center; color: var(--muted); font-size: .95rem; }
.pl__error { display: none; }
.pl.is-error .pl__loading { display: none; }
.pl.is-error .pl__error { display: block; }
.pl.is-ready .pl__loading { display: none; }
.pl__data { display: none; }
.pl.is-ready .pl__data { display: block; }

/* Cifras destacadas */
.pl-tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.75rem; }
.pl-tile { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); padding: .9rem 1rem; }
.pl-tile__label { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .3rem; }
.pl-tile b { display: block; font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; }
.pl-tile__note { display: block; font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.pl-tile--hero { background: var(--ink); border-color: var(--ink); }
.pl-tile--hero .pl-tile__label { color: rgba(255, 255, 255, .6); }
.pl-tile--hero b { color: #fff; font-size: 1.6rem; }
.pl-tile--hero .pl-tile__note { color: var(--brand-300); font-weight: 600; }

/* Pestañas hoy / mañana */
.pl-tabs {
  display: flex; gap: .4rem; padding: .85rem 1.5rem 0;
  border-bottom: 1px solid var(--line);
}
.pl-tab {
  font: inherit; font-size: .92rem; font-weight: 650; color: var(--muted);
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .5rem .9rem; cursor: pointer; margin-bottom: -1px;
  transition: color .16s, border-color .16s;
}
.pl-tab:hover:not(:disabled) { color: var(--ink); }
.pl-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.pl-tab:disabled { opacity: .45; cursor: not-allowed; }

/* Gráfico de barras. El número de columnas lo fija el JS: un día normal
   tiene 24 horas, pero el del cambio de hora tiene 23 o 25. */
.pl-chart {
  display: grid; grid-template-columns: repeat(var(--n, 24), 1fr); gap: 2px;
  align-items: end; height: 210px; margin-bottom: .5rem;
  border-bottom: 1px solid var(--line-strong); padding-bottom: 0;
}
.pl-bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; cursor: default; }
.pl-bar__fill {
  display: block; height: var(--h); background: var(--c);
  border-radius: 4px 4px 0 0; transition: filter .15s;
}
.pl-bar:hover .pl-bar__fill, .pl-bar:focus-visible .pl-bar__fill { filter: brightness(1.12); }
.pl-bar.is-now .pl-bar__fill { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); border-radius: 4px 4px 0 0; }
.pl-bar__hour {
  position: absolute; bottom: -1.5rem; left: 50%; transform: translateX(-50%);
  font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pl-bar:nth-child(even) .pl-bar__hour { display: none; }
.pl-bar__tag {
  position: absolute; bottom: calc(var(--h) + 6px); left: 50%; transform: translateX(-50%);
  font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .1rem .3rem; border-radius: 4px; white-space: nowrap;
}
.pl-bar__tag--min { color: var(--brand-600); background: var(--brand-tint); }
.pl-bar__tag--max { color: var(--accent-ink); background: var(--accent-tint); }
.pl-bar__tip {
  position: absolute; bottom: calc(var(--h) + 26px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .78rem; line-height: 1.35;
  padding: .45rem .65rem; border-radius: var(--r-sm); white-space: nowrap;
  opacity: 0; visibility: hidden; transition: opacity .14s; pointer-events: none; z-index: 5;
}
.pl-bar__tip b { color: #fff; }
.pl-bar:hover .pl-bar__tip, .pl-bar:focus-visible .pl-bar__tip { opacity: 1; visibility: visible; }
.pl-bar:first-child .pl-bar__tip { left: 0; transform: none; }
.pl-bar:last-child .pl-bar__tip { left: auto; right: 0; transform: none; }

.pl-axis { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); margin: 1.75rem 0 1.25rem; }

.pl-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.pl-legend li { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .8rem; color: var(--body); }
.pl-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }

.pl-table-toggle {
  background: none; border: 0; font: inherit; font-size: .86rem; font-weight: 650;
  color: var(--brand-600); cursor: pointer; padding: .35rem 0; text-decoration: underline;
  text-underline-offset: 3px;
}
.pl-table { display: none; margin-top: 1rem; }
.pl-table.is-open { display: block; }
.pl-table table { font-size: .88rem; }

.pl__foot {
  padding: .9rem 1.5rem; background: var(--bg-soft); border-top: 1px solid var(--line);
  font-size: .8rem; color: var(--muted);
}
.pl__foot a { color: var(--muted); }

@media (max-width: 640px) {
  .pl-chart { height: 170px; }
  .pl-bar__hour { font-size: .6rem; }
  .pl-bar:nth-child(3n+2) .pl-bar__hour, .pl-bar:nth-child(3n) .pl-bar__hour { display: none; }
}

/* Resumen compacto del precio, para la portada */
.plm {
  background: var(--ink); color: #fff; border-radius: var(--r-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: grid; grid-template-columns: 1.3fr auto; gap: 1.5rem; align-items: center;
}
@media (max-width: 800px) { .plm { grid-template-columns: 1fr; } }
.plm h2 { color: #fff; font-size: 1.4rem; margin-bottom: .35rem; }
.plm > div > p { color: rgba(255, 255, 255, .74); margin: 0 0 1.25rem; max-width: 46ch; }
.plm__datos { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; }
.plm__ahora span, .plm__dato span {
  display: block; font-size: .74rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: rgba(255, 255, 255, .55); margin-bottom: .2rem;
}
.plm__ahora b { display: block; font-size: 1.75rem; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1.1; }
.plm__ahora em { font-style: normal; font-size: .84rem; font-weight: 650; color: var(--brand-200); }
.plm__dato b { display: block; font-size: 1.2rem; font-weight: 700; color: #fff; }
.plm__cargando { color: rgba(255, 255, 255, .6); font-size: .92rem; margin: 0; }
.plm.is-ready .plm__cargando, .plm.is-error .plm__cargando { display: none; }
.plm__datos { display: none; }
.plm.is-ready .plm__datos { display: flex; }

/* ---------- 17. Diccionario ---------- */
.dic-nav {
  display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0;
  margin: 0 0 2.5rem; position: sticky; top: 78px; z-index: 20;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  padding-block: .6rem; border-bottom: 1px solid var(--line);
}
.dic-nav li { margin: 0; }
.dic-nav a {
  display: grid; place-items: center; min-width: 2rem; height: 2rem;
  font-size: .86rem; font-weight: 700; color: var(--brand-600); text-decoration: none;
  background: var(--brand-tint); border-radius: var(--r-sm);
}
.dic-nav a:hover { background: var(--brand); color: #fff; }

.dic-group { margin-bottom: 2.5rem; scroll-margin-top: 130px; }
.dic-group > h2 {
  font-size: 1.6rem; color: var(--brand-600); border-bottom: 2px solid var(--brand-tint);
  padding-bottom: .4rem; margin-bottom: 1.25rem;
}
.dic-list { margin: 0; }
.dic-list dt {
  font-weight: 700; color: var(--ink); font-size: 1.05rem;
  margin-top: 1.5rem; scroll-margin-top: 130px;
}
.dic-list dt:first-child { margin-top: 0; }
.dic-list dd { margin: .35rem 0 0; color: var(--body); font-size: .97rem; }
.dic-list dd + dd { margin-top: .5rem; }

/* ---------- 18. Utilidades ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
