/* ================================================================
   patologia.css — Stylesheet compartido para TODAS las páginas de
   patologías / enfermedades.

   Cada página define en un <style> inline SOLO:
     :root { --primary; --primary-dark; --primary-weak; --primary-rgb;
             + card accent vars (--accent1, --accent1-border, …) }
     .card.X  (clases de acento por página)
     body background-image gradient  (radial con color de página)

   Todo lo demás es compartido aquí.
   ================================================================ */

/* ---------- COMMON VARS ---------- */
:root {
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #fafaf9;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 12px 28px rgba(0,0,0,.10);
  --orange: #ea580c;
  --orange-dark: #c2410c;
  --green: #22c55e;
  --slate: #334155;
  --blue: #2563eb;
  --blue-weak: #eff6ff;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}
a { color: inherit; text-decoration: none }
img { max-width: 100%; display: block }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px }

/* ---------- MOTION & HOVER ---------- */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), .28) }
  70%  { box-shadow: 0 0 0 14px rgba(var(--primary-rgb), 0) }
  100% { box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0) }
}
@media (prefers-reduced-motion: no-preference) {
  body * {
    transition: transform .22s ease, color .22s ease, background-color .22s ease,
                border-color .22s ease, box-shadow .22s ease, opacity .22s ease;
    transform-origin: center;
  }
}
.card:hover        { transform: translateY(-4px) scale(1.01); box-shadow: 0 16px 34px rgba(0,0,0,.14) }
.btn:hover         { transform: translateY(-2px) scale(1.03); filter: saturate(120%) }
.cta-nav:hover,
.nav-links a:hover { transform: translateY(-3px) scale(1.02); background: var(--primary-weak); color: var(--primary) }
.btn.primary:hover { animation: pulse 1.05s ease-out }
.tab:hover,
.faq summary:hover,
.stat:hover        { box-shadow: var(--shadow); border-color: rgba(var(--primary-rgb), .18) }

/* ---------- SKIP LINK ---------- */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  padding: .5rem 1rem; background: var(--primary); color: #fff;
  z-index: 999; border-radius: 0 0 8px 0; font-weight: 800;
}
.skip-link:focus { left: 0; top: 0 }

/* ---------- PROGRESS BAR ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  z-index: 90;
}

/* ---------- NAV / TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 80;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 0; gap: 16px;
}
.brand { display: flex; align-items: center; gap: .6rem }
.brand .logo-wrap {
  width: 160px; height: 160px; border-radius: 24px; overflow: hidden;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
}
.brand img { width: 100%; height: 100%; object-fit: contain }
.nav-links { display: flex; gap: .25rem; flex-wrap: wrap }
.nav-links a {
  padding: .5rem .75rem; border-radius: 10px;
  font-weight: 700; color: var(--muted);
}
.nav-links a.active { background: var(--primary-weak); color: var(--primary) }
.menu-btn {
  display: none;
  border: 1px solid var(--border); background: #fff;
  color: var(--text); padding: .5rem .65rem; border-radius: 10px;
}
.cta-nav {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem .95rem; border-radius: 12px; font-weight: 800;
  border: 0; cursor: pointer;
  background: linear-gradient(90deg, var(--orange), #fb923c);
  color: #fff; box-shadow: 0 14px 28px rgba(234,88,12,.22);
  white-space: nowrap;
}
.cta-nav:hover { background: linear-gradient(90deg, var(--orange-dark), #fb923c); color: #fff }

/* Mobile panel */
.panel { border-top: 1px solid var(--border); padding: 10px 0 14px }
.panel a {
  display: block; padding: .7rem .6rem; border-radius: 12px;
  font-weight: 800; color: var(--muted);
}
.panel a:hover { background: var(--primary-weak); color: var(--primary) }

/* ---------- STICKY CTA & TO-TOP ---------- */
.sticky-cta { position: fixed; bottom: 16px; right: 16px; z-index: 60; display: none }
.sticky-cta .cta {
  padding: 1rem 1.1rem; border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), #fb923c);
  color: #fff; font-weight: 900; border: 0;
  box-shadow: 0 14px 28px rgba(234,88,12,.22); cursor: pointer;
}
.to-top {
  position: fixed; right: 18px; bottom: 80px; display: none;
  background: #fff; border: 1px solid var(--border);
  padding: .7rem .8rem; border-radius: 12px;
  box-shadow: var(--shadow); cursor: pointer; z-index: 60;
}

/* ---------- HERO ---------- */
header { border-bottom: 1px solid var(--border) }
.hero { padding: 52px 0 12px }
.hero .grid {
  display: grid; grid-template-columns: 1.15fr .85fr;
  gap: 32px; align-items: center;
}
.hero-intro h1 {
  font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.4rem);
  line-height: 1.03; letter-spacing: -.3px;
  margin: .2rem 0 .6rem;
  color: var(--primary);
  text-align: center;
}
.hero-intro .lead {
  font-size: clamp(1.02rem, .95rem + .5vw, 1.24rem);
  color: var(--muted); max-width: 90ch;
  margin: 0 auto; text-align: center;
}
.cta { display: inline-flex; gap: .55rem; flex-wrap: wrap; margin-top: 14px }
.btn {
  display: inline-flex; gap: .5rem; align-items: center;
  padding: .9rem 1.1rem; border-radius: 999px;
  border: 1px solid transparent; font-weight: 800;
  cursor: pointer; box-shadow: var(--shadow);
  transition: all .22s ease;
}
.btn.primary {
  background: linear-gradient(90deg, var(--orange), #fb923c);
  color: #fff;
  box-shadow: 0 12px 24px rgba(234,88,12,.20);
}
.btn.primary:hover {
  background: linear-gradient(90deg, var(--orange-dark), #d97706);
  box-shadow: 0 16px 32px rgba(234,88,12,.30);
  transform: translateY(-3px) scale(1.05);
}
.btn.secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 6px 12px rgba(0,0,0,.08);
}
.btn.secondary:hover {
  background: var(--primary-weak);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 24px rgba(var(--primary-rgb),.15);
}

/* ---------- SECTIONS / CARDS / GRIDS ---------- */
section     { padding: 56px 0 }
section:nth-child(even) { background: rgba(71,85,105,.03) }
.section-eyebrow {
  font-size: .85rem; font-weight: 950; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin: 0 0 10px;
}
.section-title {
  font-size: clamp(1.7rem, 1.1rem + 1.3vw, 2.2rem);
  margin: 0 0 28px;
  color: #0f172a; font-weight: 950; letter-spacing: -.4px;
  display: flex; align-items: center; gap: 12px;
}
.section-title::before {
  content: ""; display: inline-block;
  width: 6px; height: 100%; background: var(--primary);
  border-radius: 3px;
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px }
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; background: var(--card);
}
.test-block {
  display: flex; flex-direction: column; gap: 14px; margin: 16px 0;
}
.test-block > div {
  padding: 16px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; transition: all .22s ease;
}
.test-block > div:nth-child(odd) {
  background: rgba(15,23,42,.03);
}
.test-block > div:hover {
  background: rgba(var(--primary-rgb),.08); border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb),.12);
  transform: translateX(2px);
}
.result-box {
  border-radius: 14px; border-left: 5px solid var(--primary);
  background: linear-gradient(135deg, rgba(var(--primary-rgb),.08), transparent);
  padding: 18px; margin: 12px 0;
}
.result-box.positive {
  border-left-color: #22c55e;
  background: linear-gradient(135deg, rgba(34,197,94,.08), transparent);
}
.result-box.warning {
  border-left-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245,158,11,.08), transparent);
}
.result-box.alert {
  border-left-color: #ef4444;
  background: linear-gradient(135deg, rgba(239,68,68,.08), transparent);
}
.muted { color: var(--muted) }

/* ---------- MEDIA SLOTS ---------- */
.with-media {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 20px; align-items: start;
}
.media-slot {
  position: relative; width: 100%; min-height: 280px;
  border: 2px dashed #c7c7d1; border-radius: 18px;
  background: linear-gradient(45deg, rgba(var(--primary-rgb),.06), rgba(var(--primary-rgb),.03));
  background-size: cover; background-position: center;
}
.media-slot.filled { border-style: solid }
.media-slot img.slot-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: inherit;
}

/* ---------- TABS ---------- */
.tabs {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin: 10px 0 16px; background: #fff;
  border: 1px solid var(--border); padding: 6px;
  border-radius: 999px; box-shadow: var(--shadow);
}
.tab {
  padding: .6rem 1rem; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 800;
}
.tab.active { background: var(--primary); color: #fff }

/* ---------- CHARTS ---------- */
canvas.chart {
  border-radius: 16px; background: #fff;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  width: 100%; height: auto; max-width: 100%;
}

/* ---------- FAQ ---------- */
.faq {
  border-radius: 14px; border: 1px solid var(--border);
  background: #fff; box-shadow: var(--shadow);
}
.faq summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 900 }
.faq summary::-webkit-details-marker { display: none }
.faq p { margin: 0; padding: 0 18px 16px; color: var(--muted) }
.faq + .faq { margin-top: 10px }

/* ---------- TABLES (test results) ---------- */
.test-results, #results, .results, .score-box {
  line-height: 1.5; overflow-wrap: anywhere; word-break: break-word;
}
.results-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch }
table { border-collapse: collapse; width: 100% }
td, th { padding: .6rem .75rem; vertical-align: top }
canvas { max-width: 100%; height: auto }

/* ---------- BRAND TOP-RIGHT ---------- */
.brand-top-right {
  position: fixed; top: 16px; right: 16px; z-index: 95;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.90);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(0,0,0,.10);
  font-weight: 900; color: #1f2937;
}
.brand-top-right .dot {
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--green);
}

/* ---------- FLOATING BUTTONS LEFT ---------- */
.float-left {
  position: fixed; left: 18px; bottom: 18px; z-index: 92;
  display: flex; flex-direction: column; gap: 12px;
}
.float-btn {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 2px solid #fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.18);
  transform: translateZ(0);
}
.float-btn:hover { transform: translateY(-2px) scale(1.06) }
.float-wa  { background: #16a34a; color: #fff }
.float-ig  {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
}
.float-mail { background: var(--slate); color: #fff }

/* ---------- FLOATING BUTTON RIGHT (AGENDAR) ---------- */
.float-right { position: fixed; right: 18px; bottom: 18px; z-index: 94 }
.float-agendar {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px; border-radius: 999px;
  background: var(--orange); color: #fff;
  font-weight: 950; text-transform: uppercase; letter-spacing: .6px;
  border: 4px solid #fff;
  box-shadow: 0 18px 36px rgba(0,0,0,.22);
}
.float-agendar:hover { background: var(--orange-dark); transform: translateY(-2px) scale(1.04) }

/* ---------- BOOKING SECTION (ENCUADRADO) ---------- */
#reserva {
  border-top: 1px solid var(--border);
  background: radial-gradient(900px 520px at 95% 0%, rgba(234,88,12,.08), transparent);
  padding: 66px 0;
}
.reserve-box {
  max-width: 920px; margin: 0 auto; text-align: center;
  border: 2px solid rgba(234,88,12,.18);
  background: #fff; border-radius: 28px;
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
  padding: 28px 22px; position: relative; overflow: hidden;
}
.reserve-box::before {
  content: "";
  position: absolute; inset: -120px -120px auto auto;
  width: 280px; height: 280px; border-radius: 999px;
  background: rgba(234,88,12,.14); filter: blur(30px);
}
.reserve-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 999px;
  background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.22);
  color: #b91c1c; font-weight: 950; margin-bottom: 14px;
  position: relative; z-index: 1;
}
.reserve-title {
  margin: 6px 0 10px;
  font-size: clamp(1.9rem, 1.4rem + 1.2vw, 2.5rem);
  letter-spacing: -.3px; color: #111827;
  position: relative; z-index: 1;
}
.reserve-sub {
  margin: 0 auto 18px; color: var(--muted); font-weight: 650;
  max-width: 76ch; position: relative; z-index: 1;
}
.reserve-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 22px; border-radius: 18px;
  background: var(--orange); color: #fff;
  font-weight: 950; font-size: 1.15rem;
  box-shadow: 0 14px 28px rgba(234,88,12,.25);
  border-bottom: 6px solid rgba(0,0,0,.20);
  position: relative; z-index: 1;
}
.reserve-cta:hover  { background: var(--orange-dark); transform: translateY(-2px) }
.reserve-cta:active { transform: translateY(2px); border-bottom-width: 2px }
.reserve-foot {
  margin-top: 14px; color: #94a3b8;
  font-weight: 850; font-size: .85rem;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  position: relative; z-index: 1;
}

/* ---------- FOOTER ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 0; text-align: center;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1020px) {
  .with-media   { grid-template-columns: 1fr }
  .hero .grid,
  .grid-3,
  .grid-2       { grid-template-columns: 1fr }
  .nav-links    { display: none }
  .menu-btn     { display: inline-flex }
  .brand .logo-wrap  { width: 140px; height: 140px }
  .brand-top-right   { top: 12px; right: 12px; padding: 9px 12px }
}
@media (max-width: 560px) {
  .btn           { width: 100%; justify-content: center }
  section        { padding: 44px 0 }
  .media-slot    { min-height: 200px }
  .brand .logo-wrap { width: 120px; height: 120px }
  .float-agendar { padding: 14px 18px }
}
