/* ==========================================================================
   Fisioterapia Pueblo López · Fuengirola
   Hoja de estilos de producción (extraída y ordenada desde borrador.html)
   --------------------------------------------------------------------------
   Índice
   1. Tokens (colores, tipografías, espaciado) + modo oscuro automático
   2. Base y accesibilidad
   3. Cabecera y navegación
   4. Botones
   5. Secciones (hero, tratamientos, nosotros, servicios, por qué, FAQ, contacto)
   6. Formulario de cita
   7. Navegación lateral "columna vertebral"
   8. Pie de página
   9. WhatsApp flotante y barra móvil
   10. Páginas legales y 404
   11. Responsive y prefers-reduced-motion
   ========================================================================== */

/* 1. TOKENS ================================================================ */
:root {
  color-scheme: light dark;

  /* Colores corporativos (borrador) */
  --color-primary: #004067;
  --color-secondary: #015281;
  --color-navy-dark: #0D2B42;
  --color-teal: #52B2CF;
  --color-teal-light: #7CD2EA;

  /* WhatsApp
     --color-whatsapp: verde de marca del borrador (botón flotante, solo icono).
     --color-whatsapp-cta: verde oscurecido para botones con texto blanco, para
     cumplir contraste WCAG AA (el #25D366 con texto blanco da 2:1). */
  --color-whatsapp: #25D366;
  --color-whatsapp-hover: #1EAE53;
  --color-whatsapp-cta: #157F40;
  --color-whatsapp-cta-hover: #106B35;

  /* Tonos cálidos de apoyo */
  --bg-cream: #FAF8F5;
  --bg-sand: #F0ECE1;
  --bg-tint: #F2F6F9;
  --surface: #FFFFFF;          /* tarjetas y secciones blancas */
  --on-primary: #FFFFFF;       /* texto sobre azul / verde */
  --color-accent-warm: #C87D55;      /* números grandes (texto grande, AA ok) */
  --color-accent-warm-text: #985433; /* etiquetas pequeñas: misma familia, AA */

  /* Texto */
  --color-text: #1C252C;
  --color-text-muted: #53626F;
  --color-heading: var(--color-primary);
  --color-heading-strong: var(--color-navy-dark);
  --color-em: var(--color-secondary);

  /* Superficies especiales */
  --header-bg: rgba(250, 248, 245, 0.92);
  --line: rgba(0, 64, 103, 0.08);
  --line-strong: rgba(0, 64, 103, 0.18);
  --field-border: rgba(0, 64, 103, 0.25);
  --frame-border: #FFFFFF;
  --about-bg: var(--color-navy-dark);
  --footer-bg: var(--color-primary);
  --pending-bg: #FFF1C2;
  --pending-text: #5C4300;

  /* Logo (los consumen los símbolos de assets/logo.svg): colores oficiales del logo */
  --logo-primary: #3F4E63;
  --logo-accent: #497A88;
  --logo-soft: 1;

  /* Tipografías (borrador: Fraunces + Roboto) */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Espaciado */
  --sp-xs: 8px;
  --sp-s: 16px;
  --sp-m: 28px;
  --sp-l: 48px;
  --sp-xl: 80px;

  /* Bordes y sombras */
  --radius-s: 8px;
  --radius-m: 16px;
  --radius-l: 28px;
  --radius-arch: 160px 160px 20px 20px;
  --shadow-soft: 0 10px 30px rgba(13, 43, 66, 0.05);
  --shadow-hover: 0 18px 40px rgba(0, 64, 103, 0.12);

  --header-h: 92px;
  --header-h-scrolled: 72px;
}

/* Modo oscuro automático: misma identidad, tonos derivados del azul marino */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-cream: #0E1C27;
    --bg-sand: #12232F;
    --bg-tint: #1A3142;
    --surface: #152735;
    --color-accent-warm: #E0A080;
    --color-accent-warm-text: #E0A080;

    --color-text: #E4ECF2;
    --color-text-muted: #A7B6C2;
    --color-heading: #8FC9E6;
    --color-heading-strong: #EEF4F8;
    --color-em: var(--color-teal-light);

    --header-bg: rgba(14, 28, 39, 0.92);
    --line: rgba(143, 201, 230, 0.12);
    --line-strong: rgba(143, 201, 230, 0.28);
    --field-border: rgba(143, 201, 230, 0.35);
    --frame-border: #1E3546;
    --about-bg: #08141D;
    --footer-bg: #062B45;
    --pending-bg: #5C4300;
    --pending-text: #FFF1C2;

    --logo-primary: #E4EEF4;
    --logo-accent: #8CC8D8;

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.4);
  }
}

/* 2. BASE ================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-scrolled) + 12px);
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--bg-cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 3px;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--sp-m);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  background: var(--color-primary);
  color: var(--on-primary);
  padding: 10px 18px;
  border-radius: var(--radius-s);
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* 3. CABECERA ============================================================== */
.site-header {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-s);
  padding: 16px var(--sp-m);
  max-width: 1180px;
  margin: 0 auto;
  height: var(--header-h);
  transition: height 0.3s ease;
}
.site-header.scrolled .header-inner { height: var(--header-h-scrolled); }

.brand-logo-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo-header .logo-mark {
  height: 70px;
  width: 70px;
  flex-shrink: 0;
  transition: height 0.3s ease, width 0.3s ease;
}
.site-header.scrolled .brand-logo-header .logo-mark {
  height: 58px;
  width: 58px;
}
.brand-logo-header .brand-title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-heading);
  line-height: 1.1;
}
.brand-logo-header .brand-title span {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: var(--color-text-muted);
  font-style: italic;
  font-family: var(--font-display);
}

.main-nav ul {
  display: flex;
  gap: var(--sp-m);
  align-items: center;
}
.main-nav a {
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s ease;
}
.main-nav a:hover,
.main-nav a.active { color: var(--color-heading); }
.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-heading);
  border-radius: 2px;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-s);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--color-heading);
}
.nav-toggle svg { width: 28px; height: 28px; display: block; }

/* 4. BOTONES =============================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 12px 26px;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: var(--on-primary);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 64, 103, 0.2);
}
.btn-whatsapp {
  background: var(--color-whatsapp-cta);
  color: var(--on-primary);
  border-color: var(--color-whatsapp-cta);
}
.btn-whatsapp:hover {
  background: var(--color-whatsapp-cta-hover);
  border-color: var(--color-whatsapp-cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.28);
}
.btn-outline-light {
  background: transparent;
  color: var(--on-primary);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #FFFFFF;
  transform: translateY(-2px);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-header {
  font-size: 16px;
  padding: 14px 32px;
}

/* 5. SECCIONES ============================================================= */

/* Hero (editorial) */
.hero {
  padding: 56px 0;
  position: relative;
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-sand) 100%);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--sp-l);
  align-items: center;
}
.hero-text h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.5vw, 54px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-heading-strong);
  margin-bottom: var(--sp-s);
  letter-spacing: -0.02em;
}
.hero-text h1 em {
  font-style: italic;
  color: var(--color-em);
  font-weight: 400;
}
.hero-text .lead {
  font-size: 19px;
  font-weight: 400;
  color: var(--color-heading);
  margin-bottom: 12px;
  line-height: 1.5;
}
.hero-text .sub {
  font-size: 16px;
  color: var(--color-text-muted);
  margin-bottom: var(--sp-m);
  max-width: 540px;
}
.hero-actions {
  display: flex;
  gap: var(--sp-s);
  flex-wrap: wrap;
}
.hero-image-wrap { position: relative; }
.hero-frame {
  border-radius: 160px 20px 20px 20px; /* arco del borrador en la esquina superior izquierda */
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  border: 8px solid var(--frame-border);
  aspect-ratio: 5 / 4;
  background-color: var(--bg-sand);
}
.hero-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 50%; /* recorta sobre todo el lado derecho de la foto */
}

/* Cabeceras de sección comunes */
.section-header-center {
  text-align: center;
  max-width: 760px;
  margin: 0 auto var(--sp-l);
}
.section-tag {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-accent-warm-text);
  margin-bottom: var(--sp-xs);
  display: block;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--color-heading);
  line-height: 1.2;
  margin-bottom: var(--sp-xs);
}
.section-subtitle {
  font-size: 17px;
  color: var(--color-text-muted);
}
.section-note {
  margin-top: 12px;
  font-size: 15px;
  color: var(--color-text-muted);
}

/* Tratamientos */
.section-treatments {
  padding: var(--sp-xl) 0;
  background-color: var(--surface);
}
.pills-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: var(--sp-m);
}
.pill-item {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-heading);
  background: var(--bg-cream);
  border: 1px solid var(--line-strong);
  padding: 12px 24px;
  border-radius: 50px;
  transition: all 0.25s ease;
}
.pill-item:hover {
  background: var(--color-primary);
  color: var(--on-primary);
  transform: translateY(-2px);
}

/* Sobre nosotros */
.section-about {
  padding: var(--sp-xl) 0;
  background: var(--about-bg);
  color: #FFFFFF;
  position: relative;
}
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--sp-xl);
  align-items: center;
}
.about-media-frame {
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  aspect-ratio: 4 / 5;
  background-color: rgba(255, 255, 255, 0.05);
}
.about-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.about-content .section-tag { color: var(--color-teal-light); }
.about-content h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.8vw, 42px);
  color: #FFFFFF;
  margin-bottom: var(--sp-s);
  line-height: 1.2;
}
.about-content p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--sp-m);
  font-weight: 300;
}
.highlight-banner {
  background: rgba(255, 255, 255, 0.06);
  border-left: 4px solid var(--color-teal);
  padding: 18px 24px;
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--color-teal-light);
}

/* Servicios */
.section-services {
  padding: var(--sp-xl) 0;
  background-color: var(--bg-cream);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: var(--sp-m);
  margin-top: var(--sp-l);
}
.service-card {
  background: var(--surface);
  border-radius: var(--radius-m);
  padding: 32px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--line-strong);
}
.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--bg-tint);
  color: var(--color-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  transition: background 0.3s ease, color 0.3s ease;
}
.service-card:hover .service-icon {
  background: var(--color-primary);
  color: var(--on-primary);
}
.service-icon svg { width: 26px; height: 26px; stroke-width: 1.8; }
.service-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-heading);
  margin-bottom: 12px;
}
.service-card p {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Por qué elegirnos */
.section-why {
  padding: var(--sp-xl) 0;
  background-color: var(--bg-sand);
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-m);
  margin-top: var(--sp-l);
}
.why-item {
  display: flex;
  gap: 20px;
  background: var(--surface);
  padding: 28px;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
}
.why-number {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-accent-warm);
  line-height: 1;
  flex-shrink: 0;
}
.why-item h3 {
  font-size: 18px;
  color: var(--color-heading);
  margin-bottom: 6px;
  font-weight: 700;
}
.why-item p {
  font-size: 14px;
  color: var(--color-text-muted);
}

/* Preguntas frecuentes (acordeón) */
.section-faq {
  padding: var(--sp-xl) 0;
  background-color: var(--bg-cream);
}
.faq-list {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.faq-item[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-hover);
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-s);
  padding: 20px 24px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--color-heading);
  border-radius: var(--radius-m);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--color-heading);
  display: grid;
  place-items: center;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.faq-icon svg { width: 16px; height: 16px; }
.faq-item[open] .faq-icon {
  transform: rotate(45deg);
  background: var(--color-primary);
  color: var(--on-primary);
}
.faq-answer { overflow: hidden; }
.faq-answer p {
  padding: 0 24px 22px;
  font-size: 16px;
  color: var(--color-text-muted);
}
.faq-answer a {
  color: var(--color-heading);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Contacto */
.section-contact {
  padding: var(--sp-xl) 0;
  background-color: var(--surface);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xl);
  align-items: center;
}
.contact-info-box { padding-right: var(--sp-m); }
.contact-info-box h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.5vw, 40px);
  color: var(--color-heading);
  margin-bottom: var(--sp-s);
}
.contact-details { margin: var(--sp-m) 0; }
.contact-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 16px;
}
.contact-row svg {
  width: 22px;
  height: 22px;
  color: var(--color-heading);
  flex-shrink: 0;
  margin-top: 2px;
}
.contact-row a { text-decoration: underline; text-underline-offset: 3px; }
.contact-intro {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.contact-map-frame {
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  height: 400px;
  background: var(--bg-sand);
  position: relative;
}
.contact-map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 6. FORMULARIO DE CITA ===================================================== */
.appointment-form {
  background: var(--bg-cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
  margin-bottom: 8px;
  display: grid;
  gap: 16px;
}
.appointment-form h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--color-heading);
  line-height: 1.2;
}
.form-field { display: grid; gap: 6px; }
.form-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}
.form-field .hint {
  font-size: 13px;
  color: var(--color-text-muted);
}
.form-field input,
.form-field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* evita zoom en iOS */
  color: var(--color-text);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-field textarea { min-height: 96px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(82, 178, 207, 0.25);
}
.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.form-consent input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}
.form-consent a {
  color: var(--color-heading);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.form-legal {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.form-legal a { text-decoration: underline; }
.form-error {
  font-size: 14px;
  font-weight: 700;
  color: #A3261B;
}
.form-error:empty { display: none; }
@media (prefers-color-scheme: dark) {
  .form-error { color: #FF9B8F; }
}

/* 7. NAVEGACIÓN LATERAL "COLUMNA VERTEBRAL" ================================ */
/* Una vértebra por sección; la activa se resalta (scroll-spy en js/main.js).
   Solo en pantallas anchas, donde hay margen fuera del contenido. */
.spine-nav {
  display: none;
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
}
.spine-nav ol {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 40px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.spine-nav li { display: flex; justify-content: center; }
.spine-nav a {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
}
/* La vértebra: se estrecha hacia abajo, como la columna del logo */
.spine-nav a::before {
  content: '';
  width: var(--v-w, 16px);
  height: 9px;
  border-radius: 6px;
  background: var(--color-heading);
  opacity: 0.35;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.spine-nav li:nth-child(1) a { --v-w: 18px; }
.spine-nav li:nth-child(2) a { --v-w: 17px; }
.spine-nav li:nth-child(3) a { --v-w: 16px; }
.spine-nav li:nth-child(4) a { --v-w: 15px; }
.spine-nav li:nth-child(5) a { --v-w: 14px; }
.spine-nav li:nth-child(6) a { --v-w: 12px; }
.spine-nav li:nth-child(7) a { --v-w: 10px; }
.spine-nav a:hover::before,
.spine-nav a:focus-visible::before { opacity: 0.7; }
.spine-nav a.active::before {
  opacity: 1;
  background: var(--color-teal);
  transform: scale(1.25);
}
.spine-label {
  position: absolute;
  right: calc(100% + 14px);
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-primary);
  background: var(--color-primary);
  padding: 5px 12px;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.spine-nav a:hover .spine-label,
.spine-nav a:focus-visible .spine-label {
  opacity: 1;
  transform: translate(0, -50%);
}

/* 8. PIE =================================================================== */
.site-footer {
  background: var(--footer-bg);
  color: #FFFFFF;
  padding: var(--sp-l) 0 var(--sp-m);
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-m);
}
.footer-logo svg {
  height: 132px;
  width: 130px;
  --logo-primary: #FFFFFF;
  --logo-accent: #FFFFFF;
  --logo-soft: 0.85;
}
.footer-desc {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 480px;
}
.footer-legal ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
}
.footer-legal a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  display: inline-block;
  padding: 6px 0;
}
.footer-legal a:hover { color: #FFFFFF; text-decoration-color: #FFFFFF; }
.footer-legal a:focus-visible { outline-color: #FFFFFF; }
.footer-bottom {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: var(--sp-s);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* 9. WHATSAPP FLOTANTE Y BARRA MÓVIL ======================================== */
.whatsapp-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--color-whatsapp);
  color: #FFFFFF;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  z-index: 999;
  transition: transform 0.25s ease, background-color 0.25s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1);
  background-color: var(--color-whatsapp-hover);
}
.whatsapp-float svg { width: 32px; height: 32px; fill: #FFFFFF; }

.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  z-index: 990;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.mobile-sticky-inner { display: flex; gap: 10px; }
.mobile-sticky-inner .btn {
  flex: 1;
  padding: 12px;
  font-size: 14px;
}

/* 10. PÁGINAS LEGALES Y 404 ================================================= */
.page-hero {
  padding: var(--sp-l) 0 var(--sp-m);
  background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-sand) 100%);
  border-bottom: 1px solid var(--line);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-heading-strong);
  letter-spacing: -0.02em;
}
.page-hero p {
  margin-top: 8px;
  color: var(--color-text-muted);
}
.legal-content {
  max-width: 820px;
  padding-top: var(--sp-l);
  padding-bottom: var(--sp-xl);
}
.legal-content h2 {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--color-heading);
  line-height: 1.25;
  margin: var(--sp-l) 0 var(--sp-s);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 18px;
  color: var(--color-heading);
  margin: var(--sp-m) 0 var(--sp-xs);
}
.legal-content p,
.legal-content li { font-size: 16px; margin-bottom: 12px; }
.legal-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.legal-content a {
  color: var(--color-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.legal-content dl {
  display: grid;
  grid-template-columns: minmax(160px, max-content) 1fr;
  gap: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.legal-content dt { font-weight: 700; color: var(--color-heading); }
.legal-content dd { margin: 0; }
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 15px;
  background: var(--surface);
}
.legal-content th,
.legal-content td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  vertical-align: top;
}
.legal-content th { color: var(--color-heading); }
.table-scroll { overflow-x: auto; }
.legal-updated {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: var(--sp-l);
}

/* Marcador de dato pendiente: muy visible a propósito */
.pendiente {
  background: var(--pending-bg);
  color: var(--pending-text);
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.error-page {
  padding: var(--sp-xl) 0;
  text-align: center;
  min-height: 60vh;
  display: grid;
  place-items: center;
}
.error-page .error-code {
  font-family: var(--font-display);
  font-size: clamp(72px, 12vw, 120px);
  font-weight: 600;
  line-height: 1;
  color: var(--color-accent-warm);
}
.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  color: var(--color-heading);
  margin: var(--sp-s) 0 var(--sp-xs);
}
.error-page p {
  color: var(--color-text-muted);
  max-width: 480px;
  margin: 0 auto var(--sp-m);
}
.error-page .hero-actions { justify-content: center; }

/* 11. RESPONSIVE Y MOVIMIENTO REDUCIDO ====================================== */
@media (min-width: 1300px) {
  .spine-nav { display: block; }
}


/* Menú desplegable: se activa antes que el resto del layout móvil para que
   la cabecera nunca parta los enlaces en dos líneas */
@media (max-width: 1240px) {
  .main-nav ul { gap: 20px; }
}

@media (max-width: 1080px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
    padding: var(--sp-s) var(--sp-m);
  }
  .site-header.scrolled .main-nav { top: var(--header-h-scrolled); }
  .main-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s;
  }
  .main-nav ul { flex-direction: column; align-items: flex-start; gap: 4px; }
  .main-nav a { display: block; padding: 10px 0; font-size: 16px; }
  .main-nav a.active::after { bottom: 4px; }
  .nav-toggle { display: block; }
}
@media (max-width: 900px) {
  .hero-grid, .about-grid, .why-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-l);
  }
  .why-grid { grid-template-columns: 1fr; }
  .contact-info-box { padding-right: 0; }

  .mobile-sticky-bar { display: block; }
  .whatsapp-float { display: none; } /* Único acceso directo en móvil: barra inferior */
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }

}

@media (max-width: 560px) {
  .container, .header-inner { padding-left: 16px; padding-right: 16px; }
  .header-inner { gap: 8px; }
  .header-cta { gap: 8px; }
  .header-cta .btn { padding: 11px 18px; font-size: 15px; }
  .brand-logo-header { gap: 8px; }
  .brand-logo-header .logo-mark { height: 56px; width: 56px; }
  .site-header.scrolled .brand-logo-header .logo-mark { height: 48px; width: 48px; }
  .brand-logo-header .brand-title { font-size: 18px; }
  .brand-logo-header .brand-title span { font-size: 14px; }
  .service-card { padding: 24px; }
  .why-item { padding: 22px; }
  .appointment-form { padding: 18px; }
  .legal-content dl { grid-template-columns: 1fr; gap: 2px; }
  .legal-content dd { margin-bottom: 10px; }
  .hero-frame { border-width: 6px; border-radius: 100px 16px 16px 16px; }
}

@media (max-width: 400px) {
  .brand-logo-header .brand-title { font-size: 16px; }
  .brand-logo-header .brand-title span { font-size: 13px; }
  .header-cta .btn { padding: 10px 14px; font-size: 14px; }
}

@media (max-width: 330px) {
  .brand-logo-header .brand-title { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
