/* Preciofono · estilo "limpio y confiable": superficies blancas, un solo azul de marca,
   íconos de trazo y jerarquía clara para comparar precios. */

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface-1: #ffffff;
  --surface-2: #f2f4f7;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --text-primary: #101828;
  --text-secondary: #475467;
  --text-muted: #667085;

  /* Marca: un solo azul */
  --brand: #1f5fd6;
  --brand-ink: #1a4fb3;
  --brand-soft: #eaf1fd;
  --on-brand: #ffffff;
  /* Compatibilidad con nombres anteriores (panel y páginas del servidor) */
  --violet: var(--brand);
  --violet-ink: var(--brand-ink);

  /* Series del gráfico (paleta validada) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --band: rgba(42, 120, 214, 0.12);
  --grid: #eef0f3;

  /* Estados: siempre con ícono + texto */
  --good: #12a150;
  --good-ink: #0e7a3c;
  --good-bg: #e7f6ed;
  --critical: #d03b3b;
  --critical-ink: #b42323;
  --critical-bg: #fdecec;
  --warn: #d98a00;
  --warn-ink: #8a5300;
  --warn-bg: #fff5e0;
  --info-ink: #1a4fb3;
  --info-bg: #eaf1fd;
  --neutral-bg: #f2f4f7;
  --official: #1a4fb3;
  --official-bg: #eaf1fd;
  --refurb-ink: #0b7a5f;
  --refurb-bg: #e3f5ef;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 4px 16px rgba(16, 24, 40, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c111b;
    --surface-1: #121826;
    --surface-2: #1a2232;
    --border: #273044;
    --border-strong: #354057;
    --text-primary: #f2f4f7;
    --text-secondary: #c3cad6;
    --text-muted: #8d97a8;
    --brand: #5b8def;
    --brand-ink: #8fb2f5;
    --brand-soft: #1a2945;
    --on-brand: #0c111b;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --band: rgba(57, 135, 229, 0.18);
    --grid: #222b3c;
    --good-ink: #6fdc95;
    --good-bg: #12301f;
    --critical-ink: #ff9a9a;
    --critical-bg: #3a1a1f;
    --warn-ink: #ffcf6b;
    --warn-bg: #352a10;
    --info-ink: #8fb2f5;
    --info-bg: #1a2945;
    --neutral-bg: #1a2232;
    --official: #8fb2f5;
    --official-bg: #1a2945;
    --refurb-ink: #62e0bd;
    --refurb-bg: #113a31;
    --shadow: none;
    --shadow-hover: 0 0 0 1px var(--border-strong);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c111b;
  --surface-1: #121826;
  --surface-2: #1a2232;
  --border: #273044;
  --border-strong: #354057;
  --text-primary: #f2f4f7;
  --text-secondary: #c3cad6;
  --text-muted: #8d97a8;
  --brand: #5b8def;
  --brand-ink: #8fb2f5;
  --brand-soft: #1a2945;
  --on-brand: #0c111b;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --band: rgba(57, 135, 229, 0.18);
  --grid: #222b3c;
  --good-ink: #6fdc95;
  --good-bg: #12301f;
  --critical-ink: #ff9a9a;
  --critical-bg: #3a1a1f;
  --warn-ink: #ffcf6b;
  --warn-bg: #352a10;
  --info-ink: #8fb2f5;
  --info-bg: #1a2945;
  --neutral-bg: #1a2232;
  --official: #8fb2f5;
  --official-bg: #1a2945;
  --refurb-ink: #62e0bd;
  --refurb-bg: #113a31;
  --shadow: none;
  --shadow-hover: 0 0 0 1px var(--border-strong);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: 15px/1.55 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.loading { padding: 40px 0; }
button { font-family: inherit; }
.i { flex: none; vertical-align: -0.15em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---------- Barra superior ---------- */
.topbar { background: color-mix(in srgb, var(--surface-1) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: var(--text-primary); letter-spacing: -0.02em; }
.brand b { color: var(--brand); font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: var(--on-brand); }
.nav { display: flex; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--text-secondary); white-space: nowrap; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.updated { font-size: 13px; color: var(--text-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-primary); padding: 8px 14px; border-radius: var(--radius-sm); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn:disabled { opacity: 0.65; cursor: progress; }
@media (max-width: 760px) {
  .updated { display: none; }
  .topbar-inner { gap: 10px; }
  .nav a { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 560px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 6px; row-gap: 6px; }
  .nav { order: 3; width: 100%; }
  .nav a { flex: 1; justify-content: center; }
}

/* ---------- Portada ---------- */
.hero { background: var(--surface-1); border-bottom: 1px solid var(--border); }
.hero-inner { padding: 36px 16px 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-ink); background: var(--brand-soft); border-radius: 999px; padding: 4px 10px; margin-bottom: 12px; }
.hero h1 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.03em; font-weight: 800; max-width: 720px; }
.hero p { margin: 0 0 20px; font-size: 16px; color: var(--text-secondary); max-width: 620px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 12px; padding: 4px 14px; max-width: 560px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.search .i { color: var(--text-muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--text-primary); background: transparent; padding: 10px 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta b { color: var(--text-primary); }
@media (max-width: 560px) {
  .hero-inner { padding: 20px 16px 18px; }
  .hero p { font-size: 14px; margin-bottom: 14px; }
  .hero-meta { margin-top: 12px; gap: 4px 14px; }
}

/* ---------- Filtros ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 4px; }
.filters .label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-right: 2px; }
.pill { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); padding: 6px 12px; border-radius: 999px; }
.pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.pill[aria-pressed="true"] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-ink); }
.filters select { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary); padding: 6px 10px; border-radius: 999px; margin-left: auto; }
@media (max-width: 640px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 14px -16px 4px; padding: 0 16px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters .pill, .filters select { flex: none; }
  .filters select { margin-left: 0; }
  .grade-filters { flex-wrap: wrap; overflow: visible; margin: 4px 0 8px; padding: 0; }
}

/* ---------- Grupos y tarjetas ---------- */
.group-title { display: flex; align-items: baseline; gap: 10px; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; margin: 28px 0 12px; }
.group-title small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card {
  display: grid; grid-template-columns: 52px 1fr; gap: 10px 12px;
  grid-template-areas: "art title" "price price" "meta meta" "foot foot";
  align-items: center;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.c-art { grid-area: art; }
.c-title { grid-area: title; min-width: 0; }
.c-price { grid-area: price; }
.c-meta { grid-area: meta; }
.c-foot { grid-area: foot; }
.card-name { font-weight: 800; font-size: 16px; line-height: 1.25; letter-spacing: -0.01em; }
.card-storage { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.price-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.price-big { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.price-where { font-size: 13px; color: var(--text-secondary); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-secondary); border-top: 1px solid var(--border); padding-top: 10px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.spark { width: 84px; height: 28px; flex: none; }
.savings { display: inline-flex; align-items: center; font-size: 12px; font-weight: 800; color: var(--good-ink); background: var(--good-bg); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--text-muted); }
.only-refurb { display: flex; gap: 10px; align-items: center; margin-top: 24px; background: var(--refurb-bg); color: var(--refurb-ink); border-radius: var(--radius); padding: 14px 16px; font-weight: 600; font-size: 14px; }
.only-refurb a { color: inherit; text-decoration: underline; }
.c-grades { grid-column: 1 / -1; }

/* En el celular cada modelo es una fila compacta: se ven varios sin bajar tanto. */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-areas: "art title price" "art foot foot";
    gap: 4px 12px; padding: 12px 14px; border-radius: 12px;
  }
  .c-art .phone-art { width: 40px; height: 52px; }
  .card-name { font-size: 15px; }
  .c-price { text-align: right; }
  .c-price .price-label, .c-price .price-where, .card .c-meta, .card .c-grades, .card .spark { display: none; }
  .price-big { font-size: 19px; }
  .c-foot { justify-content: flex-start; }
  .group-title { margin: 20px 0 8px; font-size: 16px; }
}

/* ---------- Chips y estados ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip.baja { background: var(--good-bg); color: var(--good-ink); }
.chip.sube { background: var(--critical-bg); color: var(--critical-ink); }
.chip.estable { background: var(--neutral-bg); color: var(--text-secondary); }
.chip.oficial { background: var(--official-bg); color: var(--official); }
.chip.marketplace { background: var(--neutral-bg); color: var(--text-secondary); }
.chip.tienda { background: var(--neutral-bg); color: var(--text-secondary); }
.chip.refurb { background: var(--refurb-bg); color: var(--refurb-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.reco-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.reco-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.reco-badge.esperar { color: var(--warn-ink); }
.reco-badge.esperar::before { background: var(--warn); }
.reco-badge.comprar { color: var(--good-ink); }
.reco-badge.comprar::before { background: var(--good); }
.reco-badge.estable::before { background: var(--brand); }
.official-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--official); font-weight: 600; }

/* ---------- Detalle de modelo ---------- */
.detail-hero { background: var(--surface-1); border-bottom: 1px solid var(--border); }
.detail-hero .wrap { padding-top: 18px; padding-bottom: 22px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.back:hover { color: var(--brand-ink); text-decoration: none; }
.detail-hero h1 { margin: 0; font-size: clamp(28px, 3.6vw, 38px); letter-spacing: -0.03em; font-weight: 800; line-height: 1.1; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.fact { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.fact .i { color: var(--text-muted); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.tab { font-size: 14px; font-weight: 700; cursor: pointer; border: 0; background: transparent; color: var(--text-secondary); padding: 7px 14px; border-radius: 9px; }
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"] { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12); }
.tab .i { color: var(--refurb-ink); }
.detail-hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail-hero-inner > div:first-child { flex: 1; min-width: 0; }
.detail-hero .tabs { margin-top: 16px; }
.hero-art { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 28px; background: radial-gradient(closest-side, var(--surface-2), transparent); }
.hero-art svg { filter: drop-shadow(0 12px 20px rgba(16, 24, 40, 0.18)); max-width: 100%; height: auto; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 2px solid var(--brand); outline-offset: 2px; }
.art-note { font-size: 11px; color: var(--text-muted); }
@media (max-width: 640px) {
  .detail-hero-inner { align-items: flex-start; gap: 12px; }
  .hero-art { padding: 0; background: none; gap: 6px; }
  .hero-art svg { height: 96px; width: auto; }
  .swatch { width: 14px; height: 14px; }
  .swatches { gap: 6px; }
  .art-note { display: none; }
  .facts { flex-direction: column; gap: 4px; }
}

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 16px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; min-width: 0; box-shadow: var(--shadow); }
.kpi-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; margin-bottom: 8px; background: var(--brand-soft); color: var(--brand-ink); }
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.kpi-value { font-size: 24px; font-weight: 800; line-height: 1.2; margin: 2px 0; letter-spacing: -0.02em; }
.kpi-sub { font-size: 13px; color: var(--text-secondary); }
@media (max-width: 560px) { .kpi { padding: 12px; } .kpi-value { font-size: 20px; } .kpi-icon { display: none; } }

.reco { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; border: 1px solid transparent; }
.reco-icon { flex: none; margin-top: 2px; }
.reco strong { display: block; font-size: 16px; letter-spacing: -0.01em; }
.reco.esperar { background: var(--warn-bg); color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.reco.comprar { background: var(--good-bg); color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.reco.estable { background: var(--info-bg); color: var(--info-ink); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.reco .why { display: block; font-size: 13px; opacity: 0.9; margin-top: 2px; }

.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; min-width: 0; box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin: 0 0 2px; letter-spacing: -0.01em; font-weight: 800; }
.panel h2 .i { color: var(--text-muted); }
.panel .sub { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--series-1) 0 4px, transparent 4px 7px); }
.legend i.band { height: 10px; background: var(--band); }
.legend i.dash-3 { background: repeating-linear-gradient(90deg, var(--series-3) 0 4px, transparent 4px 7px); }
.chart-box { position: relative; height: 300px; }
@media (max-width: 560px) { .chart-box { height: 240px; } .panel { padding: 14px; } }

.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.store-cell { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); color: var(--text-secondary); font-weight: 800; font-size: 14px; border: 1px solid var(--border); }
.store-cell b { display: block; }
.store-cell small { display: block; color: var(--text-muted); font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-row td { background: color-mix(in srgb, var(--good) 7%, transparent); }
.best-row td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.out td { opacity: 0.5; }
.sus td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
.stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.stock.no::before { background: var(--text-muted); }
.drivers { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); color: var(--brand-ink); white-space: nowrap; }
.go:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); text-decoration: none; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

.refurb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.refurb-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface-1); }
.refurb-item .p { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.refurb-item .who { font-size: 13px; color: var(--text-secondary); }
.refurb-item .t { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.refurb-item .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.warranty { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-secondary); }

.empty { background: var(--surface-1); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--text-secondary); margin-top: 24px; }

/* ---------- Ilustraciones ---------- */
.phone-art { flex: none; display: grid; place-items: center; width: 52px; height: 68px; }
.phone-art svg { max-width: 100%; height: auto; max-height: 100%; filter: drop-shadow(0 3px 6px rgba(16, 24, 40, 0.15)); }

/* ---------- Grados de reacondicionados ---------- */
.grade { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.grade.mini { font-size: 11px; padding: 2px 8px; }
.grade-ap { background: var(--brand-soft); color: var(--brand-ink); }
.grade-a { background: var(--good-bg); color: var(--good-ink); }
.grade-b { background: var(--neutral-bg); color: var(--text-secondary); }
.grade-c { background: var(--warn-bg); color: var(--warn-ink); }
.grade-none { background: var(--neutral-bg); color: var(--text-muted); }
.grade-row { display: flex; flex-wrap: wrap; gap: 6px; }
.grade-filters { margin: 4px 0 8px; }
.grade-help { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.grade-help summary { cursor: pointer; font-weight: 600; }
.grade-help ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.reco.compact { padding: 12px 14px; margin-bottom: 12px; }
.reco.compact strong { font-size: 15px; }

/* ---------- Alertas ---------- */
.alert-head { display: flex; gap: 12px; align-items: flex-start; }
.alert-bell { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); }
.alert-head h2 { margin-top: 4px; }
.alert-form { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 12px; }
.alert-form > * { min-width: 0; }
.alert-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--text-secondary); }
.alert-form input:not([type="checkbox"]), .alert-form select {
  width: 100%; min-width: 0; font: inherit; font-size: 15px; font-weight: 500; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-primary);
}
.alert-form input:focus, .alert-form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.alert-form .consent { grid-column: 1 / -1; flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 500; }
.alert-form .consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.alert-form button { grid-row: 1; grid-column: 4; height: 42px; }
.form-msg { grid-column: 1 / -1; margin: 0; font-weight: 700; font-size: 14px; min-height: 1em; }
.form-msg.ok { color: var(--good-ink); }
.form-msg.err { color: var(--critical-ink); }
@media (max-width: 900px) {
  .alert-form { grid-template-columns: 1fr 1fr; }
  .alert-form label:first-child { grid-column: 1 / -1; }
  .alert-form button { grid-row: auto; grid-column: 1 / -1; }
}

/* ---------- Páginas simples (alertas, panel, legales) ---------- */
.simple-page { padding-top: 12px; padding-bottom: 48px; }
.simple-page .empty h1 { font-size: 24px; margin-top: 0; }
.legal { max-width: 780px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin: 24px auto; line-height: 1.7; }
.legal h1 { margin-top: 0; letter-spacing: -0.02em; }
.legal h2 { font-size: 18px; margin-top: 28px; }
@media (max-width: 560px) { .legal { padding: 20px 16px; margin: 12px auto; border-radius: 12px; } }
.legal-links { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; font-weight: 600; }

/* ---------- Pie ---------- */
.footer { padding: 32px 0 44px; border-top: 1px solid var(--border); margin-top: 40px; background: var(--surface-1); }
.footer-title { font-size: 15px; margin: 22px 0 10px; }
.help { background: var(--surface-2); border-radius: 12px; padding: 12px 16px; }
.help summary { cursor: pointer; font-weight: 700; }
.help dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 14px 0 4px; font-size: 14px; }
.help dt { font-weight: 700; }
.help dd { margin: 0; color: var(--text-secondary); }
@media (max-width: 640px) { .help dl { grid-template-columns: 1fr; } .help dd { margin-bottom: 8px; } }
.stores { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.stores li { background: var(--surface-2); border-radius: 999px; padding: 4px 12px; color: var(--text-secondary); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--good); }
.dot.error { background: var(--critical); }
.dot.off { background: var(--text-muted); opacity: 0.5; }

/* ---------- Selector de tema ---------- */
.theme-toggle { width: 36px; height: 36px; padding: 0; flex: none; color: var(--text-secondary); }
.theme-choice { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 4px 0 14px; }
.theme-choice .label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.theme-choice button { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-secondary); }
.theme-choice button:hover { color: var(--text-primary); }
.theme-choice button[aria-pressed="true"] { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--brand-ink); }
@media (prefers-reduced-motion: no-preference) {
  body, .topbar, .theme-choice button { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
}

/* ---------- Panel: barras de visitas por día ---------- */
.vbars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 140px; padding-bottom: 20px; }
.vbar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.vbar-fill { width: 100%; min-height: 2px; background: var(--series-1); border-radius: 4px 4px 0 0; }
.vbar-label { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--text-muted); }
@media (max-width: 640px) { .vbar-label { font-size: 9px; } .vbars { gap: 3px; } }

/* ---------- Landing ---------- */
.hero-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 40px; align-items: center; padding-top: 44px; padding-bottom: 44px; }
.hero-copy h1 { font-size: clamp(28px, 4vw, 44px); max-width: 560px; }
.hero-copy p { max-width: 520px; }
.hero-figure { position: relative; margin: 0; }
.hero-figure > img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 20px; background: var(--surface-2); }
.float-card { position: absolute; left: -24px; bottom: 24px; display: flex; align-items: center; gap: 12px; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px 12px 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18); max-width: 300px; }
.float-card:hover { text-decoration: none; border-color: var(--border-strong); }
.float-card .phone-art { width: 36px; height: 48px; }
.float-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.float-name { font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.float-price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.float-body .reco-badge { font-size: 12px; }

.trust { border-bottom: 1px solid var(--border); background: var(--surface-1); }
.trust .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-top: 14px; padding-bottom: 14px; }
.trust-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.trust-store { font-size: 14px; font-weight: 700; color: var(--text-secondary); opacity: 0.85; }

#precios { padding-top: 8px; scroll-margin-top: 70px; }
.section { padding: 56px 0; }
.section + .section { padding-top: 8px; }
.section-title { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 28px 0 6px; }
.section .section-title { margin-top: 0; }
.section-sub { color: var(--text-secondary); margin: 0 0 18px; }
.center { text-align: center; }
.section-sub.center { margin-left: auto; margin-right: auto; max-width: 560px; margin-bottom: 28px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step h3 { margin: 12px 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.step-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); }

.band-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.band-inner.reverse .band-figure { order: 2; }
.band-figure { margin: 0; }
.band-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 20px; background: var(--surface-2); }
.band-copy .eyebrow { margin-bottom: 10px; }
.checks { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary); }
.checks li .i { color: var(--good); margin-top: 2px; }
.checks b { color: var(--text-primary); }

.faq { max-width: 760px; }
.faq .section-title { margin-bottom: 20px; }
.faq-item { border: 1px solid var(--border); background: var(--surface-1); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; font-weight: 700; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { margin: 0 0 16px; color: var(--text-secondary); }

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; padding-bottom: 28px; }
  .hero-figure > img { aspect-ratio: 16 / 9; border-radius: 16px; }
  .float-card { left: 12px; bottom: 12px; }
  .steps { grid-template-columns: 1fr; gap: 10px; }
  .band-inner { grid-template-columns: 1fr; gap: 20px; }
  .band-inner.reverse .band-figure { order: 0; }
  .section { padding: 40px 0; }
}
@media (max-width: 560px) {
  .hero-figure > img { aspect-ratio: 2 / 1; }
  .float-card { padding: 8px 12px 8px 8px; gap: 8px; }
  .float-card .phone-art { width: 28px; height: 36px; }
  .float-price { font-size: 18px; }
  .trust .wrap { gap: 4px 12px; }
  .trust-store { font-size: 13px; }
  .step { padding: 16px; }
}

/* ---------- Carga estable ---------- */
/* El contenido llega por JavaScript: se reserva el alto de la pantalla para que el pie no salte. */
#app { min-height: 100vh; min-height: 100svh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skel { display: block; background: var(--surface-2); border-radius: 10px; }
.skel-pill { width: 220px; height: 26px; border-radius: 999px; margin-bottom: 16px; }
.skel-h1 { width: 92%; height: 44px; margin-bottom: 10px; }
.skel-p { width: 80%; height: 18px; margin-top: 14px; }
.skel-short { width: 60%; }
.skel-search { max-width: 560px; height: 50px; margin-top: 22px; border-radius: 12px; }
.skel-img { width: 100%; aspect-ratio: 3 / 2; border-radius: 20px; }
@media (prefers-reduced-motion: no-preference) {
  .skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
  @keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
}
@media (max-width: 900px) { .skel-img { aspect-ratio: 16 / 9; border-radius: 16px; } .skel-h1 { height: 34px; } }
@media (max-width: 560px) { .skel-img { aspect-ratio: 2 / 1; } }
.show-all { margin-top: 12px; width: 100%; }
