/* === Kids Kingdom — Theme V2 (unified backgrounds) === */

/* ---- Global doodle background pattern (UNIQUE — sin duplicados por sección) ---- */
body {
  background-color: var(--kk-cream);
  background-image: url("../images/pattern-medieval.svg");
  background-size: 380px 380px;
  background-attachment: fixed;
  position: relative;
}

/* Cream wash uniform sobre el patrón */
body::before {
  content: "";
  position: fixed; inset: 0;
  background: rgba(251, 247, 240, 0.82);
  pointer-events: none;
  z-index: 0;
}

/* Lower ambient blobs */
.ambient .ab { opacity: 0.12; }
body > * { position: relative; z-index: 1; }
.ambient { z-index: 0 !important; }

/* ---- WAVE DIVIDERS ---- */
.wave-divider {
  position: relative;
  width: 100%;
  height: 90px;
  margin: 0;
  pointer-events: none;
}
.wave-divider svg { display: block; width: 100%; height: 100%; }
.wave-divider.flip svg { transform: scaleY(-1); }

/* Wave colors — usadas como divisores suaves, NO como fondos de sección */
.wave-divider.to-paper  svg path { fill: rgba(184, 134, 11, 0.10); }
.wave-divider.to-cream  svg path { fill: rgba(251, 247, 240, 0.6); }
.wave-divider.to-purple svg path { fill: rgba(75, 69, 145, 0.10); }
.wave-divider.to-green  svg path { fill: rgba(95, 176, 106, 0.12); }
.wave-divider.to-gold   svg path { fill: rgba(184, 134, 11, 0.10); }
.wave-divider.to-ink    svg path { fill: var(--kk-ink); }
.wave-layer-1 { opacity: 0.4; }
.wave-layer-2 { opacity: 0.7; }

/* ---- TINTS — TOTALMENTE TRANSPARENTES (solo dan ritmo con gradiente sutil) ---- */
/* IMPORTANT: NO pattern overlay aquí — el patrón es solo del body */
.tint-paper,
.tint-green,
.tint-purple {
  background: transparent;
  position: relative;
}

/* (Removed all ::before pattern overlays — they caused the duplicate doodle issue) */

/* ---- BIG MASKED DECORATIVE SHAPES per section ---- */
.deco-mask {
  position: absolute;
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
}
.deco-mask svg {
  width: 100%; height: 100%;
  display: block;
}
.deco-mask.left  { left: -40px;  top: 30%; transform: translateY(-50%); }
.deco-mask.right { right: -40px; top: 50%; transform: translateY(-50%); }
.deco-mask.tl    { left: -60px;  top: -40px; }
.deco-mask.br    { right: -60px; bottom: -40px; }

/* ---- MODELO — TRANSPARENTE, sin caja ni patrón propio ---- */
.modelo {
  background: transparent !important;
  padding: 30px 0 !important;
  border-radius: 0 !important;
  position: relative;
  overflow: visible;
}
.modelo::before { display: none !important; }
.modelo > * { position: relative; z-index: 2; }

/* Modelo header & header background pill */
.modelo-header .kk-eyebrow { background: white; }

/* Modelo tabs panel — slightly elevated card */
.tab-panel {
  background: white;
  box-shadow: 0 18px 40px -22px rgba(75, 69, 145, 0.18);
}

/* Pilares: hover lift más sutil */

/* ============================================================
   EDADES — V2 LAYOUT (Grupos del Reino)
   ============================================================ */
.edades-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; flex-wrap: wrap;
  margin-bottom: 36px;
}

.grupos-wrap { position: relative; padding: 30px 0 10px; margin-top: 28px; }

.grupos-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  position: relative; z-index: 2;
}
@media (max-width: 1100px) { .grupos-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .grupos-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .grupos-grid { grid-template-columns: 1fr; max-width: 320px; margin: 0 auto; } }

.grupo {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 24px 16px 28px;
  position: relative;
  transition: transform 0.35s cubic-bezier(.5,1.5,.5,1);
}
.grupo:hover { transform: translateY(-6px); }

.grupo-illo { width: 110px; height: 110px; display: grid; place-items: center; position: relative; margin-bottom: 14px; transition: transform 0.4s ease; }
.grupo:hover .grupo-illo { transform: rotate(-4deg) scale(1.06); }
.grupo-illo .bg-blob { position: absolute; inset: 0; background: var(--c); opacity: 0.18; border-radius: 50%; transform: scale(0.9); transition: transform 0.4s ease, opacity 0.3s ease; }
.grupo:hover .grupo-illo .bg-blob { transform: scale(1.1); opacity: 0.28; }
.grupo-illo svg { position: relative; z-index: 1; color: var(--c); }

.grupo-name { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; letter-spacing: -0.01em; color: var(--c); margin: 6px 0 4px; text-transform: uppercase; }
.grupo-name small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 800; color: var(--c); opacity: 0.7; letter-spacing: 0.12em; margin-bottom: 6px; }

.grupo-age { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--kk-ink); margin: 4px 0 10px; }
.grupo-desc { color: var(--kk-gray); font-size: 14px; line-height: 1.55; margin: 0 0 22px; flex: 1; max-width: 24ch; }

.grupo-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--c); color: white; padding: 12px 22px; border-radius: 999px; font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; transition: transform 0.2s ease, box-shadow 0.2s ease; box-shadow: 0 12px 22px -10px var(--c); }
.grupo-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -12px var(--c); }
.grupo-btn .arr { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.25); display: grid; place-items: center; }

.grupos-squiggle { display: block; margin: 0 auto 28px; color: var(--kk-green); }

/* Big deco sizes */
.deco-mask.crown   { width: 380px; height: 380px; }
.deco-mask.scroll  { width: 360px; height: 240px; }
.deco-mask.sword   { width: 200px; height: 480px; }
.deco-mask.shield  { width: 320px; height: 360px; }
.deco-mask.tower   { width: 220px; height: 380px; }
.deco-mask.pennant { width: 320px; height: 160px; }
.deco-mask.key     { width: 320px; height: 90px; }

@media (max-width: 800px) { .deco-mask { display: none; } }

.deco-soft {
  -webkit-mask-image: radial-gradient(ellipse, black 30%, transparent 75%);
          mask-image: radial-gradient(ellipse, black 30%, transparent 75%);
}

/* Footer keeps its dark background but with single subtle pattern */
.footer { background: var(--kk-ink); position: relative; overflow: hidden; }
.footer::after { display: none !important; }
.footer .pattern-light {
  position: absolute; inset: 0;
  background-image: url("../images/pattern-medieval.svg");
  background-size: 360px 360px;
  opacity: 0.05;
  filter: invert(1);
  pointer-events: none;
}
.footer > * { position: relative; z-index: 2; }

/* Testimonios — wrap clean, sin patrón duplicado */
.testi-wrap {
  background: white;
  box-shadow: 0 20px 50px -25px rgba(75, 69, 145, 0.25);
}
.testi-wrap::after { display: none !important; }

/* Section-stage utility: just relative positioning */
.section-stage {
  position: relative;
  overflow: visible;
}
.section-stage > .deco-mask { z-index: 0; }
.section-stage > .kk-section { position: relative; z-index: 2; }

/* Pilares hover */
.pilar { background: white; }
