/* Estilo "Pulido" (elegido frente a "Etiqueta y sello", archivada en diseno/variante-etiqueta/).
   Neutro frío en vez de crema; el rojo de marca solo para la marca y el Black Friday; el verde es el color del ahorro.
   Radios por jerarquía (8 controles · 12 tarjetas · 20 hojas); sombra solo en lo que flota. */
@font-face {
  font-family: "Instrument Sans"; src: url("fuentes/instrument-sans.woff2") format("woff2");
  font-weight: 400 700; font-stretch: 75% 100%; font-display: swap;
}

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --ink: #101217;
  --ink-2: #596070;
  --line: #e1e4ea;
  --accent: #101217;
  --accent-ink: #ffffff;
  --brand: #e8452c;
  --whatsapp: #1fa855;

  --real: #0a7a4a;      --real-bg: #e2f4ea;
  --inflado: #9a5800;   --inflado-bg: #fcefd9;
  --sin: #596070;       --sin-bg: #eceef2;
  --caro: #7a5a3c;      --caro-bg: #f1e8de; /* neutro: informa sin alarmar */
  --datos: #3556b0;     --datos-bg: #e6ecfa;

  --r-s: 8px; --r-m: 12px; --r-l: 20px;
  --elev: 0 1px 2px rgba(16,18,23,.06), 0 8px 24px rgba(16,18,23,.08);
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f13; --surface: #161920; --surface-2: #1f232b; --ink: #eef0f4; --ink-2: #9aa1ae;
    --line: #2a2f39; --accent: #eef0f4; --accent-ink: #0d0f13; --brand: #ff6a4f;
    --real: #4fd497; --real-bg: #10301f; --inflado: #f5b546; --inflado-bg: #33250f;
    --sin: #b0b6c2; --sin-bg: #23272f; --caro: #d4bea6; --caro-bg: #2d2620;
    --datos: #93abf2; --datos-bg: #1b2440;
    --elev: 0 8px 28px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f13; --surface: #161920; --surface-2: #1f232b; --ink: #eef0f4; --ink-2: #9aa1ae;
  --line: #2a2f39; --accent: #eef0f4; --accent-ink: #0d0f13; --brand: #ff6a4f;
  --real: #4fd497; --real-bg: #10301f; --inflado: #f5b546; --inflado-bg: #33250f;
  --sin: #b0b6c2; --sin-bg: #23272f; --caro: #d4bea6; --caro-bg: #2d2620;
  --datos: #93abf2; --datos-bg: #1b2440;
  --elev: 0 8px 28px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 var(--font); word-spacing: .06em; /* Instrument Sans trae el espacio entre palabras muy estrecho */
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.precio, .cp, .cifra b, .stat b, .ahorro b, .termo b, .hl, .cuenta b, .n { font-variant-numeric: tabular-nums; }

/* --- Cabecera --- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.marca svg { width: auto; stroke: none; }
.isotipo { height: 36px; fill: var(--brand); }
.isotipo .estrella { stroke: var(--brand); stroke-width: 28; stroke-linejoin: round; }
.logotipo { height: 34px; fill: currentColor; }
.logotipo .subrayado { fill: none; stroke: var(--brand); stroke-width: 62; stroke-linecap: butt; }
.cuenta { font-size: 12px; text-align: right; color: var(--ink-2); line-height: 1.2; }
.cuenta b { display: block; color: var(--brand); font-size: 16px; font-weight: 700; }

main, .pie { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.intro { padding: 26px 0 4px; }
.intro h1 { font-size: clamp(30px, 8vw, 48px); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; margin: 0 0 12px; max-width: 18ch; text-wrap: balance; }
.intro h1 span { color: var(--real); }
.intro p { margin: 0; color: var(--ink-2); max-width: 58ch; font-size: 15px; }
.intro p b { color: var(--ink); font-weight: 600; }

/* --- Buscador y sugerencias --- */
.buscador {
  position: sticky; top: calc(57px + env(safe-area-inset-top)); z-index: 4; background: var(--bg);
  padding: 10px 16px 8px; margin: 6px -16px 0;
}
.busqueda {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 8px 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  transition: border-color .15s, box-shadow .15s;
}
.busqueda > svg { color: var(--ink-2); font-size: 20px; flex: none; }
.busqueda input { border: 0; outline: 0; background: none; width: 100%; height: 100%; font-size: 16px; min-width: 0; }
.busqueda input::-webkit-search-cancel-button { display: none; }
.busqueda:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.q-limpiar { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.q-tecla { flex: none; font: 600 12px/1 var(--font); color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; margin-right: 6px; }
.busqueda:focus-within .q-tecla, .q-limpiar:not([hidden]) + .q-tecla { display: none; }
@media (hover: none) { .q-tecla { display: none; } }
.sugeridas {
  position: absolute; left: 16px; right: 16px; top: calc(100% - 4px); z-index: 6;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--elev);
  padding: 12px 14px 14px; animation: aparece .16s ease-out;
}
.sug-t { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sug-t + .sug-l + .sug-t { margin-top: 12px; }
.sug-l { display: flex; flex-wrap: wrap; gap: 6px; }
.sug { min-height: 36px; padding: 0 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; }
.sug:hover { border-color: var(--ink-2); }
.sug-c { color: var(--real); border-color: color-mix(in srgb, var(--real) 35%, var(--line)); }
.sug .n { font-size: 12px; opacity: .75; }
@keyframes aparece { from { opacity: 0; transform: translateY(-4px); } }

/* --- Rutas, categorías y filtros --- */
.rutas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 10px; background: var(--surface-2); padding: 4px; border-radius: var(--r-m); }
.ruta { min-height: 44px; padding: 0 6px; border: 0; border-radius: var(--r-s); background: none; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
@media (max-width: 420px) { .ruta .largo { display: none; } }
.ruta[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16,18,23,.08); }
.ruta .n { font-weight: 500; font-size: 12px; opacity: .75; }

.cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 0; padding: 2px 16px 4px; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer; scroll-snap-align: start;
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink);
  transition: background .15s, border-color .15s, transform .1s;
}
.cat:active { transform: scale(.96); }
.cat .n { font-weight: 500; font-size: 12px; color: var(--ink-2); }
.cat[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cat[aria-pressed="true"] .n { color: var(--bg); opacity: .7; }
.cat:disabled { opacity: .4; cursor: default; }
@media (min-width: 720px) { .cats { flex-wrap: wrap; overflow: visible; } }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px 2px; scrollbar-width: none; margin: 0 -16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: var(--r-s); cursor: pointer;
  border: 1px solid transparent; background: none; font-size: 13px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s;
}
.chip:active { transform: scale(.96); }
.chip[aria-checked="true"] { background: var(--surface); color: var(--ink); border-color: var(--line); font-weight: 600; }
.chip .n { font-size: 12px; opacity: .7; }
#chips-veredicto[hidden] { display: none; }
.sugerencias .chip { border-color: var(--line); background: var(--surface); color: var(--ink); min-height: 44px; }

.btn-filtros {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 8px; padding: 0 12px;
  border: 1px dashed var(--line); border-radius: var(--r-s); background: none; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-filtros svg { font-size: 16px; }
.btn-filtros .n { color: var(--ink); font-weight: 700; }
.btn-filtros[aria-expanded="true"] { border-style: solid; color: var(--ink); }
.selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 8px; }
.selects select:last-child { grid-column: 1 / -1; }
.selects select {
  height: 44px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--surface);
  padding: 0 10px; font-size: 14px; min-width: 0;
}
@media (max-width: 719px) { .selects:not(.abierto) { display: none; } }
@media (min-width: 720px) {
  .btn-filtros { display: none; }
  .selects { grid-template-columns: repeat(3, 1fr); }
  .selects select:last-child { grid-column: auto; }
}
.activos { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.activos:empty { display: none; }
.activo { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--ink); background: var(--surface); font-size: 13px; cursor: pointer; }
.activo svg { font-size: 14px; }
.activo.limpiar { border-color: var(--line); color: var(--ink-2); }

.resumen { color: var(--ink-2); font-size: 13px; margin: 10px 0 8px; }

/* --- Tarjetas --- */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: grid; grid-template-columns: 80px 1fr; gap: 14px; padding: 14px; height: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m);
  text-decoration: none; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
@media (hover: hover) { .card:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); box-shadow: var(--elev); } }
.card:active { transform: scale(.985); }
.thumb {
  width: 80px; height: 80px; border-radius: var(--r-s); background: #fff; object-fit: contain; padding: 4px;
}
.card-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.card-nombre {
  font-size: 14px; font-weight: 500; line-height: 1.3; margin: 0; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta { font-size: 12px; color: var(--ink-2); }
.fila { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 2px; }
.precio { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.tachado { font-size: 12px; color: var(--ink-2); text-decoration: line-through; margin-left: 4px; font-weight: 400; }
.precio-tienda { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; }
.precio-tienda .tienda { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.conclusion { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.aviso { color: var(--inflado); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.aviso svg { font-size: 13px; }
.thumb.sin-img { display: grid; place-items: center; font-size: 11px; color: var(--ink-2); background: var(--surface-2); text-align: center; }
.comp { font-size: 13px; color: var(--ink-2); }
.comp.mejor { color: var(--real); font-weight: 600; }

/* Veredictos: en tarjetas y leyenda, texto con un punto de color; los fondos quedan para el cuadro de la ficha */
.badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.v-real { color: var(--real); background: var(--real-bg); }
.v-inflado { color: var(--inflado); background: var(--inflado-bg); }
.v-sin_descuento { color: var(--sin); background: var(--sin-bg); }
.v-mas_caro { color: var(--caro); background: var(--caro-bg); }
.v-sin_datos { color: var(--datos); background: var(--datos-bg); }
.badge[class*="v-"] { background: none; }
.c-real { color: var(--real); } .c-inflado { color: var(--inflado); } .c-sin_descuento { color: var(--sin); }
.c-mas_caro { color: var(--caro); } .c-sin_datos { color: var(--datos); }

/* Ahorro en dinero de una rebaja verificada: el dato más visible de la tarjeta después del precio */
.ahorro {
  display: inline-flex; align-items: baseline; gap: 5px; align-self: flex-start; flex-wrap: wrap;
  color: var(--real); background: var(--real-bg); border-radius: var(--r-s); padding: 3px 9px;
  font-size: 13px; font-weight: 600; line-height: 1.3;
}
.ahorro b { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.ahorro.sobre { color: var(--caro); background: var(--caro-bg); }

/* --- Termómetro: barra de mínimo a máximo, marca del habitual y punto del precio de hoy --- */
.termo { position: relative; padding: 4px 0; }
.termo-barra {
  position: relative; height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--real) 45%, var(--surface-2)), var(--surface-2) 55%, color-mix(in srgb, var(--caro) 35%, var(--surface-2)));
}
.termo-ref { position: absolute; left: var(--ref); top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--ink-2); transform: translateX(-50%); }
.termo-hoy {
  position: absolute; left: var(--hoy); top: 50%; width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 25%, transparent);
  transform: translate(-50%, -50%);
}
.termo-real .termo-hoy { background: var(--real); }
.termo-inflado .termo-hoy { background: var(--inflado); }
.termo-mas_caro .termo-hoy { background: var(--caro); }
.termo-grande { padding: 0; }
.termo-grande .termo-barra { height: 10px; }
.termo-grande .termo-hoy { width: 20px; height: 20px; border-width: 4px; }
.termo-t-hoy { display: block; width: max-content; position: relative; left: var(--hoy-t); transform: translateX(-50%); font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.termo-t-hoy b { color: var(--ink); font-size: 15px; }
.termo-real .termo-t-hoy b { color: var(--real); }
.termo-ejes { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.termo-ejes span { display: grid; gap: 1px; }
.termo-ejes b { color: var(--ink); font-size: 14px; font-weight: 600; }
.termo-t-ref { text-align: center; }
.termo-t-ref::before { content: ""; width: 2px; height: 10px; background: var(--ink-2); justify-self: center; border-radius: 1px; }
.termo-max { text-align: right; }

/* --- Esqueleto de carga --- */
.esq { cursor: default; pointer-events: none; }
.esq .thumb, .esq i { background: var(--surface-2); }
.esq .card-body i { display: block; height: 11px; border-radius: 6px; }
.esq .card-body i:nth-child(1) { width: 92%; } .esq .card-body i:nth-child(2) { width: 46%; height: 18px; }
.esq .card-body i:nth-child(3) { width: 64%; } .esq .card-body i:nth-child(4) { width: 100%; height: 6px; margin-top: auto; }
.esq .thumb, .esq i { animation: pulso 1.2s ease-in-out infinite alternate; }
@keyframes pulso { to { opacity: .45; } }

.vacio { text-align: center; color: var(--ink-2); padding: 32px 8px; }
.vacio p { max-width: 46ch; margin: 0 auto 12px; }
.sugerencias { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.mas { width: 100%; margin: 14px 0 0; min-height: 48px; }

/* --- Portada "Lo mejor de hoy" --- */
.hoy { margin-top: 22px; display: grid; gap: 10px; }
.hoy-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hoy-cab h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
/* En móvil los bloques se deslizan de lado para que el buscador quede cerca del inicio */
.hoy-grid {
  display: grid; gap: 10px; grid-auto-flow: column; grid-auto-columns: min(86%, 360px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
  margin: 0 -16px; padding: 2px 16px 6px; scroll-padding-inline: 16px;
}
.hoy-grid::-webkit-scrollbar { display: none; }
.hoy-grid > * { scroll-snap-align: start; }
.hoy-grid:has(> :only-child) { grid-auto-columns: 100%; }
@media (min-width: 900px) {
  .hoy-grid { grid-auto-flow: row; grid-template-columns: 1.25fr 1fr 1fr; overflow: visible; margin: 0; padding: 0; }
  /* Con un solo bloque (días sin tachados ni comparaciones) ocupa el ancho y reparte su lista en tres columnas */
  .hoy-grid:has(> :only-child) { grid-template-columns: 1fr; }
  .hoy-grid:has(> :only-child) .hoy-b ol { grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
  .hoy-grid:has(> :only-child) .hoy-b li:nth-child(-n+3) a { border-top: 0; }
  .hoy-grid:has(> :only-child) .hoy-mas { justify-self: start; padding: 0 20px; }
}
.hoy-b { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.hoy-b h3 { margin: 0; font-size: 15px; }
/* El bloque de descuentos reales es la respuesta principal de la portada */
.hb-real { border-color: color-mix(in srgb, var(--real) 40%, var(--line)); background: linear-gradient(180deg, var(--real-bg), var(--surface) 140px); }
.hb-real h3 { color: var(--real); font-size: 17px; }
.hb-inflado h3 { color: var(--inflado); }
.hoy-b ol { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.hoy-b li a { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; min-height: 44px; }
.hoy-b li:first-child a { border-top: 0; }
@media (hover: hover) { .hoy-b li a:hover .hn { text-decoration: underline; text-underline-offset: 3px; } }
.hn { font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hl { font-size: 13px; color: var(--ink-2); }
.hl b { color: var(--ink); }
.hoy-b .ahorro { display: flex; width: fit-content; margin: 2px 0 4px; background: var(--surface); }
.hoy-b .ahorro b { font-size: 16px; color: inherit; }
.hoy-mas { margin-top: 6px; min-height: 44px; }

/* --- Cómo lo calculamos --- */
.como {
  margin: 32px 0 8px; padding: 20px; border-radius: var(--r-m);
  background: var(--surface); border: 1px solid var(--line);
}
.como h2 { margin: 0 0 10px; font-size: 20px; letter-spacing: -.02em; }
.como h3 { font-size: 15px; margin: 16px 0 6px; }
.como ol, .como ul { margin: 0 0 12px; padding-left: 20px; color: var(--ink-2); font-size: 14px; }
.como li { margin-bottom: 6px; }
.como li b { color: var(--ink); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; }
#cobertura { font-size: 13px; color: var(--ink-2); margin: 0; }

.pie { color: var(--ink-2); font-size: 12px; padding-top: 12px; padding-bottom: 32px; }
.pie p { margin: 6px 0; }

/* --- Detalle (hoja inferior en móvil) --- */
dialog {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100%; height: 100%;
  background: transparent; color: var(--ink);
}
dialog::backdrop { background: rgba(10,12,16,.5); backdrop-filter: blur(2px); }
.sheet {
  position: absolute; inset: auto 0 0 0; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: var(--r-l) var(--r-l) 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--elev);
  animation: sube .42s cubic-bezier(.2, 1.15, .3, 1);
}
@media (min-width: 720px) {
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(660px, 92vw); border-radius: var(--r-l); animation: aparece .2s ease-out; }
}
@keyframes sube { from { transform: translateY(60px); opacity: .3; } }
.sheet-top {
  position: sticky; top: -18px; z-index: 2; display: flex; justify-content: flex-end;
  margin: -18px -16px 4px; padding: 8px 12px; background: var(--bg);
}
.sheet-top::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
@media (min-width: 720px) { .sheet-top::before { display: none; } }
.cerrar {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer;
  font-size: 18px;
}
.d-cab { display: flex; gap: 14px; align-items: center; }
.d-cab img { flex: none; width: 96px; height: 96px; border-radius: var(--r-m); background: #fff; object-fit: contain; padding: 6px; border: 1px solid var(--line); }
@media (max-width: 400px) { .d-cab img { width: 72px; height: 72px; } }
.d-cab h2 { font-size: 18px; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 4px; font-weight: 600; }
.d-precio { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; }
.d-precio .precio { font-size: 36px; letter-spacing: -.03em; }
.d-precio .tachado { font-size: 15px; }
.d-ahorro { margin: 4px 0 8px; padding: 8px 12px; font-size: 15px; }
.d-ahorro b { font-size: 26px; }
.d-ahorro span { flex-basis: 100%; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.d-verdict { border-radius: var(--r-m); padding: 14px 16px; margin: 12px 0; font-size: 15px; }
.d-verdict strong { display: block; font-size: 17px; margin-bottom: 2px; }
.d-verdict p { margin: 0; color: var(--ink); }
.d-verdict .explica { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.d-verdict .explica a { color: var(--ink); font-weight: 600; }
.d-termo, .grafico, .comparar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; margin: 12px 0; }
.d-termo h3, .grafico h3, .comparar h3 { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; font-weight: 600; }
.d-termo h3 span { font-weight: 500; }
.grafico { padding: 12px 8px 8px; }
.grafico h3 { margin: 0 6px 6px; }
.grafico svg.chart { width: 100%; height: auto; display: block; stroke: none; touch-action: pan-y; }
.chart .eje { fill: var(--ink-2); font-size: 11px; font-family: var(--font); }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .linea { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .area { fill: var(--ink); opacity: .05; }
.chart .ref { stroke: var(--real); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-t { fill: var(--real); font-size: 10px; font-weight: 600; font-family: var(--font); }
.chart .bf { stroke: var(--brand); stroke-width: 1.5; }
.chart .bf-t { fill: var(--brand); font-size: 10px; font-weight: 700; font-family: var(--font); }
.chart .lista { fill: var(--inflado); }
.chart .cursor { stroke: var(--ink-2); stroke-width: 1; }
.chart .punto { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.chart .tip { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--font); }
.leyenda-g { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); margin: 4px 6px 0; }
.leyenda-g i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 4px; }
.comparar ol { list-style: none; margin: 0; padding: 0; }
.comparar li { border-top: 1px solid var(--line); padding: 9px 0; }
.comparar li:first-child { border-top: 0; }
.comparar li.actual { background: var(--surface-2); margin: 0 -14px; padding: 9px 14px; }
.comparar a { display: flex; justify-content: space-between; gap: 8px; text-decoration: none; min-height: 28px; align-items: center; }
.comparar .ct { font-weight: 600; }
.comparar .cp { font-weight: 700; }
.comparar .cm { display: block; font-size: 12px; color: var(--ink-2); }
/* Las dos cifras de una oferta con tachado: lo que anuncia la tienda y lo que muestra el historial */
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.cifra { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 12px; display: grid; gap: 2px; align-content: start; }
.cifra span { font-size: 12px; color: var(--ink-2); line-height: 1.25; }
.cifra b { font-size: 20px; }
.cifra small { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.aviso-caja { display: flex; gap: 8px; align-items: flex-start; background: var(--inflado-bg); color: var(--ink); border-radius: var(--r-m); padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.aviso-caja svg { color: var(--inflado); font-size: 18px; flex: none; margin-top: 2px; }
.nota-pie { font-size: 12px; color: var(--ink-2); margin-top: 12px; }

/* Barra de acciones: en móvil queda pegada abajo de la hoja, con "Ver en tienda" siempre a mano */
.acciones {
  position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); z-index: 2;
  display: grid; grid-template-columns: 1fr 48px 48px; gap: 8px;
  margin: 14px -16px calc(-20px - env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.acciones .txt { display: none; }
.acciones .btn { padding: 0; }
.acciones .btn.prim { padding: 0 12px; min-width: 0; }
@media (min-width: 720px) {
  .acciones { position: static; grid-template-columns: 1fr 1fr; margin: 14px 0 0; padding: 0; border: 0; background: none; backdrop-filter: none; }
  .acciones .txt { display: inline; }
  .acciones .btn.prim { grid-column: 1 / -1; order: 3; }
}
.btn {
  height: 48px; border-radius: var(--r-m); display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; text-decoration: none; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
@media (hover: hover) { .btn:hover { filter: brightness(.97); } }
.btn.prim { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.wa { background: var(--whatsapp); color: #fff; border-color: var(--whatsapp); }
.btn svg { font-size: 18px; }
.btn.reportar { width: 100%; margin-top: 8px; font-size: 14px; }
.acciones .full { grid-column: 1 / -1; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 100;
  animation: aparece .18s ease-out;
}
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
