/* MishIA: estilos mobile-first (360 px), se amplía con min-width. */

:root {
  /* Marca MishIA */
  --marca: #007E8B;          /* turquesa: botones y títulos destacados */
  --marca-texto: #ffffff;
  --acento: #FF005A;         /* magenta: detalles pequeños */
  --noche: #142540;          /* azul marino de la marca */
  --lima: #4E9A00;           /* verde para datos positivos (texto) */

  /* Base */
  --fondo: #F4F8FA;
  --superficie: #ffffff;
  --texto: #142540;
  --texto-suave: #4A5A6B;
  --borde: #DCE5EC;

  --radio: 14px;
  --sombra: 0 1px 2px rgb(0 0 0 / 6%), 0 8px 24px rgb(0 0 0 / 6%);
  --ancho: 68rem;
  --gutter: 1rem;
  --fuente: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --marca: #2CC0CE;
    --marca-texto: #0B1A2C;
    --acento: #FF4D88;
    --noche: #0B1A2C;
    --lima: #8EE33A;
    --fondo: #0E1A2C;
    --superficie: #152640;
    --texto: #EEF4F8;
    --texto-suave: #A9B9CA;
    --borde: #2A4062;
    --sombra: none;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1.0625rem;      /* 17 px: nunca menos de 16 px */
  line-height: 1.6;
  overflow-wrap: break-word;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* espacio para la barra de WhatsApp */
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--marca); text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 5vw, 2.25rem); letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.contenedor {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.saltar {
  position: absolute; left: -999px; top: 0;
  background: var(--marca); color: var(--marca-texto); padding: .75rem 1rem; z-index: 20;
}
.saltar:focus { left: 1rem; }

:focus-visible { outline: 3px solid var(--acento); outline-offset: 3px; }

/* ---------- Botones (44 px mínimo) ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.25rem;
  border-radius: 999px; border: 2px solid var(--marca);
  background: var(--marca); color: var(--marca-texto);
  font: inherit; font-weight: 700; text-decoration: none;
  touch-action: manipulation;
  transition: transform 140ms cubic-bezier(.2, .8, .2, 1);
}
.boton:active { transform: scale(.97); }
.boton--borde { background: transparent; color: var(--marca); }
.boton svg { width: 22px; height: 22px; flex: none; }

/* ---------- Encabezado ---------- */
.encabezado {
  background: var(--superficie);
  border-bottom: 1px solid var(--borde);
}
.encabezado .contenedor {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 64px;
}
.marca {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 44px; color: var(--texto); text-decoration: none; font-weight: 800; font-size: 1.1rem;
}
.marca img { width: 36px; height: 36px; }
.menu { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.menu a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .75rem;
  color: var(--texto); text-decoration: none; font-weight: 600; border-radius: 8px;
}
.menu .solo-grande { display: none; }
.menu a[aria-current="page"] { color: var(--marca); text-decoration: underline; }

/* ---------- Marca en el encabezado ---------- */
.marca img { border-radius: 50%; }
.marca span b { color: var(--acento); font-weight: 800; }

/* ---------- Portada ---------- */
.portada { padding: 3rem 0 2.5rem; }
.portada p.bajada { font-size: 1.15rem; color: var(--texto-suave); max-width: 38rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.datos-rapidos {
  display: grid; gap: .5rem; margin: 2rem 0 0; padding: 0; list-style: none; color: var(--texto-suave);
}
.datos-rapidos li { display: flex; gap: .5rem; align-items: baseline; }
.datos-rapidos strong { color: var(--texto); }

/* ---------- Secciones ---------- */
.seccion { padding: 2.5rem 0; }
.seccion--alterna { background: var(--superficie); border-block: 1px solid var(--borde); }
.seccion .intro { color: var(--texto-suave); max-width: 40rem; }

.tarjetas { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.25rem; box-shadow: var(--sombra);
}
.seccion--alterna .tarjeta { background: var(--fondo); }
.tarjeta .precio { font-weight: 700; color: var(--marca); margin: 0; }

.pasos { counter-reset: paso; display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.pasos li { counter-increment: paso; display: grid; grid-template-columns: 2.5rem 1fr; gap: .75rem; align-items: start; }
.pasos li::before {
  content: counter(paso);
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--marca); color: var(--marca-texto); font-weight: 800;
}

.horario { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: 0; }
.horario dt { font-weight: 700; }
.horario dd { margin: 0; color: var(--texto-suave); }

/* ---------- Preguntas frecuentes (sin JS) ---------- */
.preguntas { display: grid; gap: .5rem; margin-top: 1.5rem; }
.preguntas details { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); }
.preguntas summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 56px; padding: .75rem 1rem; cursor: pointer; font-weight: 700; list-style: none;
}
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--marca); }
.preguntas details[open] summary::after { content: "\2212"; }
.preguntas details p { padding: 0 1rem 1rem; margin: 0; color: var(--texto-suave); }

/* ---------- MishIA: portada con imagen ---------- */
.portada .rejilla { display: grid; gap: 2rem; align-items: center; }
.portada .foto-mishia { width: 100%; max-width: 26rem; margin-inline: auto; border-radius: 50%; aspect-ratio: 1; object-fit: cover; box-shadow: 0 0 0 10px color-mix(in srgb, var(--marca) 22%, transparent); }
.etiqueta { display: inline-block; margin-bottom: 1rem; padding: .3rem .8rem; border-radius: 999px; background: color-mix(in srgb, var(--marca) 14%, transparent); color: var(--marca); font-weight: 700; font-size: 1rem; }

/* ---------- Cifras del problema ---------- */
.problema { position: relative; color: #ffffff; background: var(--noche); overflow: hidden; }
.problema .fondo-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .32; }
.problema .contenedor { position: relative; }
.problema h2 { color: #ffffff; }
.problema .intro { color: #D5E0EA; }
.cifras { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.cifra { background: rgb(11 26 44 / 72%); border: 1px solid rgb(255 255 255 / 14%); border-radius: var(--radio); padding: 1.25rem; }
.cifra strong { display: block; font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; color: #ffffff; }
.cifra span { display: block; margin-top: .35rem; color: #D5E0EA; }
.cifra small { display: block; margin-top: .5rem; color: #A9B9CA; font-size: 1rem; }
.problema .fuente { color: #A9B9CA; font-size: 1rem; margin-top: 1.25rem; }

/* ---------- Agentes ---------- */
.agente { border-top: 6px solid var(--marca); }
.agente--registro { border-top-color: var(--acento); }
.agente--adopcion { border-top-color: #E86F00; }
.agente--voluntariado { border-top-color: #5FB800; }
.agente .quien { color: var(--texto-suave); font-size: 1rem; margin: 0; }
.regla { margin-top: 1.5rem; padding: 1rem 1.25rem; border-radius: var(--radio); background: color-mix(in srgb, var(--marca) 12%, transparent); font-weight: 700; }

/* ---------- Para quién ---------- */
.para-quien .tarjeta h3 { color: var(--marca); }
.para-quien .tarjeta p:last-child { margin-bottom: 0; }

/* ---------- Voluntariado con foto ---------- */
.con-foto { display: grid; gap: 2rem; align-items: center; }
.con-foto img { width: 100%; max-width: 24rem; margin-inline: auto; border-radius: var(--radio); }
.nota { color: var(--texto-suave); font-size: 1rem; margin-top: 1rem; }

/* ---------- Equipo ---------- */
.equipo { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.equipo li { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.25rem; }
.seccion--alterna .equipo li { background: var(--fondo); }
.equipo strong { display: block; }
.equipo span { color: var(--texto-suave); }

/* ---------- Llamado final ---------- */
.cierre { text-align: center; padding: 3rem 0; }
.cierre .acciones { justify-content: center; }

/* ---------- Contacto ---------- */
.canales { display: grid; gap: 1rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.canal { display: grid; gap: .5rem; }
.canal .boton { width: 100%; }

/* ---------- Pie ---------- */
.pie { padding: 2rem 0; border-top: 1px solid var(--borde); color: var(--texto-suave); font-size: 1rem; }
.pie .contenedor { display: grid; gap: 1rem; }
.pie nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; list-style: none; }
.pie a { display: inline-flex; align-items: center; min-height: 44px; color: var(--texto-suave); }

/* ---------- Barra fija de WhatsApp (solo celular) ---------- */
.barra-whatsapp {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  padding: .75rem max(var(--gutter), env(safe-area-inset-left)) calc(.75rem + env(safe-area-inset-bottom));
  background: var(--superficie); border-top: 1px solid var(--borde);
}
.barra-whatsapp .boton { width: 100%; }

/* ---------- Movimiento sutil (se apaga si la persona lo pide) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .portada .contenedor > * { animation: aparecer 520ms cubic-bezier(.2, .8, .2, 1) both; }
  .portada .contenedor > *:nth-child(2) { animation-delay: 60ms; }
  .portada .contenedor > *:nth-child(3) { animation-delay: 120ms; }
  .portada .contenedor > *:nth-child(4) { animation-delay: 180ms; }
  .portada .contenedor > *:nth-child(5) { animation-delay: 240ms; }
}
@keyframes aparecer {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .boton { transition: none; }
}

/* ---------- Pantallas más grandes ---------- */
@media (min-width: 640px) {
  .tarjetas { grid-template-columns: repeat(2, 1fr); }
  .canales { grid-template-columns: repeat(2, 1fr); }
  .cifras { grid-template-columns: repeat(3, 1fr); }
  .menu .solo-grande { display: list-item; }
  .equipo { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .portada .rejilla { grid-template-columns: 1.15fr 1fr; }
  .con-foto { grid-template-columns: 1fr 1.2fr; }
  .barra-whatsapp { display: none; }
  .portada { padding: 5rem 0 4rem; }
  .seccion { padding: 4rem 0; }
  .pie .contenedor { grid-template-columns: 1fr auto; align-items: center; }
}

@media (min-width: 1024px) {
  .tarjetas { grid-template-columns: repeat(3, 1fr); }
  .tarjetas--4 { grid-template-columns: repeat(4, 1fr); }
  .pasos { grid-template-columns: repeat(3, 1fr); }
  .pasos li { grid-template-columns: 1fr; }
}

/* Pasos dentro de la sección con foto: siempre en una columna */
@media (min-width: 1024px) {
  .con-foto .pasos { grid-template-columns: 1fr; }
  .con-foto .pasos li { grid-template-columns: 2.5rem 1fr; }
}
