/* ==========================================================
   QueGanga — hoja de estilos
   ========================================================== */
:root {
  --brand: #086878;
  --brand-ink: #083848;
  --brand-soft: #e3f1f2;
  --accent: #f86818;
  --accent-2: #ff8a3d;
  --accent-soft: #fff0e6;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f7f9fa;
  --ink: #0f2230;
  --ink-2: #4a5d6b;
  --muted: #7a8b97;
  --line: #e4e9ed;
  --ok: #0f9d6b;
  --danger: #d93a3a;
  /* Niveles de puntos: gris → petróleo → naranja → naranja intenso */
  --cold: var(--muted);
  --warm: var(--brand);
  --hot: var(--accent);
  --fire: #e2530a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 34, 48, .04), 0 4px 16px rgba(15, 34, 48, .06);
  --shadow-lg: 0 2px 4px rgba(15, 34, 48, .05), 0 16px 40px rgba(15, 34, 48, .12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Baloo 2", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3fb8c8; --brand-ink: #d7eef1; --brand-soft: #12333b;
    --accent-soft: #3a2113; --bg: #0b1419; --surface: #121f26; --surface-2: #17262e;
    --ink: #e8f0f3; --ink-2: #b1c1ca; --muted: #7f929d; --line: #223540;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    --shadow-lg: 0 16px 40px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #3fb8c8; --brand-ink: #d7eef1; --brand-soft: #12333b;
  --accent-soft: #3a2113; --bg: #0b1419; --surface: #121f26; --surface-2: #17262e;
  --ink: #e8f0f3; --ink-2: #b1c1ca; --muted: #7f929d; --line: #223540;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 1.1em; height: 1.1em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; padding-top: 32px; padding-bottom: 48px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* dark-mode-only icons */
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block; }
  :root:not([data-theme="light"]) .only-light { display: none; }
}
img.only-dark { display: none; }
:root[data-theme="dark"] img.only-dark { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.only-dark { display: block; } }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 700; font-size: 14px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }
.btn-telegram { background: #229ed9; color: #fff; }
.btn-telegram:hover { box-shadow: 0 6px 18px rgba(34, 158, 217, .35); }
.btn-go { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 4px 14px rgba(248, 104, 24, .3); }
.btn-go:hover { box-shadow: 0 8px 22px rgba(248, 104, 24, .45); transform: translateY(-1px); }
.icon-btn { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.linkish { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0; }

/* ---------- Cabecera ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { height: 50px; width: auto; }
.search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent); background: var(--surface); }
.search .i { color: var(--muted); }
.search input[type=search] { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; padding: 0; box-shadow: none; }
.search kbd { font: 600 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.catbar { border-top: 1px solid var(--line); }
.catbar-inner { position: relative; display: flex; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
/* Sin JS: desplazamiento horizontal. Con JS (.fit): los que no caben pasan al menú "Más" */
.cat-chips { display: flex; gap: 8px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chips.fit { overflow: hidden; }
.chip.is-hidden, .cat-item.is-hidden { display: none; }
.cat-more { flex: none; }
.chip.cat-more-btn { cursor: pointer; background: var(--surface); border-color: var(--line); font: inherit; font-weight: 700; font-size: 14px; }
.cat-more-btn .i { width: 16px; height: 16px; transition: transform .2s; }
.cat-more-btn[aria-expanded="true"] .i { transform: rotate(180deg); }
.cat-menu { position: absolute; top: calc(100% - 4px); right: 16px; width: 360px; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 12px; }
.cat-menu[hidden] { display: none; }
.cat-menu-title { margin: 2px 8px 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cat-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.cat-item span { font-size: 18px; line-height: 1; }
.cat-item:hover { background: var(--surface-2); color: var(--ink); }
.cat-item.active { background: var(--brand-soft); color: var(--brand); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); border: 1px solid transparent; transition: background .15s; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 300px at 85% -40%, rgba(248, 104, 24, .22), transparent 60%), linear-gradient(135deg, #083848 0%, #086878 70%, #0a7f8f 100%); color: #fff; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; padding-top: 40px; padding-bottom: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 999px; color: #ffd3b8; }
.hero h2 { font: 800 clamp(28px, 4vw, 44px)/1.05 var(--display); margin: 14px 0 10px; letter-spacing: -.02em; }
.hero h2 em { font-style: normal; color: var(--accent-2); }
.hero p { margin: 0; opacity: .85; max-width: 560px; font-size: 16px; }
.hero-stats { position: relative; display: flex; gap: 14px; justify-content: flex-end; align-items: flex-end; min-height: 150px; }
.hero-stats > div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); border-radius: var(--radius); padding: 14px 18px; position: relative; z-index: 1; }
.hero-stats b { display: block; font: 800 30px/1 var(--display); }
.hero-stats span { font-size: 13px; opacity: .8; }
.hero-pig { position: absolute; right: 0; top: -64px; width: 124px; height: 124px; z-index: 2; opacity: .95; transform: rotate(8deg); filter: drop-shadow(0 12px 24px rgba(0,0,0,.25)); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding-top: 28px; padding-bottom: 56px; }
.feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.feed-head h1 { font: 800 28px/1.1 var(--display); }
.feed-head p { margin: 4px 0 0; }
.view-toggle { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.view-toggle button { width: 36px; height: 32px; border: 0; background: none; border-radius: 999px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.view-toggle button.on { background: var(--brand-soft); color: var(--brand); }
.tabs { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); flex: none; }
.tab:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.tab.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.section-title { font: 800 20px var(--display); margin: 28px 0 14px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--brand); }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin-bottom: 14px; }
.card-title .i { color: var(--accent); }

.deals { display: grid; gap: 14px; }
.deal { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s; }
.deal:hover { box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); }
.media { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1; background: var(--surface-2); }
.media img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 8px; transition: transform .3s; }
.deal:hover .media img { transform: scale(1.04); }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 28%, transparent), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--surface-2)), var(--surface-2)); }
.ph span { font-size: 64px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.15)); transition: transform .3s; }
.deal:hover .ph span { transform: scale(1.1) rotate(-6deg); }
.badge-pct { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font: 800 13px/1 var(--font); padding: 6px 9px; border-radius: 999px; box-shadow: 0 3px 10px rgba(248, 104, 24, .35); }
.deal-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.when { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }
.when .i { width: 14px; height: 14px; }
.tag-feat, .tag-exp { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 999px; margin-right: 6px; }
.tag-feat { background: var(--accent-soft); color: var(--accent); }
.tag-exp { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.deal-title { font-size: 17px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-title a:hover { color: var(--brand); }
.deal-desc { margin: 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.deal-cta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.store { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.store i, .store-cloud i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 20%, transparent); }
.store:hover { color: var(--ink); }

/* Precios */
.prices { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font: 800 22px/1 var(--display); color: var(--accent); letter-spacing: -.01em; }
.price.free { color: var(--ok); }
.old { color: var(--muted); font-size: 15px; }
.pct { font-weight: 800; font-size: 13px; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 8px; }
.ship { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ok); }
.ship.muted { color: var(--muted); }
.prices.big .price { font-size: 36px; }
.prices.big .old { font-size: 18px; }
.price-checked { display: flex; align-items: center; gap: 5px; margin: -4px 0 0; font-size: 12.5px; color: var(--muted); }
.price-checked .i { width: 14px; height: 14px; color: var(--ok); flex: none; }

/* Puntuación QueGanga: 0-100 cerditos (src/puntuacion.js). Tramos: cold < warm < hot < fire */
.pig { width: 18px; height: 18px; flex: none; display: inline-block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.temp { display: inline-flex; align-items: center; gap: 2px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); height: 34px; padding: 0 12px 0 6px; --t: var(--cold); }
.temp-warm { --t: var(--warm); } .temp-hot { --t: var(--hot); } .temp-fire { --t: var(--fire); }
.temp .deg { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; font: 800 17px/1 var(--display); color: var(--t); }
.temp .tramo { font: 700 12px/1 var(--display); color: var(--t); white-space: nowrap; }
.temp.temp-fire { background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent) 14%, var(--surface))); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.temp-fire .deg .pig { width: 21px; height: 21px; }
/* Desglose «Por qué tiene N cerditos» en la página de cada ganga */
.score .score-head { display: flex; align-items: center; gap: 16px; }
.score h2 { margin: 0 0 4px; font-size: 20px; }
.score .score-head p { margin: 0; }
.score-big { display: inline-flex; align-items: center; gap: 6px; font: 800 46px/1 var(--display); color: var(--t); flex: none; }
.score-big .pig { width: 36px; height: 36px; }
.score-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.score-list li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; font-size: 14px; }
.score-pts { font: 800 16px/1 var(--display); color: var(--t); white-space: nowrap; }
.score-pts small { font-size: 11px; opacity: .65; }
.score-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: inherit; background: var(--t); }
@media (max-width: 520px) { .score .score-head { flex-direction: column; align-items: flex-start; gap: 8px; } }
.mini { display: inline-flex; align-items: center; gap: 3px; font: 800 13px var(--display); color: var(--t, var(--cold)); flex: none; }
.mini .pig { width: 15px; height: 15px; }
.mini.temp-warm { --t: var(--warm); } .mini.temp-hot { --t: var(--hot); } .mini.temp-fire { --t: var(--fire); }
.lbl-pig { display: inline-flex; align-items: center; gap: 6px; }
.table .pig { vertical-align: -3px; }

/* Cupón */
.coupon { display: inline-flex; align-items: stretch; height: 42px; border-radius: 999px; border: 1.5px dashed color-mix(in srgb, var(--brand) 55%, transparent); background: var(--brand-soft); cursor: pointer; padding: 0; overflow: hidden; transition: border-color .15s; }
.coupon .code { display: grid; place-items: center; padding: 0 14px; font: 700 14px ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .06em; color: var(--brand); }
.coupon .copy { display: inline-flex; align-items: center; gap: 5px; padding: 0 14px; font-weight: 700; font-size: 13px; background: var(--brand); color: #fff; }
.coupon:hover { border-color: var(--brand); }
.coupon.copied .copy { background: var(--ok); }

/* Terminado */
.deal.expired, .detail.expired { opacity: .62; filter: grayscale(.7); }
.deal.expired:hover { opacity: .85; }

/* Vista cuadrícula */
:root[data-view="grid"] .feed .deals:not(.related) { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
:root[data-view="grid"] .feed .deals:not(.related) .deal { grid-template-columns: 1fr; gap: 12px; }
:root[data-view="grid"] .feed .deals:not(.related) .deal-desc { display: none; }
:root[data-view="grid"] .feed .deals:not(.related) .deal-foot { flex-direction: column; align-items: stretch; }
:root[data-view="grid"] .feed .deals:not(.related) .deal-cta { flex-direction: column; align-items: stretch; }
:root[data-view="grid"] .feed .deals:not(.related) .btn-go { width: 100%; }
:root[data-view="grid"] .feed .deals:not(.related) .coupon { justify-content: space-between; }
.deals.related { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.deals.related .deal { grid-template-columns: 1fr; }
.deals.related .deal-desc { display: none; }

/* Detalle */
.detail { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; padding: 24px; margin-bottom: 18px; }
.detail-media .ph span { font-size: 110px; }
.detail-body { display: flex; flex-direction: column; gap: 14px; }
.detail-title { font-size: 26px; font-weight: 800; line-height: 1.25; }
.detail-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.detail-cta .btn-go { height: 50px; padding: 0 26px; font-size: 16px; }
.detail-cta .coupon { height: 50px; }
.aff-note { display: flex; gap: 6px; align-items: center; margin: 0; font-size: 12.5px; color: var(--muted); }
.prose h1 { font: 800 28px var(--display); margin-bottom: 14px; }
.prose h2 { font-size: 18px; margin-bottom: 10px; }
.prose p { color: var(--ink-2); }
.prose code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
/* «La ganga demostrada»: el precio de los últimos 90 días */
.proof { margin-top: 16px; display: grid; gap: 10px; }
.proof h2 { font: 800 22px var(--display); margin: 0; }
.proof h2 em { font-style: normal; color: var(--accent); }
.proof p { margin: 0; color: var(--ink-2); }
.proof-chart { width: 100%; height: auto; background: var(--surface-2); border-radius: var(--radius-sm); }
.proof-line { stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.proof-min { stroke: var(--line); stroke-width: 2; stroke-dasharray: 8 8; }
.proof-dot { fill: var(--ok); }
.proof-label { fill: var(--muted); font: 600 13px var(--font); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.cta-telegram { background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); text-align: center; position: relative; overflow: hidden; }
.cta-telegram h3 { font: 800 21px var(--display); margin: 8px 0 6px; }
.cta-telegram p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; }
.cta-pig { width: 72px; height: 72px; margin: 0 auto; border-radius: 22px; background: var(--surface); display: grid; place-items: center; box-shadow: var(--shadow); transform: rotate(-6deg); }
.cta-pig img { width: 56px; height: 56px; }
.toplist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.toplist li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; line-height: 1.35; }
.toplist a { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toplist a:hover { color: var(--brand); }
.rank { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 800 13px var(--display); background: var(--brand-soft); color: var(--brand); }
.toplist li:first-child .rank { background: var(--accent); color: #fff; }
.store-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.store-cloud a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.store-cloud a:hover { border-color: var(--c); }
.store-cloud small { color: var(--muted); font-weight: 600; }
.store-cloud.big { margin-bottom: 18px; }
.store-cloud.big a { padding: 10px 16px; font-size: 14px; background: var(--surface); }
.newsletter form { display: grid; gap: 10px; }
input[type=email], input[type=text], input[type=url], input[type=number], input[type=password], input[type=date], input[type=search], input:not([type]), select, textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); background: var(--surface); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check a { text-decoration: underline; }

/* Paginación / vacío */
.pager { display: flex; justify-content: space-between; margin-top: 22px; }
.empty { text-align: center; padding: 48px 20px; }
.empty span { font-size: 56px; display: block; }
.empty h1 { font: 800 28px var(--display); margin: 8px 0; }
.empty p { color: var(--ink-2); margin: 8px 0 18px; }

/* Footer */
.footer { background: var(--surface); border-top: 1px solid var(--line); padding-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 32px; }
.footer-social-text { margin: 0 0 12px; }

/* Redes sociales */
.social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 999px; color: #fff; font-weight: 700; font-size: 14px; transition: transform .15s, box-shadow .15s; }
.social-btn .i { width: 18px; height: 18px; }
.social-btn:hover { transform: translateY(-1px); }
.social-facebook { background: #1877f2; }
.social-facebook:hover { box-shadow: 0 6px 18px rgba(24, 119, 242, .35); }
.social-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b 50%, #8134af 80%, #515bd4); }
.social-instagram:hover { box-shadow: 0 6px 18px rgba(221, 42, 123, .35); }
/* Franja superior "Síguenos…" (va dentro de .topbar, así que queda fija arriba) */
.promo-bar { background: linear-gradient(90deg, #083848, #086878); color: #fff; font-size: 13px; }
.promo-inner { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 38px; padding-top: 4px; padding-bottom: 4px; }
.promo-text { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promo-text b { font-weight: 700; }
.promo-text .pig { width: 20px; height: 20px; }
.promo-links { display: flex; gap: 6px; flex: none; }
.promo-btn { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: transform .15s; box-shadow: 0 0 0 1.5px rgba(255,255,255,.25); }
.promo-btn .i { width: 15px; height: 15px; }
.promo-btn:hover { transform: translateY(-1px) scale(1.06); }
.social-telegram { background: #229ed9; }
/* Móvil: el texto puede partirse en dos líneas y la franja se compacta */
@media (max-width: 760px) {
  .promo-inner { justify-content: space-between; gap: 10px; min-height: 40px; }
  .promo-text { white-space: normal; font-size: 12px; line-height: 1.25; }
  .promo-text b { text-wrap: balance; }
  .promo-text .pig { width: 18px; height: 18px; }
  .promo-btn { width: 26px; height: 26px; }
}

/* Separador "o síguenos en" dentro de la tarjeta de alertas */
.cta-telegram .cta-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cta-or::before, .cta-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.footer-grid .social-btn { color: #fff; }
.footer-logo { margin-bottom: 8px; }
.footer-logo img { height: 46px; width: auto; }
.footer h4 { font-size: 14px; margin-bottom: 12px; }
.footer-grid > div > a { display: block; color: var(--ink-2); font-size: 14px; padding: 3px 0; }
.footer-grid > div > a:hover { color: var(--brand); }
.disclosure { display: flex; gap: 10px; align-items: flex-start; margin-top: 28px; padding-top: 18px; padding-bottom: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.disclosure p { margin: 0; }
.disclosure .i { margin-top: 2px; }
.copyright { padding-top: 6px; padding-bottom: 28px; font-size: 12.5px; }

/* Cookie + toast */
.cookie { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 520px; margin: 0 auto; z-index: 60; display: flex; gap: 14px; align-items: center; background: var(--ink); color: var(--surface); padding: 12px 12px 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px; }
.cookie p { margin: 0; flex: 1; }
.cookie a { text-decoration: underline; }
.cookie[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 70; background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: opacity .2s, transform .2s; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .brand img { height: 40px; }
  .search { order: 3; flex-basis: 100%; max-width: none; height: 42px; }
  .search kbd { display: none; }
  .cat-menu { left: 16px; right: 16px; width: auto; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; }
  .hero-stats { justify-content: flex-start; min-height: 0; }
  .hero-pig { width: 96px; height: 96px; top: -40px; }
  .deal { grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .ph span { font-size: 42px; }
  .badge-pct { top: 6px; left: 6px; font-size: 11px; padding: 4px 7px; }
  .deal-title { font-size: 15px; }
  .deal-desc { display: none; }
  .price { font-size: 19px; }
  .deal-foot { grid-column: 1 / -1; }
  .deal-cta { width: 100%; }
  .deal-cta .btn-go { flex: 1; }
  .detail { grid-template-columns: 1fr; padding: 16px; }
  .detail-media { max-width: 320px; }
  .detail-title { font-size: 21px; }
  .feed-head h1 { font-size: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child, .footer-grid > div:last-child { grid-column: 1 / -1; }
  :root[data-view="grid"] .feed .deals:not(.related) { grid-template-columns: 1fr 1fr; gap: 10px; }
  :root[data-view="grid"] .feed .deals:not(.related) .deal { padding: 10px; }
  :root[data-view="grid"] .feed .deals:not(.related) .temp .deg { min-width: 44px; font-size: 15px; }
  :root[data-view="grid"] .feed .deals:not(.related) .when { display: none; }
}

/* ---------- Admin ---------- */
.admin-badge { font: 800 11px var(--font); text-transform: uppercase; letter-spacing: .08em; background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 6px; }
.admin-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; font-weight: 600; font-size: 14px; }
.admin-nav > a:not(.btn):hover { color: var(--brand); }
.admin-nav form { margin: 0; }
.admin-main { padding-top: 28px; padding-bottom: 60px; display: grid; gap: 18px; }
.admin-main > h1, .form-head h1 { font: 800 28px var(--display); }
.login { max-width: 380px; margin: 10vh auto 0; display: grid; gap: 16px; text-align: center; }
.login img { margin: 0 auto; height: 70px; width: auto; }
.login h1 { font: 800 22px var(--display); }
.login label { text-align: left; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; margin: 0; }
.flash { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font: 800 32px/1.1 var(--display); color: var(--ink); }
.admin-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i { width: 100%; max-width: 28px; min-height: 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 6px 6px 3px 3px; }
.bar span { font-size: 11px; color: var(--muted); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.hbars i { height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--brand), #3fb8c8); width: var(--w); }
.hbars b { text-align: right; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.table-head input { max-width: 260px; height: 38px; }
.table-head .card-title { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td:first-child { min-width: 280px; }
.table td a { font-weight: 700; }
.table td small { display: block; margin-top: 2px; }
.table td form { display: inline; }
.table tr.is-exp td { opacity: .55; }
.warn { color: var(--accent); font-weight: 700; }
.pill { border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.pill.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill.on.red { background: var(--surface-2); color: var(--danger); }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.form-grid .card { display: grid; gap: 16px; }
.row2, .row3 { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.row3 { grid-template-columns: repeat(3, 1fr); }
.calc { margin: -6px 0 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.img-field { display: grid; gap: 8px; }
.lbl { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.img-drop { aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: var(--radius-sm); display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 14px; cursor: pointer; overflow: hidden; background: var(--surface-2); transition: border-color .15s; }
.img-drop:hover, .img-drop.over { border-color: var(--brand); }
.img-drop img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.help ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }
.help p { margin: 0; }
.help code, .table code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.store-row { display: flex; gap: 12px; align-items: flex-end; padding: 14px 16px; flex-wrap: wrap; }
.store-row label { min-width: 150px; }
.store-row .grow { flex: 1; min-width: 280px; }
.store-row input[type=color] { width: 44px; height: 44px; border: 0; background: none; padding: 0; cursor: pointer; }
.store-row .nowrap { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-grid, .form-grid { grid-template-columns: 1fr; }
  .admin-nav { gap: 12px; flex-wrap: wrap; }
}
