/* ==========================================================================
   Preciluz — Sistema de diseño (adaptado del lenguaje visual de TodoPlayas)
   Azul océano monocromo · Inter 800 · glass + pills + tarjetas flotantes
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Marca — azul océano */
  --brand:        #0a6ebd;
  --brand-deep:   #084e8a;
  --brand-soft:   #e6f1fb;
  --brand-softer: #f2f8fd;
  --brand-tint:   #cbe2f5;

  /* Neutros fríos */
  --ink:     #0f1d2e;
  --ink-2:   #2a3b4f;
  --muted:   #5a6b7f;
  --muted-2: #8595a7;
  --line:    #dde6ef;
  --line-2:  #eef3f8;
  --bg:      #f7fafd;
  --bg-2:    #eef3f8;
  --bg-3:    #e6edf5;
  --bg-card: #ffffff;

  /* Semánticos (valle / llano / punta y estados) */
  --green:      #2a9d6f;
  --green-deep: #1d7a55;
  --green-soft: #e1f3ea;
  --amber:      #d9920c;
  --amber-deep: #a86d06;
  --amber-soft: #fbeecd;
  --red:        #d6453f;
  --red-deep:   #ad302b;
  --red-soft:   #fbe5e3;
  --sun:        #ffb703;

  /* Radios */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;
  --radius: 12px;       /* alias legacy */
  --radius-sm: 8px;     /* alias legacy */

  /* Sombras (suaves, tintadas de azul) */
  --shadow-sm:    0 1px 2px rgba(15,29,46,.04), 0 1px 3px rgba(15,29,46,.03);
  --shadow:       0 4px 16px rgba(15,29,46,.06), 0 1px 3px rgba(15,29,46,.04);
  --shadow-lg:    0 12px 40px rgba(10,110,189,.12), 0 2px 6px rgba(15,29,46,.05);
  --shadow-brand: 0 8px 28px rgba(10,110,189,.22);

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

  /* Aliases de color legacy (compatibilidad con plantillas) */
  --blue: var(--brand);
  --blue-dark: var(--brand-deep);
  --yellow: var(--amber);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--line);

  --container: 1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Franja superior con degradado azul + textura de puntos, que se disuelve hacia abajo */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(10,110,189,.10) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(180deg, var(--brand-soft) 0%, rgba(230,241,251,.35) 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-deep); text-decoration: underline; }
/* Enlaces dentro del contenido editorial: subrayados (los de menú/botones/cards no) */
.home-seo a, .electro-seo a, .content-page a, .answer-box a, .faq-answer a { text-decoration: underline; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* === TÍPOGRAFÍA === */
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
:is(h1,h2,h3,h4,h5,h6) em { font-style: normal; color: var(--brand); }
h1 { font-size: 2rem; margin-bottom: 1.25rem; line-height: 1.15; letter-spacing: -.03em; }
h2 { font-size: 1.35rem; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; }
.subtitle { color: var(--muted); margin-top: -.75rem; margin-bottom: 1.5rem; font-size: 1.02rem; }
.fecha-highlight { color: var(--brand); }
.home-h1 { text-align: center; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }

/* === HEADER (glass sticky) === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.site-logo {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.18rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
}
.site-logo:hover { text-decoration: none; }
.logo-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  color: #fff; font-size: 1.05rem;
  box-shadow: var(--shadow-brand);
}
.site-nav { display: flex; gap: 1.4rem; align-items: center; }
.site-nav a {
  color: var(--ink-2); font-size: .9rem; font-weight: 600;
  transition: color .15s;
}
.site-nav a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--ink); margin: 5px 0; transition: .2s;
}

/* === MAIN === */
.main-content {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3.5rem;
}

/* === BREADCRUMB === */
.breadcrumb ol {
  display: flex; flex-wrap: wrap; gap: .5rem; list-style: none;
  font-size: .85rem; color: var(--muted); margin-bottom: 1.5rem;
}
.breadcrumb li + li::before { content: '/'; margin-right: .5rem; color: var(--brand-tint); }
.breadcrumb a { color: var(--muted); font-weight: 500; }
.breadcrumb a:hover { color: var(--brand); }

/* === PRECIO INDICADOR (anillo) === */
.hero-section h1 { letter-spacing: -.03em; }
.hero-precio { display: flex; justify-content: center; margin: .5rem 0 2rem; }
.precio-indicador { text-align: center; }
.precio-ring {
  width: 184px; height: 184px; border-radius: 50%;
  border: 7px solid var(--brand-tint);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  background: #fff;
  box-shadow: var(--shadow-lg);
  transition: border-color .3s;
}
.precio-valor { text-align: center; }
.precio-numero {
  display: block; font-family: var(--font-mono);
  font-size: 2rem; font-weight: 700; line-height: 1.2; color: var(--ink);
}
.precio-unidad { display: block; font-size: .85rem; color: var(--muted); font-weight: 500; }
.precio-hora { font-size: .92rem; color: var(--muted); font-weight: 600; }

/* === HERO PRECIO AHORA (protagonista) === */
.hero-now { text-align: center; margin: .25rem 0 2rem; }
.hero-now-eyebrow {
  display: block; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--brand);
  margin-bottom: .85rem;
}
.hero-precio--xl { margin: 0 0 1rem; }
.hero-precio--xl .precio-ring { width: 248px; height: 248px; border-width: 10px; }
.hero-precio--xl .precio-numero { font-size: 3rem; }
.hero-precio--xl .precio-unidad { font-size: 1rem; }
.hero-now-meta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem;
}
.hero-now-estado {
  font-weight: 700; font-size: .9rem; padding: .35rem .9rem; border-radius: 999px; color: #fff;
}
.hero-now-estado.barato { background: var(--green); }
.hero-now-estado.medio { background: var(--amber); }
.hero-now-estado.caro { background: var(--red); }
.hero-now-diff { font-size: .92rem; color: var(--muted); font-weight: 500; }

/* === COMPARTIR === */
.share { position: relative; display: inline-block; margin: 1.1rem 0 0; }
.share-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--brand); color: #fff; border: none; font: inherit;
  font-weight: 700; font-size: .92rem; padding: .55rem 1.15rem;
  border-radius: 999px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: background .15s, transform .15s;
}
.share-btn:hover { background: var(--brand-deep); transform: translateY(-1px); }
.share-menu {
  position: absolute; left: 50%; transform: translateX(-50%); top: calc(100% + .5rem);
  z-index: 50; min-width: 190px; padding: .4rem;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: .1rem; text-align: left;
}
.share-menu[hidden] { display: none; }
.share-opt {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--ink);
  padding: .55rem .75rem; border-radius: 8px; cursor: pointer; text-decoration: none;
}
.share-opt:hover { background: var(--brand-tint); color: var(--brand-deep); text-decoration: none; }

/* === TABLA POR PERIODOS (noche / mañana / tarde) === */
.tabla-periodos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.periodo-titulo { text-align: center; font-size: 1.1rem; margin-bottom: .85rem; }
.periodo-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.periodo-table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; padding: .2rem .7rem .55rem;
}
.periodo-table th:last-child { text-align: right; }
.periodo-table td { padding: .6rem .7rem; }
.periodo-table tbody tr:nth-child(odd) { background: var(--bg-2, #f1f5f9); }
.pt-hora { color: var(--ink-2); font-family: var(--font-mono); white-space: nowrap; }
.pt-precio { font-family: var(--font-mono); font-weight: 700; text-align: right; white-space: nowrap; }
.pt-precio.barato { color: var(--green-deep); }
.pt-precio.medio { color: var(--amber-deep); }
.pt-precio.caro { color: var(--red-deep); }
.periodo-table tr.current-hour { outline: 2px solid var(--brand); outline-offset: -2px; }
@media (max-width: 768px) {
  .tabla-periodos { grid-template-columns: 1fr; gap: 1.25rem; }
}

/* === STATS ROW === */
.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint); }
.stat-label {
  display: block; font-size: .72rem; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem;
}
.stat-value { display: block; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.stat-barato .stat-value { color: var(--green-deep); }
.stat-caro .stat-value { color: var(--red-deep); }

/* Stats principales de la home: más grandes y con color */
.stats-home { gap: 1.1rem; margin-bottom: 2.25rem; }
.stats-home .stat-card {
  padding: 1.5rem 1.6rem; border-top: 4px solid var(--brand-tint);
}
.stats-home .stat-label { font-size: .74rem; margin-bottom: .55rem; }
.stats-home .stat-value { font-size: 1.7rem; letter-spacing: -.01em; }
.stats-home .stat-barato { background: var(--green-soft); border-top-color: var(--green); }
.stats-home .stat-caro { background: var(--red-soft); border-top-color: var(--red); }

/* Fila única de stats (electrodomésticos) */
.stats-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .85rem; }
.stats-6 .stat-card { padding: 1rem 1.05rem; }
.stats-6 .stat-label { font-size: .68rem; }
.stats-6 .stat-value { font-size: 1.05rem; }
@media (max-width: 1000px) { .stats-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats-6 { grid-template-columns: repeat(2, 1fr); } }

/* Bloque de texto SEO del índice de electrodomésticos: aire entre secciones */
.electro-seo { margin-top: 2.75rem; }
.electro-seo h2 { margin-top: 2.25rem; margin-bottom: .65rem; font-size: 1.2rem; }
.electro-seo h2:first-child { margin-top: 0; }
.electro-seo p { color: var(--ink-2); line-height: 1.75; margin-bottom: 1.1rem; }

/* Bloque editorial SEO de la home */
.home-seo { margin-top: 2.5rem; }
.home-seo h2 { margin-top: 2.25rem; margin-bottom: .65rem; font-size: 1.25rem; }
.home-seo h2:first-child { margin-top: 0; }
.home-seo p { color: var(--ink-2); line-height: 1.75; margin-bottom: 1.1rem; }

/* === SECTION CARDS === */
.section-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.5rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.section-card > h2 { padding-bottom: .6rem; border-bottom: 2px solid var(--brand-tint); }

/* === CHART === */
.chart-container { position: relative; height: 340px; width: 100%; }

/* === TABLE === */
.table-responsive { overflow-x: auto; border-radius: var(--r-md); }
.price-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.price-table th {
  text-align: left; padding: .75rem; border-bottom: 2px solid var(--brand-tint);
  font-weight: 700; font-size: .72rem; text-transform: uppercase;
  color: var(--muted); letter-spacing: .08em;
}
.price-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--line-2); }
.price-table tbody tr { transition: background .12s; }
.price-table tbody tr:hover { background: var(--brand-softer); }
.price-table tr:last-child td { border-bottom: none; }
.price-table tr.current-hour { background: var(--brand-soft); font-weight: 600; }
.price-table tr.barato td:first-child { border-left: 3px solid var(--green); }
.price-table tr.caro td:first-child { border-left: 3px solid var(--red); }
/* Mapa de calor: tiñe la fila según lo barata/cara que es la hora */
.price-table tbody tr.barato { background: rgba(42,157,111,.12); }
.price-table tbody tr.medio { background: rgba(217,146,12,.05); }
.price-table tbody tr.caro { background: rgba(214,69,63,.10); }
.price-table tbody tr.current-hour { background: var(--brand-soft); }
.price-table tbody tr:hover { background: var(--brand-softer); }
.hora-cell { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.precio-cell { font-family: var(--font-mono); font-weight: 600; }

/* === TRAMO BADGES (pills suaves) === */
.tramo-badge {
  display: inline-block; padding: .22rem .7rem; border-radius: var(--r-pill);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.tramo-valle { background: var(--green-soft); color: var(--green-deep); }
.tramo-llano { background: var(--amber-soft); color: var(--amber-deep); }
.tramo-punta { background: var(--red-soft); color: var(--red-deep); }

/* === SEMAFORO DOT === */
.semaforo { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }

/* === TABLA: barra de nivel de precio + badges de hora === */
.price-table .th-nivel { width: 184px; }
.precio-bar { width: 100%; max-width: 170px; height: 9px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden; }
.precio-bar-fill { height: 100%; border-radius: var(--r-pill); }
.precio-bar-fill.barato { background: var(--green); }
.precio-bar-fill.medio { background: var(--amber); }
.precio-bar-fill.caro { background: var(--red); }
.hora-badge {
  display: inline-block; margin-left: .4rem; padding: .08rem .45rem;
  border-radius: var(--r-pill); font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; background: var(--brand); color: #fff; vertical-align: middle;
}
.hora-badge-barata { background: var(--green); }
@media (max-width: 560px) { .price-table .th-nivel, .price-table .nivel-cell { display: none; } }

/* === MIX ENERGETICO === */
.mix-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.mix-item {
  display: flex; flex-direction: column; padding: .9rem .75rem;
  background: var(--brand-softer); border: 1px solid var(--line-2);
  border-radius: var(--r-md); text-align: center;
}
.mix-label { font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: .3rem; }
.mix-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.mix-renovable { color: var(--green-deep); }

/* === RANKING (hora barata) === */
.ranking-list { margin-bottom: 2rem; }
.ranking-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1.1rem; border-radius: var(--r-md); margin-bottom: .55rem;
  background: var(--bg-card); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.ranking-item:hover { transform: translateX(3px); border-color: var(--brand-tint); box-shadow: var(--shadow); }
.ranking-item.past { opacity: .5; }
.ranking-item.current { border-color: var(--brand); box-shadow: var(--shadow-brand); }
.ranking-item.barato { border-left: 4px solid var(--green); }
.ranking-item.medio  { border-left: 4px solid var(--amber); }
.ranking-item.caro   { border-left: 4px solid var(--red); }
.ranking-position { font-weight: 800; font-size: 1rem; min-width: 2.5rem; color: var(--muted-2); }
.ranking-hora { font-family: var(--font-mono); font-weight: 600; min-width: 9rem; }
.ranking-precio { font-family: var(--font-mono); font-weight: 700; flex: 1; }
.ranking-badge {
  background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700;
  padding: .18rem .6rem; border-radius: var(--r-pill); text-transform: uppercase; letter-spacing: .04em;
}
.ranking-badge.past-badge { background: var(--muted-2); }

/* === HORA MÁS BARATA: top-3 + barras en el ranking === */
.mejores-horas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.mejor-hora-card {
  display: flex; flex-direction: column; gap: .35rem; align-items: flex-start;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--r-lg); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-sm);
}
.mejor-hora-card.destacada { box-shadow: var(--shadow-lg); background: var(--green-soft); }
.mejor-hora-card.cara { border-left-color: var(--red); }
.mejor-hora-card.cara.destacada { background: var(--red-soft); }
.mejor-hora-card.cara .mh-rank { color: var(--red-deep); }
.mejor-hora-card .mh-rank { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--green-deep); }
.mejor-hora-card .mh-hora { font-family: var(--font-mono); font-size: 1.7rem; font-weight: 800; color: var(--ink); line-height: 1; }
.mejor-hora-card .mh-precio { font-family: var(--font-mono); font-weight: 700; color: var(--ink-2); font-size: .95rem; }
.ranking-bar { flex: 1; min-width: 60px; height: 9px; background: var(--bg-2); border-radius: var(--r-pill); overflow: hidden; }
.ranking-bar-fill { height: 100%; border-radius: var(--r-pill); }
.ranking-bar-fill.barato { background: var(--green); }
.ranking-bar-fill.medio { background: var(--amber); }
.ranking-bar-fill.caro { background: var(--red); }
.ranking-item .ranking-hora { min-width: 4.5rem; font-weight: 600; }
.ranking-item .ranking-precio { flex: 0 0 auto; min-width: 6.5rem; text-align: right; }
.ranking-item .ranking-tramo { flex: 0 0 auto; }
@media (max-width: 640px) {
  .mejores-horas { grid-template-columns: 1fr; }
  .ranking-bar { display: none; }
}

/* === CTA === */
.cta-section {
  text-align: center;
  background: linear-gradient(135deg, var(--brand-deep), var(--brand));
  border: none; color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-section h2 { color: #fff; border-bottom: none; padding-bottom: 0; }
.cta-section p { color: rgba(255,255,255,.85); margin-bottom: 1.1rem; }

/* === BUTTONS (pills) === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.4rem; border-radius: var(--r-pill);
  font-weight: 600; font-size: .9rem; text-decoration: none;
  transition: all .15s; cursor: pointer; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; transform: translateY(-1px); }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.cta-section .btn-primary { background: #fff; color: var(--brand-deep); border-color: #fff; }
.cta-section .btn-primary:hover { background: var(--brand-softer); color: var(--brand-deep); }

/* === DAY NAV === */
.day-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}

/* === FAQ === */
.faq-section h2 { margin-bottom: 1rem; }
.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: #fff; }
.faq-question {
  padding: 1rem 1.25rem; font-weight: 700; font-size: .95rem; color: var(--ink);
  cursor: pointer; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+'; font-size: 1.3rem; font-weight: 400; color: var(--brand);
  flex-shrink: 0; transition: transform .2s;
}
details[open] .faq-question::after { content: '−'; }
details[open] .faq-question { border-bottom: 1px solid var(--line-2); }
.faq-answer { padding: 1rem 1.25rem; font-size: .92rem; color: var(--ink-2); line-height: 1.7; }
.faq-answer a { color: var(--brand); }
.faq-answer strong { color: var(--ink); }

/* === TIPS GRID === */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.tip-card {
  background: var(--brand-softer); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 1.1rem;
}
.tip-card h3 { font-size: .98rem; margin-bottom: .5rem; }
.tip-card h3::before { content: '→ '; color: var(--brand); }
.tip-card p { font-size: .88rem; color: var(--ink-2); }

/* === HISTORICO === */
.historico-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.historico-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.historico-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint); }
.historico-card h2 { margin-bottom: .75rem; border-bottom: none; padding-bottom: 0; }
.historico-card h2 a { color: var(--ink); }
.historico-card h2 a:hover { color: var(--brand); text-decoration: none; }
.historico-meses { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.historico-meses a {
  display: block; padding: .45rem; text-align: center; font-size: .85rem; font-weight: 600;
  border-radius: var(--r-sm); background: var(--bg-2); color: var(--ink-2); transition: .15s;
}
.historico-meses a:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* === GRID ELECTRODOMÉSTICOS (índice cuanto-cuesta) === */
.electro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.electro-card {
  display: flex; flex-direction: column; gap: .35rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.electro-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint); text-decoration: none; }
.electro-nombre { font-weight: 800; font-size: 1.05rem; color: var(--ink); letter-spacing: -.01em; }
.electro-meta { font-family: var(--font-mono); font-size: .8rem; color: var(--brand-deep); font-weight: 600; }
.electro-desc { font-size: .88rem; color: var(--ink-2); line-height: 1.5; }

/* === ALERTS === */
.alert { padding: 1rem 1.5rem; border-radius: var(--r-md); margin-bottom: 1.5rem; }
.alert-info { background: var(--brand-soft); border: 1px solid var(--brand-tint); color: var(--brand-deep); }

.text-center { text-align: center; }

/* === FOOTER (oscuro, multicolumna) === */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.72);
  padding: 2.75rem 0 1.5rem; margin-top: auto; font-size: .88rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem;
  max-width: var(--container); margin: 0 auto; padding: 0 1.5rem;
}
.footer-col h4, .footer-col-title { color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .9rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a { color: rgba(255,255,255,.78); font-size: .88rem; font-weight: 500; }
.footer-col a:hover { color: #fff; }
.footer-disclaimer { font-size: .85rem; line-height: 1.6; color: rgba(255,255,255,.6); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between;
  text-align: left; padding-top: 1.5rem; margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.1); font-size: .82rem; color: rgba(255,255,255,.6);
  max-width: var(--container); margin-left: auto; margin-right: auto;
  padding-left: 1.5rem; padding-right: 1.5rem;
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-legal a { color: rgba(255,255,255,.7); }
.footer-legal a:hover { color: #fff; }

/* === CALCULADORA === */
.calc-form { max-width: 520px; margin: 0 auto 2rem; }
.calc-form-grid { max-width: none; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.calc-form-grid .form-group { margin-bottom: 0; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink-2); }
.form-group select, .form-group input {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: .95rem; font-family: var(--font); background: #fff; color: var(--ink);
}
.form-group select:focus, .form-group input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,110,189,.15);
}
.calc-result { background: var(--brand-softer); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 1.5rem; text-align: center; margin-top: 1.5rem; }
.calc-result-value { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; color: var(--brand); }

/* Mini-calc: inputs dentro de <label> (no usan .form-group) */
.calc-form-grid > label { display: flex; flex-direction: column; gap: .4rem; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.calc-form-grid > label input,
.calc-form-grid > label select {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line);
  border-radius: var(--r-md); font-size: .95rem; font-family: var(--font); background: #fff; color: var(--ink);
}
.calc-form-grid > label input:focus,
.calc-form-grid > label select:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,110,189,.15);
}
/* Selects: flecha propia + apariencia consistente (la lista la pinta el navegador) */
.form-group select, .calc-form-grid > label select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230a6ebd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center;
}
.form-group select:hover, .calc-form-grid > label select:hover { border-color: var(--brand); }
/* Resultado principal destacado en las calculadoras */
.stat-card.stat-hero { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); border: none; box-shadow: var(--shadow-brand, var(--shadow-lg)); }
.stat-card.stat-hero .stat-label { color: rgba(255,255,255,.85); }
.stat-card.stat-hero .stat-value { color: #fff; font-size: 1.75rem; }
.stat-card.stat-hero:hover { transform: translateY(-2px); border: none; }

/* Bloque de preguntas (formato artículo, no tarjeta densa) */
.section-card.manana-qa h2 {
  margin-top: 1.85rem; margin-bottom: .5rem;
  padding-bottom: 0; border-bottom: none; font-size: 1.15rem;
}
.section-card.manana-qa p { color: var(--ink-2); margin-bottom: 0; }

/* === CONTENIDO === */
.content-page { max-width: none; }
.content-page pre { background: var(--ink); color: #e6edf5; border-radius: var(--r-md); padding: 1rem 1.1rem; overflow-x: auto; font-size: .85rem; margin: 1rem 0; }
.content-page pre code { font-family: var(--font-mono); }
.content-page h2 { margin-top: 2rem; }
.content-page p { margin-bottom: 1rem; color: var(--ink-2); }
.content-page ul, .content-page ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.content-page li { margin-bottom: .5rem; color: var(--ink-2); }

/* === MONETIZACION === */
.ad-banner {
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: var(--r-md);
  padding: 1.5rem; text-align: center; margin: 1.5rem 0; font-size: .8rem; color: var(--muted);
}
.affiliate-cta {
  background: var(--brand-softer); border: 1px solid var(--brand-tint);
  border-radius: var(--r-lg); padding: 1.5rem; margin: 1.5rem 0; text-align: center;
}
.affiliate-cta h3 { color: var(--brand-deep); margin-bottom: .5rem; }
.affiliate-cta p { color: var(--ink-2); font-size: .9rem; margin-bottom: 1rem; }
.newsletter-box { background: var(--brand-soft); border: 1px solid var(--brand-tint); border-radius: var(--r-lg); padding: 2rem; text-align: center; margin: 2rem 0; }
.newsletter-box h3 { margin-bottom: .5rem; }
.newsletter-box p { color: var(--ink-2); margin-bottom: 1rem; font-size: .9rem; }
.newsletter-form { display: flex; gap: .5rem; max-width: 400px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: .9rem; }

/* === ENLAZADO INTERNO (relacionados) === */
.relacionados { margin: 2.25rem 0 0; }
.relacionados h2, .relacionados-titulo { font-size: 1.1rem; font-weight: 800; margin: 0 0 .75rem; }
.relacionados-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.rel-link {
  display: inline-flex; align-items: center; padding: .5rem 1rem;
  border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line);
  color: var(--ink-2); font-weight: 600; font-size: .88rem;
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.rel-link:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; transform: translateY(-1px); }

/* === ANSWER BOX (respuesta directa / featured snippet) === */
.answer-box {
  background: var(--brand-soft); border-left: 4px solid var(--brand);
  border-radius: var(--r-md); padding: 1.1rem 1.4rem; margin-bottom: 1.25rem;
  font-size: 1.15rem; line-height: 1.6; color: var(--ink);
}
.answer-box strong { color: var(--brand-deep); }
.answer-box .tramo-badge { vertical-align: middle; }

/* === FRANJA HORARIA (visualización de precios por hora) === */
.franja { display: flex; align-items: flex-end; gap: 3px; height: 170px; margin-top: .5rem; }
.franja-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.franja-bar { width: 100%; max-width: 28px; min-height: 4px; border-radius: 5px 5px 0 0; }
.franja-bar.barato { background: var(--green); }
.franja-bar.medio { background: var(--amber); }
.franja-bar.caro { background: var(--red); }
.franja-col.actual .franja-bar { outline: 3px solid var(--brand); outline-offset: 2px; box-shadow: 0 0 0 5px var(--brand-tint); }
.franja-col.actual { z-index: 2; }
.franja-now-tag { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: .56rem; font-weight: 800; background: var(--brand); color: #fff; padding: .12rem .4rem; border-radius: 4px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow-sm); }
.franja-col:hover .franja-bar { filter: brightness(1.08); }
.franja-h { font-size: .62rem; color: var(--muted-2); margin-top: 4px; font-family: var(--font-mono); }
.franja-tag { position: absolute; top: -15px; font-size: .54rem; font-weight: 800; text-transform: uppercase; padding: .05rem .25rem; border-radius: 3px; white-space: nowrap; }
.franja-tag.barato { background: var(--green-soft); color: var(--green-deep); }
.franja-tag.caro { background: var(--red-soft); color: var(--red-deep); }
.franja-pies { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.franja-leg .d { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin: 0 .3rem 0 .7rem; vertical-align: -1px; }
.franja-leg .d:first-child { margin-left: 0; }
.franja-leg .d.barato { background: var(--green); } .franja-leg .d.medio { background: var(--amber); } .franja-leg .d.caro { background: var(--red); }
.franja-mm .fx.barato { color: var(--green-deep); } .franja-mm .fx.caro { color: var(--red-deep); }
.tabla-collapse { margin-bottom: 1.5rem; }
.tabla-collapse > summary { cursor: pointer; font-weight: 700; color: var(--brand-deep); padding: .85rem 1.25rem; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.tabla-collapse > summary::-webkit-details-marker { display: none; }
.tabla-collapse > summary::before { content: '▸ '; }
.tabla-collapse[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tabla-collapse[open] > summary::before { content: '▾ '; }
@media (max-width: 560px) { .franja { height: 140px; gap: 2px; } .franja-h { font-size: .5rem; } }

/* === MINI-CALCULADORA (electrodomésticos) === */
.calc-mini { border: 2px solid var(--brand); }
.calc-mini > h2 { margin-top: 0; }
.calc-mini-intro { color: var(--muted); margin: -.25rem 0 1rem; }
.mc-results { margin-top: 1.25rem; }
.calc-mini-nota { margin-top: 1rem; padding: .75rem 1rem; background: var(--green-soft); color: var(--green-deep); border-radius: var(--r-md); font-size: .9rem; }
.calc-mini-nota:empty { display: none; }

/* === WIDGET MEJOR HORA === */
.mejor-hora-widget {
  display: grid; gap: 0;
  background: #fff; border: 1.5px solid var(--brand);
  border-radius: var(--r-lg); padding: .35rem 1.75rem; margin: 0 0 1.75rem; max-width: none;
  box-shadow: var(--shadow-lg);
}
.mejor-hora-widget .mh-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 1.08rem; padding: .95rem .15rem; border-bottom: 1px solid var(--brand-tint); }
.mejor-hora-widget .mh-label { color: var(--ink-2); font-weight: 600; }
.mejor-hora-widget .mh-now,
.mejor-hora-widget .mh-next,
.mejor-hora-widget .mh-countdown { font-family: var(--font-mono); font-weight: 700; color: var(--ink); text-align: right; }
.mejor-hora-widget .mh-now { font-size: 1.12rem; color: var(--brand-deep); }
.mejor-hora-widget .mh-countdown { font-size: 1.2rem; color: var(--brand-deep); }
.mejor-hora-widget .mh-row:last-child { border-bottom: none; }
.mejor-hora-widget[data-loading] .mh-now,
.mejor-hora-widget[data-loading] .mh-next { color: var(--muted-2); }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-tint); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(255,255,255,.97); backdrop-filter: blur(12px);
    flex-direction: column; align-items: flex-start; padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }

  h1, .hero-section h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .precio-ring { width: 156px; height: 156px; }
  .precio-numero { font-size: 1.65rem; }
  .hero-precio--xl .precio-ring { width: 204px; height: 204px; border-width: 8px; }
  .hero-precio--xl .precio-numero { font-size: 2.35rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .chart-container { height: 270px; }
  .ranking-item { flex-wrap: wrap; gap: .5rem; }
  .ranking-hora { min-width: auto; }
  .day-nav { flex-direction: column; }
  .day-nav .btn { text-align: center; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 480px) {
  .main-content { padding: 1.25rem 1rem 2.5rem; }
  .stats-row { grid-template-columns: 1fr; }
  .tips-grid { grid-template-columns: 1fr; }
  .historico-meses { grid-template-columns: repeat(2, 1fr); }
}

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