/* PrecioTirao. Radius rule: cards 16px, image tiles 12px, controls 10px, chips and discount pills full. */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --fg: #18181b;
  --muted: #5f5f66;
  --line: #e4e4e7;
  --accent: #e8590c;
  --accent-ink: #c2410c;
  --accent-hover: #9a3412;
  --accent-soft: #fff1e6;
  --pct-fg: #9a3412;
  --link: #c2410c;
  --sk: #ececee;
  --shadow: 0 1px 2px rgb(24 24 27 / .04), 0 8px 24px -12px rgb(24 24 27 / .12);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --surface: #1a1a1d;
    --fg: #f2f2f0;
    --muted: #a1a1aa;
    --line: #2c2c31;
    --accent-soft: rgb(232 89 12 / .16);
    --pct-fg: #fdba74;
    --link: #fb923c;
    --sk: #26262a;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 16px/1.6 "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: none;
  background: currentColor;
  mask: var(--i) center / contain no-repeat;
  -webkit-mask: var(--i) center / contain no-repeat;
}
.i-tg { --i: url("/icons/telegram-logo.svg"); }
.i-search { --i: url("/icons/magnifying-glass.svg"); }
.i-out { --i: url("/icons/arrow-up-right.svg"); }
.i-next { --i: url("/icons/arrow-right.svg"); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header and footer span the page; their content lines up with the 1200px column. */
header, footer { padding-inline: max(20px, calc((100% - 1200px) / 2)); }

header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
header .logo { display: block; width: 180px; height: auto; }
header nav { display: flex; align-items: center; gap: 22px; white-space: nowrap; }
header nav a { color: var(--muted); text-decoration: none; font-size: .94rem; font-weight: 500; }
header nav a:hover { color: var(--fg); }
header nav a.tg-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  transition: border-color .2s var(--ease);
}
header nav a.tg-link:hover { border-color: var(--accent); }
header nav a.tg-link .ico { color: #229ed9; }

main { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 20px 64px; flex: 1; }
main.wide { max-width: 1240px; }

h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; font-weight: 750; margin: 56px 0 14px; }
h2 { font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.2; margin: 48px 0 12px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 58ch; margin: 0; }
main:not(.wide) p, main:not(.wide) li { max-width: 65ch; }

/* Catalogue controls */
.toolbar { display: flex; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.search { position: relative; flex: 1 1 280px; }
.search .ico { position: absolute; left: 13px; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.toolbar input, .toolbar select {
  font: inherit;
  font-size: .95rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  height: 44px;
}
.toolbar input { width: 100%; padding: 0 14px 0 40px; }
.toolbar input::placeholder { color: var(--muted); }
.toolbar input:focus, .toolbar select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.toolbar select { padding: 0 12px; cursor: pointer; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.chip:hover { border-color: var(--muted); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }
.chip.active { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip.active .n { color: inherit; opacity: .7; }

.status { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 0; color: var(--muted); font-size: .88rem; }
.status p { margin: 0; }

/* Deal grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 14px 0 8px; }

.deal {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: box-shadow .3s var(--ease), translate .3s var(--ease);
}
.deal:hover { box-shadow: var(--shadow); translate: 0 -2px; }

.deal .media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.deal .media img { width: 100%; height: 100%; object-fit: contain; }
.deal .noimg { color: #5f5f66; font-size: .9rem; }

.deal .body { display: flex; flex-direction: column; gap: 6px; padding: 14px 4px 0; flex: 1; }
.deal .meta { margin: 0; color: var(--muted); font-size: .82rem; }
.deal h3 {
  font-size: 1.02rem; line-height: 1.35; letter-spacing: -.01em; font-weight: 600; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deal .desc {
  margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.prices { margin-top: auto; padding-top: 12px; }
.prices .lbl { display: block; color: var(--muted); font-size: .78rem; }
.prices .now { display: flex; align-items: center; gap: 10px; }
.prices .now strong { font-size: 1.6rem; letter-spacing: -.03em; font-weight: 750; font-variant-numeric: tabular-nums; }
.prices .pct {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--pct-fg);
  font-weight: 700;
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}
.prices .before { margin: 2px 0 0; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.prices .before s { margin-right: 8px; }
.prices .save { color: var(--fg); font-weight: 600; }
.prices .ask { margin: 0; color: var(--muted); font-size: .92rem; }
.deal .ref { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--accent-ink);
  color: #fff;
  font-weight: 650;
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s var(--ease), transform .1s var(--ease);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px) scale(.99); }

/* Loading skeleton, replaced by the first render */
.deal.sk { pointer-events: none; }
.sk .media, .sk i { background: var(--sk); }
.sk i { display: block; height: 12px; border-radius: 6px; margin-top: 10px; }
.sk i.w1 { width: 40%; } .sk i.w2 { width: 90%; } .sk i.w3 { width: 55%; height: 22px; margin-top: 18px; } .sk i.w4 { height: 44px; border-radius: 10px; margin-top: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .sk .media, .sk i { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 50% { opacity: .55; } }
}

.empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}
.empty strong { display: block; color: var(--fg); font-size: 1.1rem; margin-bottom: 4px; }
.empty button {
  font: inherit; font-weight: 600; margin-top: 14px; padding: 8px 16px; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg);
}

/* Guides */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 16px 0 28px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color .2s var(--ease);
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.08rem; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.card .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--link); font-weight: 600; font-size: .9rem; }

.note { color: var(--muted); font-size: .9rem; margin: 0; }

footer {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  color: var(--muted);
  font-size: .86rem;
}
footer p { margin: 0; }

@media (max-width: 640px) {
  header { height: 56px; }
  header .logo { width: 148px; }
  header nav { gap: 14px; }
  header nav .wide-only { display: none; }
  h1 { margin-top: 36px; }
  .toolbar { margin-top: 28px; }
  .sort { flex: 1 1 100%; }
  .toolbar select { flex: 1; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: -20px; padding: 0 20px 4px; scrollbar-width: none; }
  .chip { scroll-snap-align: start; }
  .grid { grid-template-columns: 1fr; }
}

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

/* ---------- Effects layer ---------- */
.i-down { --i: url("/icons/arrow-down.svg"); }
.i-fire { --i: url("/icons/fire.svg"); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
#catalogo { scroll-margin-top: 72px; }

/* Header gains depth as the page scrolls (CSS scroll-driven, no JS) */
@supports (animation-timeline: scroll()) {
  header { animation: hdr linear both; animation-timeline: scroll(); animation-range: 0 140px; }
  @keyframes hdr { to { box-shadow: 0 8px 30px -18px rgb(0 0 0 / .35); } }
}

/* Hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 48px;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: 0;
  top: 0;
  width: 55%;
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgb(232 89 12 / .16), transparent);
  filter: blur(20px);
  pointer-events: none;
}
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1; letter-spacing: -.045em; margin: 0 0 18px; }
.hero .hl { display: inline-block; color: var(--accent); }
.hero .lead { font-size: 1.2rem; }
.hero-cta { display: inline-flex; margin-top: 28px; padding: 0 22px; height: 50px; font-size: 1rem; }
.hero-cta .ico { transition: translate .3s var(--ease); }
.hero-cta:hover .ico { translate: 0 3px; }

.stats { display: flex; gap: 36px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--muted); font-size: .85rem; }
.stats dd { margin: 0; font-size: 2rem; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }

/* Featured deal */
.featured { perspective: 1000px; }
.feat {
  --rx: 0deg; --ry: 0deg;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 30px 60px -30px rgb(24 24 27 / .35), 0 0 0 1px rgb(232 89 12 / .06);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s var(--ease);
}
.feat .media { aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 18px; background: #fff; border-radius: 16px; overflow: hidden; }
.feat .media img { width: 100%; height: 100%; object-fit: contain; transform: translateZ(30px); }
.feat .info { padding: 18px 8px 6px; display: flex; flex-direction: column; gap: 6px; }
.feat .tag { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--accent); font-weight: 650; font-size: .9rem; }
.feat h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat .meta { margin: 0; color: var(--muted); font-size: .88rem; }
.drop { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.drop .old { position: relative; color: var(--muted); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.drop .old::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; background: var(--accent); transform-origin: left; }
.drop .new { font-size: 2.6rem; font-weight: 800; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.drop .pct { font-size: 1rem; }

/* Discounts of 60 % or more are the real price errors: solid pill */
.pct.hot { background: var(--accent-ink); color: #fff; }

/* Ticker of the biggest discounts (the page's only marquee) */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface);
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker .track { display: flex; width: max-content; }
.tk {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; white-space: nowrap;
  color: var(--fg); text-decoration: none; font-size: .92rem;
}
.tk b { color: var(--accent); font-variant-numeric: tabular-nums; }
.tk span { color: var(--muted); }
.tk:hover { color: var(--accent); }

/* Cursor-following border light on deal cards */
.deal { position: relative; isolation: isolate; }
.deal::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .3s var(--ease);
  pointer-events: none;
}
.deal:hover::before { opacity: 1; }
.deal .media img { transition: scale .6s var(--ease); }
.deal:hover .media img { scale: 1.05; }
.btn .i-out { transition: translate .3s var(--ease); }
.btn:hover .i-out { translate: 2px -2px; }
.deal .meta .ago { white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  .hero .hl { animation: fall .9s cubic-bezier(.34, 1.56, .64, 1) .2s both; }
  @keyframes fall { from { transform: translateY(-70%) rotate(-8deg); opacity: 0; } }
  .hero-copy > :not(h1) { animation: up .8s var(--ease) both; }
  .hero-copy > .lead { animation-delay: .1s; }
  .hero-copy > .hero-cta { animation-delay: .2s; }
  .hero-copy > .stats { animation-delay: .3s; }
  @keyframes up { from { opacity: 0; transform: translateY(14px); } }

  .featured.play .feat { animation: rise 1s var(--ease) .15s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(30px) rotateX(8deg); } }
  .featured.play .old::after { animation: strike .5s var(--ease) .9s both; }
  @keyframes strike { from { transform: scaleX(0); } }
  .featured.play .new { animation: drop .8s cubic-bezier(.34, 1.56, .64, 1) 1.2s both; }
  @keyframes drop { from { opacity: 0; transform: translateY(-36px) scale(.9); } }
  .featured.play .pct { animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) 1.5s both; }
  @keyframes pop { from { opacity: 0; transform: scale(.4); } }

  .ticker .track { animation: slide var(--dur, 60s) linear infinite; }
  .ticker:hover .track { animation-play-state: paused; }
  @keyframes slide { to { transform: translateX(-50%); } }

  .deal.pre { opacity: 0; transform: translateY(18px); }
  .deal.in { opacity: 1; transform: none; transition: opacity .7s var(--ease) var(--d, 0s), transform .7s var(--ease) var(--d, 0s), box-shadow .3s var(--ease), translate .3s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker .track > [aria-hidden] { display: none; }
}

::view-transition-group(*) { animation-duration: .45s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding: 36px 0 32px; }
  .stats { gap: 24px; }
  .stats dd { font-size: 1.6rem; }
}
@media (max-width: 640px) {
  .hero-cta { width: 100%; justify-content: center; }
  .drop .new { font-size: 2.1rem; }
}
