/* ============================================================
   Link Social — Tema Pediátrico / Infantil  v3
   Color de marca: var(--primary) / --primary-dark / --primary-light
   / --primary-soft / rgba(var(--primary-rgb), alpha) — inyectados
   por script.js desde brand.primaryColor.
   Colores decorativos (fondo, nth-child) son fijos del tema.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

/* ── Tokens del tema (decorativos, no cambian con la marca) ──── */
:root {
  /* Paleta pastel decorativa — identidad del tema */
  --p-coral:    #FF7E7E;
  --p-sun:      #FFD166;
  --p-lavender: #A78BFA;
  --p-peach:    #FFB49A;
  --p-teal:     #5BB8E8;

  /* Paleta base — el JS inyecta --primary* */
  --background:       #EFF9F5;
  --foreground:       #18332F;
  --card:             #FFFFFF;
  --muted:            #E4F5EE;
  --secondary:        #DCF0E7;
  --border:           #B8E2CE;
  --muted-foreground: #4A7A6A;

  --radius:    20px;
  --radius-sm: 14px;
  --shadow-sm: 0 2px 10px rgba(30,80,60,.07);
  --shadow-md: 0 6px 20px rgba(30,80,60,.12);
}

[hidden] { display: none !important; }

/* ── Reset base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a  { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; margin: 0; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
i[data-lucide] { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }

/* ── Fondo pastel con burbujas flotantes ──────────────────────── */
/* El fondo lo inyecta JS con el brand hue; los blobs usan --primary-rgb */
.page {
  min-height: 100vh;
  background: var(--background, #EFF9F5); /* fallback; JS lo sobreescribe */
  position: relative;
  overflow: hidden;
}
.page::before,
.page::after {
  content: ''; position: fixed;
  border-radius: 50%; pointer-events: none; z-index: 0;
}
.page::before {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.14) 0%, transparent 70%);
  top: -90px; left: -90px;
  animation: floatA 14s ease-in-out infinite alternate;
}
.page::after {
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(var(--primary-rgb),.10) 0%, transparent 70%);
  bottom: -70px; right: -70px;
  animation: floatB 11s ease-in-out infinite alternate;
}
@keyframes floatA {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(28px,18px) scale(1.07); }
}
@keyframes floatB {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-18px,-22px) scale(1.06); }
}

/* ── Contenedor ───────────────────────────────────────────────── */
.container {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 36px 16px 72px;
  display: flex; flex-direction: column; align-items: center;
}

/* ── Secciones ────────────────────────────────────────────────── */
.block { width: 100%; margin-top: 32px; }
.section-title {
  font-size: .72rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-foreground); margin-bottom: 12px;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding-top: 8px;
}

/* Avatar: anillo animado que usa el color de marca */
.avatar {
  width: 116px; height: 116px;
  border-radius: 50%; overflow: hidden;
  background: var(--muted); flex-shrink: 0;
  box-shadow:
    0 0 0 4px var(--primary),
    0 0 0 9px rgba(var(--primary-rgb), .20),
    0 0 0 15px rgba(var(--primary-rgb), .10);
  animation: avatarPulse 4s ease-in-out infinite;
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block; border-radius: 50%;
}
@keyframes avatarPulse {
  0%,100% {
    box-shadow:
      0 0 0 4px var(--primary),
      0 0 0 9px rgba(var(--primary-rgb),.20),
      0 0 0 15px rgba(var(--primary-rgb),.10);
  }
  50% {
    box-shadow:
      0 0 0 4px var(--primary-light),
      0 0 0 9px rgba(var(--primary-rgb),.28),
      0 0 0 15px rgba(var(--primary-rgb),.08);
  }
}

.hero h1 {
  margin: 10px 0 0; font-size: 1.5rem; font-weight: 900;
  line-height: 1.2; letter-spacing: -.02em; color: var(--foreground);
}

/* Badge de especialidad con el color de marca */
.specialty {
  display: inline-block;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: .75rem; font-weight: 800;
  padding: 5px 18px; border-radius: 99px;
  letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(var(--primary-rgb),.35);
  margin-top: 2px;
}

.tagline {
  margin: 2px 0 0; font-size: .92rem;
  color: var(--muted-foreground); max-width: 300px; font-weight: 600;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pad, .card.pad { padding: 16px 18px; }
.card-button { width: 100%; text-align: left; }

/* Layout fila — usado por el botón CV */
.row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; }

/* ── Icon squares ─────────────────────────────────────────────── */
.icon-square {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--secondary); color: var(--foreground);
}
/* Usa el color de marca */
.icon-square.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.icon-square.soft {
  background: var(--primary-soft);
  color: var(--primary);
  width: 36px; height: 36px; border-radius: 10px;
}

/* ── Links de contacto ────────────────────────────────────────── */
.link-list { display: flex; flex-direction: column; gap: 10px; }

/* Estructura base — sin !important para que el modo bold (inline style) pueda tomar el control */
.link-list a,
.link-list li > button {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
/* Hover subtle — solo para tarjetas sin bold */
.link-list a:not(.bold-card):hover,
.link-list li > button:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--primary-rgb), .50);
  box-shadow: var(--shadow-md);
}
/* Hover bold — mantiene el brillo del color */
.link-list a.bold-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 12px 32px rgba(var(--primary-rgb), .45);
}

.row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-size: .92rem; font-weight: 700; }
.link-list .row-title { color: currentColor; }
.row-sub   {
  font-size: .76rem; color: var(--muted-foreground);
  margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-arrow {
  margin-left: auto; color: var(--muted-foreground);
  font-size: 1rem; font-weight: 700; padding-left: 8px; flex-shrink: 0;
}

/* Colores rotativos DECORATIVOS — solo en modo subtle (:not(.bold-card))
   En bold, el ícono glass lo controla el JS                              */
.link-list li:nth-child(6n+1) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#5ECFA0,#5BB8E8) !important; color:#fff !important; }
.link-list li:nth-child(6n+2) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#FF7E7E,#FFB49A) !important; color:#fff !important; }
.link-list li:nth-child(6n+3) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#A78BFA,#5BB8E8) !important; color:#fff !important; }
.link-list li:nth-child(6n+4) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#FFD166,#FFB49A) !important; color:#fff !important; }
.link-list li:nth-child(6n+5) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#5ECFA0,#A78BFA) !important; color:#fff !important; }
.link-list li:nth-child(6n+0) a:not(.bold-card) .icon-square { background: linear-gradient(135deg,#5BB8E8,#FFD166) !important; color:#fff !important; }

/* Botón Ver Currículum — acento de marca */
#open-cv {
  background: rgba(var(--primary-rgb), .06) !important;
  border: 2px dashed var(--primary) !important;
  opacity: .95;
}
#open-cv:hover {
  background: rgba(var(--primary-rgb), .12) !important;
  border-style: solid !important;
  opacity: 1;
}

.link-list + .card { margin-top: 12px; }

/* ── Horario ──────────────────────────────────────────────────── */
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: .95rem; font-weight: 800; }

.schedule { display: flex; flex-direction: column; }
.schedule li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-top: 1px dashed var(--border); font-size: .85rem;
}
.schedule li:first-child { border-top: none; }
.schedule li span:first-child { font-weight: 700; }

/* ── Mapa / Ubicación ─────────────────────────────────────────── */
.map-card { margin-top: 10px; }
.map-card .card-body { display: flex; gap: 12px; padding: 16px; align-items: flex-start; }
.map-card h3 { margin: 0; font-size: .95rem; font-weight: 800; }
.map-card p  { margin: 4px 0 0; font-size: .82rem; }

/* Enlace "Cómo llegar" con color de marca */
.link-primary {
  display: inline-block; margin-top: 8px;
  font-size: .8rem; font-weight: 700;
  color: var(--primary);
}
.link-primary:hover { text-decoration: underline; }

.map-frame { border-top: 2px solid var(--border); aspect-ratio: 16/9; }
.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ── Servicios ────────────────────────────────────────────────── */
.services-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; list-style: none;
}
.services-grid li {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 14px;
  background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s;
}
.services-grid li:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Colores rotativos DECORATIVOS en servicios (paleta del tema) */
.services-grid li:nth-child(6n+1) .icon-square { background: linear-gradient(135deg,#5ECFA0,#5BB8E8); color:#fff; }
.services-grid li:nth-child(6n+2) .icon-square { background: linear-gradient(135deg,#A78BFA,#5BB8E8); color:#fff; }
.services-grid li:nth-child(6n+3) .icon-square { background: linear-gradient(135deg,#FF7E7E,#FFB49A); color:#fff; }
.services-grid li:nth-child(6n+4) .icon-square { background: linear-gradient(135deg,#FFD166,#5ECFA0); color:#fff; }
.services-grid li:nth-child(6n+5) .icon-square { background: linear-gradient(135deg,#5BB8E8,#A78BFA); color:#fff; }
.services-grid li:nth-child(6n+0) .icon-square { background: linear-gradient(135deg,#FFB49A,#FFD166); color:#fff; }

.svc-title { font-size: .85rem; font-weight: 800; line-height: 1.25; }
.svc-desc  { font-size: .76rem; color: var(--muted-foreground); line-height: 1.4; }

/* ── FAQ ──────────────────────────────────────────────────────── */
.faq-details {
  background: rgba(var(--primary-rgb),.05); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
}
.faq-details[open] { background: var(--card); }

.faq-details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; list-style: none;
  font-size: .75rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.faq-details > summary::-webkit-details-marker { display: none; }
.faq-details[open] > summary .chev { transform: rotate(180deg); }
.chev { transition: transform .22s; }

.faq-body { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }

/* Título de grupo FAQ con color de marca */
.faq-group h3 {
  margin: 0 0 6px; font-size: .75rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary);
}

.faq-item { border-bottom: 1px dashed var(--border); }
.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  list-style: none; cursor: pointer; padding: 11px 0;
  font-size: .88rem; font-weight: 700; color: var(--foreground);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "▾"; color: var(--primary);
  transition: transform .2s; font-size: .8rem; flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(180deg); }

.faq-item .answer {
  padding: 0 0 12px; font-size: .84rem;
  color: var(--muted-foreground); line-height: 1.6;
}

/* ── Carrusel de Videos ───────────────────────────────────────── */
.carousel { position: relative; }
.carousel-viewport { overflow: hidden; border-radius: var(--radius); }
.carousel-track { display: flex; transition: transform .35s cubic-bezier(.4,0,.2,1); }
.carousel-track > li { flex: 0 0 100%; padding: 0 2px; }

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; z-index: 2;
  color: var(--foreground); cursor: pointer; transition: background .15s;
}
.carousel-btn:hover { background: var(--muted); }
.carousel-btn.prev { left: 6px; }
.carousel-btn.next { right: 6px; }

.video-card {
  overflow: hidden; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--card);
  box-shadow: var(--shadow-sm);
}
.video-thumb-link { position: relative; display: block; aspect-ratio: 16/9; overflow: hidden; }
.video-thumb-link img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.video-thumb-link:hover img { transform: scale(1.04); }
.video-play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); transition: background .2s;
}
.video-thumb-link:hover .video-play-overlay { background: rgba(0,0,0,.42); }

/* Botón play con color de marca */
.video-play-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; padding-left: 4px;
  box-shadow: 0 4px 20px rgba(var(--primary-rgb),.45);
  transition: transform .2s;
}
.video-thumb-link:hover .video-play-btn { transform: scale(1.12); }
.video-meta { display: flex; align-items: center; gap: 8px; padding: 12px; font-size: .85rem; font-weight: 700; }
.video-meta .play { color: var(--primary); }

/* ── Promos ───────────────────────────────────────────────────── */
.promo {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--card); border: 2px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.promo .promo-info { flex: 1; min-width: 0; }
.promo .promo-info .t { font-size: .9rem; font-weight: 700; margin: 0; }
.promo .promo-info .d { font-size: .76rem; color: var(--muted-foreground); margin: 2px 0 0; }
.promo .price { text-align: right; flex-shrink: 0; }
.promo .price .now { font-size: .9rem; font-weight: 800; color: var(--primary); margin: 0; }
.promo .price .old { font-size: .76rem; color: var(--muted-foreground); text-decoration: line-through; margin: 0; }

/* ── Modal CV ─────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 400;
  display: none; align-items: flex-end; justify-content: center; padding: 0;
}
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,40,30,.45); backdrop-filter: blur(4px); }
.modal-content {
  position: relative; z-index: 1;
  background: var(--card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(10,40,30,.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--primary-rgb),.3) transparent;
}
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb),.3); border-radius: 99px; }
.modal-close {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  background: rgba(255,255,255,.25); border: none; border-radius: 50%;
  width: 30px; height: 30px; font-size: 1.2rem; line-height: 1;
  cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* Cabecera del CV — gradiente de color de marca */
.cv-header {
  position: relative; overflow: hidden;
  padding: 28px 22px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.cv-blob {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.14); filter: blur(32px);
}
.cv-blob.a { width: 160px; height: 160px; right: -40px; top: -40px; }
.cv-blob.b { width: 120px; height: 120px; left: -30px; bottom: -40px; }

.cv-head-row { position: relative; display: flex; gap: 16px; align-items: flex-start; }
.cv-avatar {
  width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; border: 2px solid rgba(255,255,255,.6);
  box-shadow: 0 4px 14px rgba(0,0,0,.2); background: rgba(255,255,255,.2);
}
.cv-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.cv-header h3 { margin: 0; font-size: 1.15rem; font-weight: 900; letter-spacing: -.02em; }
.cv-sub { margin: 4px 0 0; font-size: .82rem; color: rgba(255,255,255,.88); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips span {
  background: rgba(255,255,255,.22); padding: 3px 10px;
  border-radius: 99px; font-size: .72rem; font-weight: 700;
  border: 1px solid rgba(255,255,255,.3);
}

.cv-body { padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 16px; font-size: .88rem; }
.cv-section { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.cv-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cv-sec-head h4 {
  margin: 0; font-size: .74rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-foreground);
}

/* Timeline con color de marca */
.timeline {
  border-left: 3px solid rgba(var(--primary-rgb),.4);
  padding-left: 16px; display: flex; flex-direction: column; gap: 14px;
}
.timeline li { position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); border: 2px solid var(--card);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.22);
}
.timeline p { margin: 0; }

/* Stats con color de marca */
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 10px; }
.stats > div {
  background: rgba(var(--primary-rgb),.08);
  border: 1px solid rgba(var(--primary-rgb),.18);
  border-radius: 10px; padding: 10px 8px; text-align: center;
}
.stats .big { font-size: 1.2rem; font-weight: 900; margin: 0; color: var(--primary); }
.stats p.muted { margin: 2px 0 0; font-size: .68rem; line-height: 1.2; }

/* Bullets con color de marca */
.bullets { display: flex; flex-direction: column; gap: 6px; color: var(--muted-foreground); }
.bullets li { display: flex; gap: 8px; align-items: flex-start; }
.bullets span { color: var(--primary); flex-shrink: 0; margin-top: 1px; }

/* Pills con color de marca */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills span {
  background: var(--primary-soft);
  border: 1px solid rgba(var(--primary-rgb),.28);
  padding: 4px 12px; border-radius: 99px;
  font-size: .76rem; font-weight: 700; color: var(--foreground);
}

/* ── Utilidades / Footer / Responsive ────────────────────────── */
.footer { width: 100%; margin-top: 40px; text-align: center; font-size: .72rem; color: var(--muted-foreground); font-weight: 600; }
.muted { color: var(--muted-foreground); }
.small { font-size: .8rem; }
.mt    { margin-top: 10px; }

@media (max-width: 400px) {
  .services-grid { grid-template-columns: 1fr; }
  .hero h1       { font-size: 1.3rem; }
  .container     { padding: 28px 12px 60px; }
}
