/* =========================================================
   Pequeños Genios · Hoja de estilos
   Manual de diseño: "Orden Brillante"
   Paleta y reglas según el manual de diseño de la marca.
   ========================================================= */

:root {
  --blanco: #FFFFFF;
  --nube: #F8FAFC;
  --indigo: #2E3171;
  --indigo-85: #474A8A;
  --pizarra: #334155;
  --amarillo: #FBC046;
  --menta: #95D1B2;
  --coral: #F46A55;
  --coral-oscuro: #9B2C2C;
  --lavanda: #6B6FB3;
  --borde: #E2E8F0;

  --font-titulo: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-cuerpo: "Inter", "Segoe UI", sans-serif;

  --radio: 20px;
  --sombra: 0 10px 25px -5px rgba(46, 49, 113, 0.05);
  --sombra-hover: 0 22px 45px -12px rgba(46, 49, 113, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-cuerpo);
  color: var(--pizarra);
  background-color: var(--nube);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--indigo);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 12px 0;
  z-index: 200;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--borde);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--sombra);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-titulo);
  font-weight: 800;
  font-size: 1.18rem;
  color: var(--indigo);
  letter-spacing: -0.01em;
}
.brand-tagline {
  font-size: 0.78rem;
  color: var(--indigo-85);
  font-weight: 500;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 9999px;
  background: var(--indigo);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn-wa:hover { background: var(--coral); transform: translateY(-1px); }
.wa-icon { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1200px 500px at 12% -20%, #FBC04633, transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, #95D1B266, transparent 55%),
    linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--borde);
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 72px 20px 64px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.hero-title {
  font-family: var(--font-titulo);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.1rem);
  color: var(--indigo);
  margin: 0 0 14px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-accent {
  color: var(--coral);
  position: relative;
  white-space: nowrap;
}
.hero-sub {
  max-width: 620px;
  margin: 0 auto 28px;
  font-size: 1.05rem;
  color: var(--indigo-85);
}
.hero-cta { display: flex; justify-content: center; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 9999px;
  background: var(--indigo);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: var(--sombra);
  font-family: var(--font-titulo);
}
.btn-primary:hover { background: var(--coral); transform: translateY(-2px); box-shadow: var(--sombra-hover); }
.btn-primary .spark { width: 16px; height: 16px; color: var(--amarillo); flex: none; }

/* sparkles decorativos */
.hero-sparks i {
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: var(--x);
  top: var(--y);
  background: var(--c);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
  animation: sparkle 4s ease-in-out infinite;
  animation-delay: var(--d);
  opacity: 0.55;
}
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.45; }
  50% { transform: scale(1.25) rotate(20deg); opacity: 0.85; }
}

/* ---------- Catálogo / toolbar ---------- */
.catalog {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 8px;
}
.search-wrap {
  position: relative;
  max-width: 460px;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--lavanda);
}
.search-input {
  width: 100%;
  padding: 13px 16px 13px 46px;
  border: 1px solid var(--borde);
  border-radius: 9999px;
  font-family: var(--font-cuerpo);
  font-size: 0.98rem;
  color: var(--indigo);
  background: #fff;
  box-shadow: var(--sombra);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(46, 49, 113, 0.08);
}

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  border: 1px solid var(--borde);
  background: #fff;
  color: var(--indigo);
  padding: 8px 15px;
  border-radius: 9999px;
  font-family: var(--font-titulo);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--lavanda); }
.chip.activo {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}
.chip .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

.result-bar { margin: 10px 0 22px; }
.contador { color: var(--indigo-85); font-size: 0.9rem; margin: 0; }
.contador b { color: var(--indigo); font-weight: 700; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.tarjeta {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tarjeta:hover {
  transform: translateY(-5px);
  box-shadow: var(--sombra-hover);
  border-color: #cbd5e1;
}
.tarjeta-imagen {
  position: relative;
  background: var(--nube);
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
}
.tarjeta-imagen img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.tarjeta:hover .tarjeta-imagen img { transform: scale(1.04); }

.tarjeta-etiquetas {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  font-family: var(--font-cuerpo);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}
.pill-logica { background: #FEF3C7; color: var(--indigo); }
.pill-foco { background: #D1FAE5; color: var(--indigo); }
.pill-creatividad { background: #FEE2E2; color: var(--coral-oscuro); }
.pill-lectura { background: #E0E7FF; color: var(--indigo); }

.tarjeta-cuerpo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 18px;
  flex: 1;
}
.tarjeta-precio {
  font-family: var(--font-titulo);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--coral);
  line-height: 1;
}
.tarjeta-precio .simbolo { font-size: 0.85em; margin-right: 1px; }
.tarjeta-titulo {
  font-family: var(--font-titulo);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--indigo);
  line-height: 1.25;
  margin: 0;
}
.tarjeta-desc {
  font-size: 0.86rem;
  color: var(--indigo-85);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tarjeta-cod {
  font-size: 0.7rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
}
.tarjeta-boton {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 9999px;
  background: var(--indigo);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: background 0.16s ease;
}
.tarjeta-boton:hover { background: var(--coral); }
.tarjeta-boton .spark { width: 14px; height: 14px; color: var(--amarillo); flex: none; }

/* ---------- Vacío ---------- */
.vacio {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border: 1px dashed var(--borde);
  border-radius: var(--radio);
  margin-top: 8px;
}
.vacio-icon { font-size: 2.4rem; }
.vacio h3 { font-family: var(--font-titulo); color: var(--indigo); margin: 8px 0 4px; }
.vacio p { color: var(--indigo-85); margin: 0 0 20px; }
.vacio .btn-primary { font-size: 0.9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--borde);
  padding: 40px 20px 24px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-titulo);
  font-weight: 800;
  color: var(--indigo);
  font-size: 1.1rem;
}
.footer-brand img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.footer-note { color: var(--indigo-85); margin: 0; max-width: 420px; font-size: 0.92rem; }
.footer-copy {
  text-align: center;
  color: #94a3b8;
  font-size: 0.8rem;
  margin: 22px 0 0;
}

/* ---------- WhatsApp flotante ---------- */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(37, 211, 102, 0.6);
  transition: transform 0.18s ease;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .btn-wa-header span { display: none; }
  .btn-wa-header { padding: 11px; }
  .hero-inner { padding: 52px 20px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
  .tarjeta-cuerpo { padding: 12px 12px 14px; }
  .tarjeta-titulo { font-size: 0.92rem; }
  .tarjeta-desc { font-size: 0.8rem; }
  .wa-float { width: 52px; height: 52px; right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
