:root {
  --amarillo: #FFC233;
  --amarillo-hundido: #F0AE12;
  --azul: #1F2937;
  --noche: #111827;
  --noche-2: #172033;
  --crema: #FFF9EF;
  --beige: #D9C6B8;
  --texto: #F5F1EA;
  --texto-suave: #B9C0CC;
  --borde: rgba(255, 255, 255, .12);
  --radio: 18px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --titulos: "Fredoka", system-ui, sans-serif;
  --marca: "Titan One", "Fredoka", system-ui, sans-serif; /* la más parecida a la letra del logo */
  --cuerpo: "DM Sans", system-ui, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
}

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

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--noche);
  color: var(--texto);
  font: 400 16px/1.55 var(--cuerpo);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--titulos); line-height: 1.05; letter-spacing: -.005em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }

/* Controles: responden al apoyar el dedo, sin seleccionar texto ni esperar doble toque */
a, button {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 8px; }

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--amarillo); color: var(--azul); padding: 10px 14px; border-radius: 10px; font-weight: 700;
}
.saltar:focus { top: 12px; }

/* ---------- Barra ---------- */
.barra {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter) 10px;
  transition: background-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.barra.con-fondo {
  background: rgba(17, 24, 39, .82);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 1px 0 var(--borde);
}
.barra-logo img { height: 34px; width: auto; }
.barra-ml {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--borde);
  background: rgba(17, 24, 39, .4);
  transition: transform .12s var(--ease-out), background-color .2s;
}
.barra-ml svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.barra-ml:active { transform: scale(.96); }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 96px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.hero-fondo, .hero-fondo img, .hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
/* En el celu la foto ocupa la parte de arriba (el gato queda a la vista) y el texto va debajo */
.hero-fondo, .hero-video { bottom: auto; height: 70%; }
.hero-fondo img { object-position: 50% 22%; }
.hero-video { opacity: 0; transition: opacity .8s var(--ease-out); object-position: 50% 22%; }
.hero-video.lista { opacity: 1; }
.hero-velo {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(17,24,39,.55) 0%, rgba(17,24,39,0) 16%),
    linear-gradient(0deg, var(--noche) 0%, var(--noche) 30%, rgba(17,24,39,.7) 44%, rgba(17,24,39,0) 60%);
}
.hero-texto { width: 100%; max-width: 560px; }
/* Entrada del texto del encabezado: una sola vez por visita, escalonada */
.hero-texto > * { animation: subir .6s var(--ease-out) both; }
.hero-texto > :nth-child(2) { animation-delay: 60ms; }
.hero-texto > :nth-child(3) { animation-delay: 120ms; }
.hero-texto > :nth-child(4) { animation-delay: 180ms; }
.hero-texto > :nth-child(5) { animation-delay: 240ms; }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } }
.hero-fecha {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--azul); background: var(--amarillo);
  padding: 6px 12px; border-radius: 999px;
}
.rayo { display: inline-block; animation: chispa 3.2s infinite; }
@keyframes latido { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 51, .55); } 60% { box-shadow: 0 0 0 10px rgba(255, 194, 51, 0); } }
@keyframes chispa {
  0%, 86%, 100% { opacity: 1; }
  88% { opacity: .2; } 90% { opacity: 1; } 92% { opacity: .35; } 94% { opacity: 1; }
}
/* "Navidad" con Titan One (la más parecida a la letra del logo) y "CATPIC" con el logo de verdad */
.hero h1 {
  margin-top: 16px;
  display: flex; flex-wrap: nowrap; align-items: flex-end; column-gap: .18em;
  font-size: clamp(34px, 10vw, 104px); font-weight: 700; letter-spacing: 0; line-height: .9;
}
.h1-palabra { font-family: var(--marca); font-weight: 400; position: relative; top: -.1em; color: var(--amarillo); text-shadow: 0 0 28px rgba(255, 194, 51, .45); }
.h1-logo {
  height: 1.22em; width: auto; margin-bottom: -.02em;
  filter: drop-shadow(0 0 18px rgba(255, 194, 51, .25));
}
.hero-bajada { margin-top: 12px; font-size: 18px; line-height: 1.4; color: var(--texto); max-width: 30ch; }
.hero-bajada strong { color: var(--amarillo); }

.contador { margin-top: 20px; }
.contador-titulo { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-suave); }
.contador-bloques { display: flex; gap: 8px; margin-top: 8px; }
.contador-bloques div {
  min-width: 64px; padding: 8px 6px 8px; overflow: hidden; text-align: center;
  border-radius: 14px; border: 1px solid rgba(255, 194, 51, .35);
  background: rgba(31, 41, 55, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.contador-bloques b {
  display: block; font: 700 28px/1.15 var(--titulos); color: var(--amarillo);
  font-variant-numeric: tabular-nums;
}
.contador-bloques number-flow { --number-flow-mask-height: .3em; }
.contador-bloques small { display: block; margin-top: 4px; font-size: 11px; color: var(--texto-suave); }
.contador.terminado .contador-bloques { display: none; }

.hero-botones { display: flex; gap: 10px; margin-top: 22px; }
.hero-botones .btn { flex: 1 1 auto; padding: 0 16px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 22px; border-radius: 14px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  transition: transform .14s var(--ease-out), background-color .2s, border-color .2s;
}
.btn:active { transform: scale(.97); }
.btn-amarillo { background: var(--amarillo); color: var(--azul); box-shadow: 0 8px 28px -10px rgba(255, 194, 51, .7); }
.btn-amarillo:active { background: var(--amarillo-hundido); }
.btn-borde { border: 1.5px solid rgba(255, 255, 255, .35); color: var(--texto); background: rgba(17, 24, 39, .35); }
.btn-ancho { display: flex; width: 100%; max-width: 420px; margin: 28px auto 0; }

/* ---------- Pasos ---------- */
.pasos { padding: 28px var(--gutter) 8px; }
.pasos ol {
  list-style: none; margin: 0 auto; padding: 0; max-width: 1080px;
  display: grid; gap: 12px;
}
.pasos li { display: flex; gap: 12px; align-items: flex-start; }
.pasos li span {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--azul); border: 1px solid rgba(255, 194, 51, .5);
  color: var(--amarillo); font: 700 14px/1 var(--titulos);
}
.pasos li p { font-size: 15px; color: var(--texto-suave); padding-top: 3px; }
.pasos li b { color: var(--texto); }

/* ---------- Ofertas ---------- */
.ofertas { padding: 36px var(--gutter) 56px; max-width: 1180px; margin: 0 auto; }
.ofertas-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.ofertas h2 { font-family: var(--marca); font-weight: 400; font-size: clamp(32px, 8vw, 48px); }
.nota-precios { font-size: 13px; color: var(--texto-suave); }

.filtros {
  position: sticky; top: var(--alto-barra, calc(54px + env(safe-area-inset-top, 0px))); z-index: 10;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 16px calc(-1 * var(--gutter)) 18px; padding: 10px var(--gutter);
  background: linear-gradient(var(--noche) 70%, rgba(17,24,39,0));
  overscroll-behavior-x: contain;
}
.filtros::-webkit-scrollbar { display: none; }
/* Pegados arriba, los filtros se suman a la barra: mismo fondo, a todo el ancho y sin la línea entre los dos */
.filtros.pegado {
  background: rgba(17, 24, 39, .94);
  box-shadow: 0 0 0 100vmax rgba(17, 24, 39, .94);
  clip-path: inset(0 -100vmax);
}
.barra.con-filtros { background: rgba(17, 24, 39, .94); box-shadow: none; }
.filtros button {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: 15px; font-weight: 700; color: var(--texto);
  border: 1px solid var(--borde); background: var(--noche-2);
  transition: transform .12s var(--ease-out), background-color .2s, color .2s, border-color .2s;
}
.filtros button:active { transform: scale(.95); }
.filtros button[aria-selected="true"] { background: var(--amarillo); color: var(--azul); border-color: var(--amarillo); }

.grilla {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.tarjeta {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--crema); color: var(--azul);
  border-radius: var(--radio); overflow: hidden; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 18px 40px -24px rgba(0,0,0,.8);
  transition: transform .16s var(--ease-out), box-shadow .25s var(--ease-out);
}
.tarjeta:active { transform: scale(.98); }
.tarjeta-foto { position: relative; aspect-ratio: 1; background: #fff; }
.tarjeta-foto img { width: 100%; height: 100%; object-fit: cover; }
.etiqueta-off {
  position: absolute; right: 8px; top: 8px;
  background: var(--azul); color: var(--amarillo);
  font: 700 13px/1 var(--titulos); padding: 7px 9px; border-radius: 10px;
}
.etiqueta-vendido {
  position: absolute; left: 8px; bottom: 8px;
  background: var(--amarillo); color: var(--azul);
  font-size: 11px; font-weight: 700; padding: 5px 8px; border-radius: 8px;
}
.tarjeta-info { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; flex: 1; }
.tarjeta h3 { font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.tarjeta-detalle { font-size: 13px; line-height: 1.35; color: #5B6472; }
.tarjeta-precios { margin-top: auto; padding-top: 8px; font-variant-numeric: tabular-nums; }
.tarjeta-precios s { display: block; font-size: 13px; color: #7A818C; }
.tarjeta-precios b { font: 700 22px/1.1 var(--titulos); letter-spacing: -.015em; }
.tarjeta-cta {
  margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; border-radius: 12px;
  background: var(--azul); color: #fff; font-size: 14px; font-weight: 700;
  transition: background-color .2s;
}
.tarjeta-cta svg { width: 14px; height: 14px; fill: none; stroke: var(--amarillo); stroke-width: 2.2; }

.tarjeta.destacada .tarjeta-cta { background: var(--amarillo); color: var(--azul); }
.tarjeta.destacada .tarjeta-cta svg { stroke: var(--azul); }

/* Entrada de las tarjetas al aparecer */
@keyframes aparecer { from { opacity: 0; } }
.grilla li { opacity: 0; transform: translateY(14px); transition: opacity .4s var(--ease-out), transform .4s var(--ease-out); }
.grilla li.visible { opacity: 1; transform: none; }
.grilla li[hidden] { display: none; }

/* ---------- Marca ---------- */
.marca { position: relative; margin: 0 auto; max-width: 1180px; padding: 0 var(--gutter) 56px; }
.marca img { width: 100%; height: auto; border-radius: 24px; }
.marca-texto { margin-top: 18px; max-width: 34em; }
.marca h2 { font-family: var(--marca); font-weight: 400; font-size: clamp(28px, 7vw, 44px); color: var(--amarillo); }
.marca p { margin-top: 10px; font-size: 16px; color: var(--texto-suave); }

/* ---------- Pie ---------- */
.pie {
  border-top: 1px solid var(--borde);
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
  text-align: center; color: var(--texto-suave); font-size: 13px;
}
.pie img { height: 40px; width: auto; margin: 0 auto 16px; }
.pie nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.pie nav a { font-size: 15px; font-weight: 700; color: var(--texto); text-decoration: none; padding: 6px 0; }

/* ---------- Pantallas grandes ---------- */
@media (min-width: 640px) {
  .pasos ol { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
}
@media (min-width: 768px) {
  .hero { align-items: center; padding-left: max(48px, 6vw); }
  .hero-fondo, .hero-video { height: 100%; }
  .hero-fondo img, .hero-video { object-position: 70% 50%; }
  .hero-botones .btn { flex: none; padding: 0 22px; }
  .hero h1 { flex-wrap: wrap; }
  .hero-velo {
    background:
      linear-gradient(180deg, rgba(17,24,39,.5) 0%, rgba(17,24,39,0) 18%),
      linear-gradient(90deg, rgba(17,24,39,.92) 0%, rgba(17,24,39,.6) 38%, rgba(17,24,39,0) 62%),
      linear-gradient(0deg, rgba(17,24,39,1) 0%, rgba(17,24,39,0) 22%);
  }
  .barra-logo img { height: 40px; }
  .marca { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; }
  .marca-texto { margin-top: 0; }
}
@media (min-width: 1024px) {
  .grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tarjeta h3 { font-size: 17px; }
}

/* Hover solo con mouse: en el celu no queda pegado */
@media (hover: hover) and (pointer: fine) {
  .tarjeta:hover { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 26px 50px -24px rgba(0,0,0,.9); }
  .tarjeta:hover .tarjeta-cta { background: #2B3A50; }
  .tarjeta.destacada:hover .tarjeta-cta { background: var(--amarillo-hundido); }
  .btn-amarillo:hover { background: var(--amarillo-hundido); }
  .btn-borde:hover { border-color: var(--amarillo); }
  .barra-ml:hover { background: rgba(31, 41, 55, .8); }
  .filtros button:hover:not([aria-selected="true"]) { border-color: rgba(255, 194, 51, .6); }
  .pie nav a:hover { color: var(--amarillo); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rayo { animation: none; }
  .hero-texto > * { animation: aparecer .3s ease both; }
  .grilla li { opacity: 1; transform: none; transition: none; }
  .tarjeta, .btn, .filtros button { transition: none; }
}
.tarjeta-precios b.sin-precio { font: 700 14px/1.3 var(--cuerpo); letter-spacing: 0; }

/* ---------- Fases (las decide el script del <head>) ---------- */
/* Hasta el 24/11: los gatos sacan el arbolito de la caja (con video). Del 25/11 al 3/12: Black Friday, los gatos jugando.
   Desde el 4/12: arbolito armado y contador. */
.fase-armando .solo-navidad, .fase-armando .solo-blackfriday,
.fase-blackfriday .solo-armando, .fase-blackfriday .solo-navidad, .fase-blackfriday .no-blackfriday,
.fase-navidad .solo-armando, .fase-navidad .solo-blackfriday { display: none; }
/* "Black Friday" es más largo que "Navidad": en el celu el logo baja a otro renglón */
.fase-blackfriday .hero h1 { flex-wrap: wrap; row-gap: .12em; }
@media (min-width: 768px) { .fase-blackfriday .h1-palabra { font-size: .74em; white-space: nowrap; } }
