/* =====================================================================
   Dr. Carlos Javier Elizondo Granillo — Cirujano de Pie y Tobillo
   styles.css · Sistema de diseño "Editorial Clínico / Light"

   ► Marca y paleta (manual de identidad Fetén): ver :root más abajo.
     El azul marino #16203F es el color dominante; el verde #7DC242 es
     únicamente acento. Para cambiar la marca en el futuro, edita SOLO
     las variables de :root.
   ===================================================================== */

:root {
  /* ---- Colores de marca (peso visual según manual) ---- */
  --color-primary: #16203F;         /* azul marino — dominante 60% */
  --color-primary-light: #0D3865;   /* azul profundo — 15% */
  --color-primary-lighter: #215378; /* azul medio — 15% */
  --color-accent: #7DC242;          /* verde — acento 5% */
  --color-accent-light: #D9FCDB;    /* verde menta muy claro — 5% */

  /* ---- Derivados de uso ---- */
  --paper: #FAF8F5;                 /* fondo cálido alterno */
  --white: #ffffff;
  --text: #1a2338;                  /* texto principal (navy suave) */
  --text-muted: #5b6685;            /* texto secundario */
  --line: rgba(22, 32, 63, 0.12);   /* bordes finos */
  --line-strong: rgba(22, 32, 63, 0.22);

  /* ---- Tipografía ---- */
  --font: "Kantumruy Pro", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Ritmo y radios ---- */
  --container: 1200px;
  --gap: clamp(1.5rem, 4vw, 3.5rem);
  --section-py: clamp(4rem, 9vw, 8rem);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;

  /* ---- Sombras ---- */
  --shadow-sm: 0 2px 10px rgba(22, 32, 63, 0.06);
  --shadow-md: 0 18px 44px rgba(22, 32, 63, 0.12);
  --shadow-lg: 0 30px 80px rgba(13, 56, 101, 0.20);

  /* ---- Movimiento ---- */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 76px;
}

/* =====================================================================
   RESET
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
  scroll-padding-top: calc(var(--header-h) + 12px);
}
body {
  font-family: var(--font);
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { line-height: 1.1; font-weight: 500; letter-spacing: -0.01em; }
strong { font-weight: 600; }
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =====================================================================
   UTILIDADES
   ===================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}
.section { padding-block: var(--section-py); }

.skip-link {
  position: fixed;
  top: -60px;
  left: 12px;
  z-index: 200;
  background: var(--color-primary);
  color: var(--white);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0 10px 10px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0; }

/* ---- Kicker (etiqueta superior, eco del logo) ---- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: clamp(0.72rem, 1.4vw, 0.82rem);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-primary-lighter);
  margin-bottom: 1.1rem;
}
.kicker::before {
  content: "";
  width: 30px;
  height: 2px;
  background: var(--color-accent);
  display: inline-block;
}

/* ---- Títulos de sección ---- */
.section-title {
  font-size: clamp(1.9rem, 4.6vw, 3.15rem);
  color: var(--color-primary);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
  max-width: 20ch;
}
.section-head { max-width: 760px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .kicker { justify-content: center; }
.section-intro {
  margin-top: 1.4rem;
  font-size: clamp(1.02rem, 1.9vw, 1.18rem);
  color: var(--text-muted);
  max-width: 62ch;
}

/* =====================================================================
   BOTONES
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
              background-color 0.3s var(--ease), color 0.3s var(--ease);
  will-change: transform;
}
.btn-ico { flex: none; }
.btn-primary {
  background: var(--color-primary);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(22, 32, 63, 0.22);
}
.btn-primary:hover {
  background: var(--color-primary-light);
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(13, 56, 101, 0.32);
}
.btn-primary:active { transform: translateY(-1px); }

.btn-nav {
  padding: 0.62rem 1.25rem;
  background: var(--color-primary);
  color: var(--white);
  font-size: 0.92rem;
  box-shadow: none;
}
.btn-nav:hover { background: var(--color-accent); color: var(--color-primary); transform: translateY(-2px); }

/* =====================================================================
   HEADER / NAV
   ===================================================================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
              border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--header-h);
}
.nav-logo img {
  height: 46px;
  width: auto;
  transition: height 0.3s var(--ease);
}
.site-header.is-scrolled .nav-logo img { height: 42px; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.6vw, 2.4rem);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2.1rem);
}
.nav-list a {
  position: relative;
  font-size: 0.98rem;
  font-weight: 400;
  color: var(--color-primary);
  padding: 0.3rem 0;
  transition: color 0.25s var(--ease);
}
.nav-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-list a:hover { color: var(--color-primary-lighter); }
.nav-list a:hover::after,
.nav-list a.is-active::after { transform: scaleX(1); }

/* Hamburguesa */
.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================================
   REVEAL (animaciones de entrada — defensivas)
   Sin JS o con "reduced motion": el contenido queda SIEMPRE visible.
   ===================================================================== */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }
html.js .reveal[data-reveal-delay="1"] { transition-delay: 0.09s; }
html.js .reveal[data-reveal-delay="2"] { transition-delay: 0.18s; }
html.js .reveal[data-reveal-delay="3"] { transition-delay: 0.27s; }
html.js .reveal[data-reveal-delay="4"] { transition-delay: 0.36s; }
/* Defensa: un elemento con reveal + data-split nunca queda invisible */
html.js .reveal[data-split] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
}

/* =====================================================================
   A. HERO
   ===================================================================== */
.hero {
  position: relative;
  padding-top: calc(var(--header-h) + clamp(2rem, 6vw, 5rem));
  padding-bottom: clamp(3rem, 7vw, 6rem);
  background:
    radial-gradient(120% 90% at 92% 8%, var(--color-accent-light) 0%, transparent 42%),
    linear-gradient(180deg, var(--paper) 0%, var(--white) 60%);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.hero-title {
  font-size: clamp(2.5rem, 6.4vw, 4.7rem);
  font-weight: 500;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}
.hero-subtitle {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 400;
  color: var(--color-primary-lighter);
  margin-bottom: 0.55rem;
}
.hero-descriptor {
  font-size: clamp(0.95rem, 1.7vw, 1.05rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 42ch;
}
.hero-location {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.1rem;
  font-size: 0.98rem;
  color: var(--color-primary);
  font-weight: 400;
}
.hero-location .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(125, 194, 66, 0.22);
  flex: none;
}
.hero-cta { margin-top: 1.9rem; }
.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.8rem;
  margin-top: 2.4rem;
  padding-top: 1.9rem;
  border-top: 1px solid var(--line);
}
.hero-meta li {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.4;
}
.hero-meta li span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.hero-meta a { color: var(--color-primary-lighter); font-weight: 500; }
.hero-meta a:hover { color: var(--color-accent); }

/* Figura del hero */
.hero-figure { display: flex; justify-content: center; }
.hero-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
}
.hero-frame picture,
.hero-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.hero-frame::before {
  /* Marco de acento sutil detrás de la foto */
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0.5;
}
.hero-badge {
  position: absolute;
  left: -22px;
  bottom: 30px;
  width: 92px;
  height: 92px;
  background: var(--white);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
}
.hero-badge img { width: 66px; height: 66px; }

/* =====================================================================
   B. SOBRE MÍ
   ===================================================================== */
.sobre { background: var(--white); }
.sobre-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.sobre-figure { position: sticky; top: calc(var(--header-h) + 24px); }
.sobre-figure picture,
.sobre-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.prose p { margin-top: 1.1rem; color: var(--text); font-size: clamp(1rem, 1.7vw, 1.08rem); }
.prose p:first-child { margin-top: 0; }
.prose strong { color: var(--color-primary); }

/* Timeline de formación */
.formacion { margin-top: 2.8rem; padding-top: 2.4rem; border-top: 1px solid var(--line); }
.formacion-title {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 300;
  color: var(--color-primary-lighter);
  margin-bottom: 1.6rem;
}
.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}
.timeline-item {
  position: relative;
  padding: 1.05rem 0 1.05rem 1.6rem;
  border-left: 1.5px solid var(--line);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 1.35rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--color-accent);
}
.timeline-item--wide { grid-column: 1 / -1; }
.timeline-role {
  display: block;
  font-weight: 500;
  color: var(--color-primary);
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}
.timeline-place { display: block; color: var(--text-muted); font-size: 0.9rem; }

/* =====================================================================
   C. PADECIMIENTOS
   ===================================================================== */
.padecimientos { background: var(--paper); }
.cond-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.25rem);
}
.cond-card {
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 20px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.7rem;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease),
              border-color 0.4s var(--ease);
  overflow: hidden;
}
.cond-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary-lighter));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.cond-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.cond-card:hover::after { transform: scaleX(1); }
.cond-num {
  display: block;
  font-size: 0.82rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 0.8rem;
}
.cond-title {
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.cond-text { font-size: 0.92rem; color: var(--text-muted); line-height: 1.55; }

.padecimientos-cta {
  margin-top: clamp(2.4rem, 4vw, 3.4rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.padecimientos-cta p { color: var(--text); font-size: 1.05rem; }

/* =====================================================================
   D. CONTÁCTAME
   ===================================================================== */
.contacto { background: var(--white); }
.contacto-quote {
  font-size: clamp(1.6rem, 4vw, 2.9rem);
  font-weight: 300;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-wrap: balance;
}
.contacto-quote em {
  font-style: normal;
  font-weight: 500;
  color: var(--color-primary-lighter);
  position: relative;
}
.contacto-quote em::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0.05em;
  width: 100%; height: 0.16em;
  background: var(--color-accent);
  opacity: 0.4;
  z-index: -1;
}

/* Carrusel */
.carousel {
  position: relative;
  margin-top: clamp(2rem, 4vw, 3rem);
}
.carousel-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.carousel-track {
  display: flex;
  transition: transform 0.6s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .carousel-track { transition: none; }
}
.carousel-slide { flex: 0 0 100%; min-width: 0; }
.carousel-slide img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.carousel-btn:hover { background: var(--color-primary); color: var(--white); }
.carousel-prev { left: clamp(0.6rem, 2vw, 1.4rem); }
.carousel-next { right: clamp(0.6rem, 2vw, 1.4rem); }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.3rem;
}
.carousel-dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.carousel-dots button.is-active {
  background: var(--color-accent);
  transform: scale(1.35);
}

/* Bloque contacto + mapa */
.contacto-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.6rem, 4vw, 3rem);
  margin-top: clamp(3rem, 6vw, 5rem);
  align-items: stretch;
}
.contacto-info {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  padding: clamp(1.8rem, 3.5vw, 2.8rem);
  display: flex;
  flex-direction: column;
}
.contacto-info-title {
  color: var(--white);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  margin-bottom: 1.6rem;
}
.contacto-list { display: grid; gap: 1.25rem; margin-bottom: 2rem; }
.contacto-list li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  font-size: 0.98rem;
  line-height: 1.45;
}
.contacto-list svg { flex: none; color: var(--color-accent); margin-top: 2px; }
.contacto-list strong { color: var(--white); }
.contacto-list a { color: var(--white); border-bottom: 1px solid rgba(125, 194, 66, 0.5); }
.contacto-list a:hover { color: var(--color-accent); }
.contacto-info .btn-primary {
  margin-top: auto;
  background: var(--color-accent);
  color: var(--color-primary);
}
.contacto-info .btn-primary:hover { background: var(--white); }

.contacto-map {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 340px;
}
.contacto-map iframe { width: 100%; height: 100%; min-height: 340px; }

/* Reseñas (widget Wally) */
.resenas { margin-top: clamp(3rem, 6vw, 5rem); }
.resenas-title {
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--color-primary);
  margin-bottom: 2rem;
}
.resenas-widget {
  min-height: 460px; /* reserva espacio: evita layout shift al cargar */
  width: 100%;
}

/* =====================================================================
   FOOTER
   ===================================================================== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255, 255, 255, 0.72);
  padding-top: clamp(3.5rem, 6vw, 5.5rem);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: clamp(1.6rem, 3vw, 2.5rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-brand img { height: 40px; width: auto; margin-bottom: 1rem; }
.footer-tagline { font-size: 0.9rem; font-weight: 300; max-width: 24ch; }
.footer-col h4 {
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 400;
  margin-bottom: 1rem;
}
.footer-col p { font-size: 0.92rem; line-height: 1.6; }
.footer-col a { border-bottom: 1px solid transparent; transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.footer-col a:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }

.footer-social { display: flex; gap: 0.7rem; }
.footer-social a {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease), color 0.25s var(--ease);
}
.footer-social a:hover {
  background: var(--color-accent);
  color: var(--color-primary);
  transform: translateY(-3px);
  border-bottom: 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 1.6rem 2rem;
  font-size: 0.85rem;
}
.footer-links { display: flex; align-items: center; gap: 0.7rem; }
.footer-links a { color: rgba(255, 255, 255, 0.9); }
.footer-links a:hover { color: var(--color-accent); }
.footer-sep { opacity: 0.5; }
.footer-credit { color: rgba(255, 255, 255, 0.5); }

/* =====================================================================
   PÁGINA LEGAL (privacidad)
   ===================================================================== */
.legal {
  padding-top: calc(var(--header-h) + clamp(2.5rem, 6vw, 4.5rem));
  padding-bottom: clamp(3.5rem, 7vw, 6rem);
  background: linear-gradient(180deg, var(--paper), var(--white) 40%);
}
.legal-inner { max-width: 780px; }
.legal-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--color-primary);
  margin: 0.6rem 0 1.8rem;
}
.legal p { color: var(--text); margin-bottom: 1.1rem; }
.legal h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.55rem);
  color: var(--color-primary);
  margin: 2.4rem 0 0.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.legal strong { color: var(--color-primary); }
.legal-back { margin-top: 2.6rem; }
.legal-back a {
  color: var(--color-primary-lighter);
  font-weight: 500;
  border-bottom: 1px solid var(--color-accent);
}
.legal-back a:hover { color: var(--color-accent); }

/* =====================================================================
   WHATSAPP FLOTANTE
   ===================================================================== */
.wa-float {
  position: fixed;
  right: clamp(1rem, 3vw, 1.9rem);
  bottom: clamp(1rem, 3vw, 1.9rem);
  z-index: 90;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25D366;
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  animation: waPulse 2.8s ease-in-out infinite;
}
.wa-float:hover { transform: scale(1.08); box-shadow: 0 16px 38px rgba(37, 211, 102, 0.55); }
@keyframes waPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.4); }
  50% { box-shadow: 0 12px 30px rgba(37, 211, 102, 0.45), 0 0 0 14px rgba(37, 211, 102, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float { animation: none; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .cond-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --header-h: 68px; }

  /* Nav móvil */
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 0.5rem 1.25rem 1.5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), visibility 0.3s var(--ease);
  }
  .nav-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list li { border-bottom: 1px solid var(--line); }
  .nav-list a { display: block; padding: 1rem 0.3rem; font-size: 1.05rem; }
  .nav-list a::after { display: none; }
  .btn-nav { margin-top: 1.2rem; width: 100%; padding: 0.9rem; font-size: 1rem; }

  /* Hero apilado */
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-figure { order: -1; }
  .hero-frame { max-width: 360px; }
  .hero-frame::before { inset: 12px -12px -12px 12px; }

  /* Sobre mí apilado */
  .sobre-grid { grid-template-columns: 1fr; }
  .sobre-figure { position: static; max-width: 440px; }

  /* Contacto apilado */
  .contacto-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cond-grid { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: 1fr; gap: 0.8rem; }
  .timeline { grid-template-columns: 1fr; }
  .carousel-slide img { aspect-ratio: 4 / 3; }
  .carousel-btn { width: 44px; height: 44px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .footer-grid { grid-template-columns: 1fr; }
}
