/* CV Medical Care — estilos
   Paleta: crema, verde salvia, coral. Todos los pares de texto cumplen WCAG AA. */

:root {
  --cream: #faf6ef;
  --cream-2: #f1eadd;
  --sage: #2f5d50;
  --sage-dark: #1f3f36;
  --sage-soft: #dbe7e1;
  --coral: #b4472f;
  --coral-dark: #923823;
  --wa: #1f7a4d;
  --ink: #1d2623;
  --muted: #4c5a55;
  --white: #ffffff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 63, 54, 0.12);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--sage); text-underline-offset: 3px; }
a:hover { color: var(--sage-dark); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; color: var(--sage-dark); margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
h2.h3-size { font-size: 1.3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

.container { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.section { padding: clamp(64px, 10vw, 112px) 0; }
.section--alt { background: var(--cream-2); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); margin-bottom: .75em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--sage-dark); color: var(--white); padding: 10px 16px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* Marcador de dato pendiente */
.confirmar {
  background: #fff1a8;
  color: #3d3200;
  border: 1.5px dashed #9a7d00;
  border-radius: 6px;
  padding: 0 .35em;
  font-weight: 600;
  font-family: var(--sans);
  font-size: .92em;
  letter-spacing: 0;
}

/* ===== Franja de propuesta — QUITAR AL APROBAR =====
   Para ocultarla en todo el sitio sin borrar HTML, descomente la línea siguiente:
   .proposal-banner { display: none; } */
.proposal-banner {
  background: var(--ink);
  color: #fff8e6;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  padding: 8px 16px;
}

/* Barra de progreso */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--coral);
  transform-origin: 0 50%; transform: scaleX(0);
  z-index: 60;
}

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, .94);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(47, 93, 80, .12);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--sage-dark); font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo .confirmar { font-size: .62rem; }
.nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; align-items: center; }
.nav a { display: block; padding: 8px 12px; text-decoration: none; color: var(--ink); font-weight: 500; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--sage-soft); color: var(--sage-dark); }
.nav-toggle { display: none; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px; font-weight: 600; text-decoration: none;
  border: 2px solid transparent; cursor: pointer; font-size: 1rem; line-height: 1.2;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--coral); color: var(--white); }
.btn--primary:hover { background: var(--coral-dark); color: var(--white); }
.btn--ghost { border-color: var(--sage); color: var(--sage-dark); background: transparent; }
.btn--ghost:hover { background: var(--sage); color: var(--white); }
.btn--wa { background: var(--wa); color: var(--white); }
.btn--wa:hover { background: #17603c; color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 9vw, 104px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.hero .lead { margin-bottom: 1.6em; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 420px; justify-self: center; width: 100%; }
.hero-art::before {
  content: ""; position: absolute; inset: 6%;
  background: radial-gradient(circle at 40% 35%, var(--sage-soft), transparent 70%);
  border-radius: 50%;
}
.paw { position: relative; width: 100%; height: 100%; }
.paw .stroke { fill: var(--sage); fill-opacity: .14; stroke: var(--sage); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Dibujo de la huella al cargar (solo si hay JS y se permite movimiento) */
.motion .paw .stroke {
  stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0;
  animation: draw 1.4s cubic-bezier(.6,.1,.3,1) var(--d, 0s) forwards, fillIn .8s ease calc(var(--d, 0s) + 1.2s) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { fill-opacity: .14; } }

/* Aparición al hacer scroll (solo con JS y movimiento permitido) */
.motion .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.motion .reveal.is-visible { opacity: 1; transform: none; }
.motion .card-scale { opacity: 0; transform: scale(.96); transition: opacity .6s ease, transform .6s ease; }
.motion .card-scale.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* Tarjetas de servicios */
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--white); border-radius: var(--radius); padding: 28px;
  box-shadow: 0 1px 0 rgba(31,63,54,.06); border: 1px solid rgba(47,93,80,.1);
}
.card .icon { width: 48px; height: 48px; border-radius: 14px; background: var(--sage-soft); display: grid; place-items: center; margin-bottom: 16px; }
.card .icon svg { width: 26px; height: 26px; stroke: var(--sage); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card p { color: var(--muted); margin: 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-foot { margin-top: 36px; }

/* Contadores */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; text-align: center; }
.stat { padding: 24px 12px; }
.stat-num { font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.2rem); color: var(--sage); font-weight: 600; line-height: 1; display: block; margin-bottom: 8px; }
.stat-num .confirmar { font-size: .9rem; vertical-align: middle; }
.stat-label { color: var(--muted); font-weight: 500; }

/* Equipo */
.team-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  border: 1px solid rgba(47,93,80,.1);
  transition: transform .25s ease, box-shadow .25s ease;
}
.team-card:hover, .team-card:focus-within { transform: translateY(-6px); box-shadow: var(--shadow); }
.team-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--sage-soft); }
.team-body { padding: 22px 24px 26px; }
.team-body h3 { margin-bottom: .2em; }
.team-role { color: var(--coral); font-weight: 600; font-size: .95rem; margin-bottom: .6em; }
.team-bio { color: var(--muted); margin: 0; }

/* Bloques de servicios (servicios.html) */
.service-block { display: grid; grid-template-columns: 64px 1fr; gap: 20px; padding: 32px 0; border-top: 1px solid rgba(47,93,80,.15); }
.service-block:first-child { border-top: 0; }
.service-block .icon { width: 64px; height: 64px; border-radius: 18px; background: var(--sage-soft); display: grid; place-items: center; }
.service-block .icon svg { width: 32px; height: 32px; stroke: var(--sage); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service-block p { color: var(--muted); max-width: 62ch; }

/* Llamada a la acción */
.cta { background: var(--sage-dark); color: #eef4f1; border-radius: 28px; padding: clamp(36px, 6vw, 64px); display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.cta h2 { color: var(--white); }
.cta p { color: #d6e3dd; margin: 0; }
.cta .btn-row { justify-content: flex-end; }
.cta .btn--ghost { border-color: #d6e3dd; color: var(--white); }
.cta .btn--ghost:hover { background: var(--white); color: var(--sage-dark); }

/* Encabezado de páginas internas */
.page-hero { padding: clamp(48px, 8vw, 88px) 0 clamp(24px, 4vw, 40px); }

/* Contacto */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: start; }
.contact-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 18px; }
.contact-list li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.contact-list .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--sage-soft); display: grid; place-items: center; }
.contact-list .icon svg { width: 22px; height: 22px; stroke: var(--sage); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-list strong { display: block; color: var(--sage-dark); }
.hours { width: 100%; border-collapse: collapse; margin-top: 4px; }
.hours th, .hours td { text-align: left; padding: 6px 0; border-bottom: 1px solid rgba(47,93,80,.12); font-weight: 400; }
.hours th { font-weight: 600; padding-right: 16px; }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(47,93,80,.15); background: var(--sage-soft); }
.map iframe { width: 100%; height: 420px; border: 0; display: block; }
.map-note { font-size: .9rem; color: var(--muted); padding: 12px 16px; margin: 0; background: var(--white); }

/* Pie */
.site-footer { background: var(--ink); color: #d8dfdc; padding: 56px 0 28px; margin-top: 0; }
.site-footer a { color: #f3f7f5; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.site-footer h2 { font-size: 1.1rem; color: var(--white); font-family: var(--sans); font-weight: 700; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-logo { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; font-size: .9rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 16px; bottom: 16px; z-index: 55;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--wa); color: var(--white); text-decoration: none; font-weight: 600;
  padding: 12px 18px 12px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.wa-float:hover { background: #17603c; color: var(--white); }
.wa-float svg { width: 24px; height: 24px; fill: currentColor; }

/* 404 */
.notfound { text-align: center; padding: 120px 0; }
.notfound .paw { width: 120px; height: 120px; margin: 0 auto 24px; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-grid, .cta, .contact-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 260px; order: -1; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .cta .btn-row { justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; background: transparent;
    border: 2px solid var(--sage); color: var(--sage-dark); border-radius: 999px;
    padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid rgba(47,93,80,.15); display: none; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .nav a { padding: 12px 14px; }
}
@media (max-width: 600px) {
  .logo { font-size: 1.05rem; gap: 8px; }
  .logo span { white-space: nowrap; }
  .logo .confirmar { font-size: .55rem; line-height: 1.2; }
  .hero-art { max-width: 160px; }
  .hero-grid { gap: 24px; }
  .grid--3, .grid--2, .stats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .service-block { grid-template-columns: 1fr; gap: 12px; }
  .btn-row .btn { width: 100%; }
  .wa-float .wa-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wa-float { padding: 14px; }
  .map iframe { height: 320px; }
}

/* ===== Logo en dos líneas ===== */
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text small { font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--coral); }

/* ===== Animación nueva 1: latido (electrocardiograma) bajo la huella ===== */
.hero-art { display: flex; flex-direction: column; align-items: center; aspect-ratio: auto; }
.hero-art .paw { width: 100%; height: auto; aspect-ratio: 1; }
.hero-art::before { inset: 0 6% 48px; }
.ecg { position: relative; width: 82%; height: 48px; margin-top: -6px; }
.ecg path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ecg-base { stroke: var(--sage); stroke-width: 2; opacity: .18; }
.ecg-line { stroke: var(--coral); stroke-width: 3; }
.motion .ecg-line { stroke-dasharray: .28 1; stroke-dashoffset: 1.28; animation: ecg 2.4s linear 1.6s infinite; }
@keyframes ecg { to { stroke-dashoffset: 0; } }

/* Huella flotando suavemente tras dibujarse */
.motion .hero-art .paw { animation: float 6s ease-in-out 2.2s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===== Animación nueva 2: pulso del botón de WhatsApp ===== */
.wa-float::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid var(--wa); pointer-events: none; opacity: 0;
}
.motion .wa-float::before { animation: pulse 2.6s ease-out 3s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }

/* ===== Animación nueva 3: tarjetas en cascada ===== */
.motion .reveal, .motion .card-scale { transition-delay: calc(var(--stagger, 0) * 110ms); }

/* ===== Animación nueva 4: rastro de huellas en la llamada a la acción ===== */
.cta { position: relative; overflow: hidden; }
.cta > :not(.paw-trail) { position: relative; z-index: 1; }
.paw-trail { position: absolute; right: 4%; bottom: 10px; display: flex; gap: 14px; align-items: flex-end; pointer-events: none; }
.paw-trail svg { width: 30px; height: 30px; fill: #ffffff; opacity: .16; transform: rotate(80deg); }
.paw-trail svg:nth-child(even) { margin-bottom: 18px; }
.motion .paw-trail svg { opacity: 0; transform: rotate(80deg) scale(.6); transition: opacity .4s ease, transform .4s ease; transition-delay: calc(.6s + var(--i) * .28s); }
.motion .cta.is-visible .paw-trail svg { opacity: .16; transform: rotate(80deg) scale(1); }
@media (max-width: 600px) { .paw-trail { right: 8px; gap: 8px; } .paw-trail svg { width: 22px; height: 22px; } }

/* Movimiento reducido: sin animaciones ni transiciones */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .card-scale { opacity: 1 !important; transform: none !important; }
  .paw .stroke { stroke-dashoffset: 0 !important; fill-opacity: .14 !important; }
  .team-card:hover, .team-card:focus-within, .btn:hover { transform: none; }
  .progress { display: none; }
}
