/* =========================================================
   Dr. Abraham Palacios Hernández — Angiología y cirugía vascular
   ========================================================= */

:root {
  --navy: #0f2a47;
  --navy-2: #173b61;
  --navy-deep: #0a1f36;
  --blue: #1d6aab;
  --blue-hover: #175a92;
  --blue-soft: #eaf2fa;
  --wine: #7b1e2e;
  --wine-light: #d0687a;
  --wine-soft: #f9eef0;
  --wa: #1f7a4d;
  --wa-hover: #186640;
  --bg: #ffffff;
  --bg-alt: #f3f6f9;
  --line: #dde4ec;
  --text: #1b2734;
  --muted: #536375;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 42, 71, 0.05), 0 8px 24px rgba(15, 42, 71, 0.06);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.03rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }
:focus-visible { outline: 3px solid #5aa0dc; outline-offset: 3px; border-radius: 6px; }

h1, h2, h3, h4, h5 { color: var(--navy); line-height: 1.25; margin: 0 0 .6em; }
h1, h2 { font-family: var(--font-serif); font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.4rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
h5 { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
p { margin: 0 0 1em; }
address { font-style: normal; }

.icon { width: 1.25em; height: 1.25em; flex: none; }
.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: 100;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 860px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }

/* ---------- botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .75em 1.35em;
  border-radius: 999px; border: 1.5px solid transparent;
  font: 600 .97rem/1.2 var(--font-sans); text-decoration: none; text-align: center;
  cursor: pointer; transition: background-color .2s, border-color .2s, color .2s;
}
.btn .icon { width: 1.2em; height: 1.2em; }
.btn-wa { background: var(--blue); color: #fff; }
.btn-wa:hover { background: var(--blue-hover); color: #fff; }
.btn-wa-outline { background: #fff; color: var(--blue); border-color: #b9d1e8; }
.btn-wa-outline:hover { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-hover); }
.btn-primary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-primary:hover { background: var(--navy); color: #fff; }
.btn-sm { min-height: 42px; padding: .55em 1.05em; font-size: .9rem; }
.btn-emergency { background: var(--wine); color: #fff; }
.btn-emergency:hover { background: #631625; color: #fff; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4em;
  font-weight: 600; font-size: .95rem; text-decoration: none;
}
.link-arrow .icon { width: 1.05em; height: 1.05em; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- encabezado ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 4px 18px rgba(15, 42, 71, .06); }
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(1.4) blur(10px); }
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: var(--header-h); max-width: 1320px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); flex: none; }
.brand:hover { color: var(--navy); }
.brand-mark { width: 40px; height: 40px; flex: none; border-radius: 10px; background: #fff; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.04rem; line-height: 1.2; white-space: nowrap; }
.brand-spec { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-nav .btn { white-space: nowrap; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: 8px 7px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .89rem; font-weight: 500; white-space: nowrap;
}
.site-nav ul a:hover { color: var(--blue); background: var(--blue-soft); }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1300px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 14px;
    padding: 12px 16px 20px; background: #fff;
    border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(15, 42, 71, .1);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { white-space: normal; padding: 13px 8px; border-bottom: 1px solid var(--bg-alt); font-size: 1rem; border-radius: 0; }
  .site-nav .btn { width: 100%; }
}

/* ---------- portada ---------- */

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(29, 106, 171, .09), transparent 60%),
    linear-gradient(180deg, #f7f9fc 0%, #fff 100%);
  padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 5vw, 72px);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--wine);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.hero-name {
  font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.06; letter-spacing: -0.02em; margin-bottom: .35em;
}
.hero-title {
  font-family: var(--font-serif); font-size: clamp(1.25rem, 1rem + .9vw, 1.6rem);
  color: var(--navy-2); font-weight: 500; margin-bottom: 1em;
}
.hero-text { color: var(--muted); max-width: 60ch; font-size: 1.06rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-cities { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .93rem; margin: 0; }
.hero-cities .icon { color: var(--wine); }

.hero-media { position: relative; display: flex; justify-content: center; }
.hero-art {
  position: absolute; inset: -40px -60px -40px auto; width: 115%; max-width: none; height: calc(100% + 80px);
  object-fit: contain; opacity: .9; pointer-events: none;
}
.portrait { position: relative; margin: 0; width: min(100%, 380px); }
.portrait-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #edf2f7, #e1e8f0);
  border: 1px solid #d3dce6; box-shadow: 0 24px 60px rgba(15, 42, 71, .16);
}
.portrait-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: #7b8a9b; font-size: .95rem; font-weight: 500; text-align: center; padding: 20px;
  border: 2px dashed #c5d0dc; border-radius: 22px; margin: 14px;
}
.portrait-placeholder .icon { width: 64px; height: 64px; stroke-width: 1.2; }
.portrait figcaption {
  position: relative; margin: -36px 20px 0; padding: 14px 18px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column; text-align: center;
}
.portrait figcaption strong { font-family: var(--font-serif); color: var(--navy); font-size: 1.05rem; }
.portrait figcaption span { font-size: .85rem; color: var(--muted); }

/* ---------- secciones ---------- */

.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin-bottom: 36px; }
.section-lead { color: var(--muted); font-size: 1.06rem; }
.subhead { font-family: var(--font-serif); font-size: 1.45rem; margin: 48px 0 20px; }
.prose p { color: #33414f; }
.prose h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.split-even { grid-template-columns: 1fr 1fr; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.section-alt .panel { box-shadow: none; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; min-width: 0;
}
.card h3 { margin-top: 4px; }
.card h4 { font-size: .95rem; margin-top: 8px; }
.card p { color: #3a4856; font-size: .97rem; }
.card-plain { background: #fff; }
.card-image { margin: -26px -26px 20px; width: calc(100% + 52px); max-width: none; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-actions { margin-top: auto; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.card-actions.stack { flex-direction: column; align-items: flex-start; }
.card-actions .btn { width: 100%; font-size: .92rem; padding-left: 1em; padding-right: 1em; }

.icon-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--blue-soft); color: var(--blue);
}
.icon-badge .icon { width: 26px; height: 26px; }
.card-plain .icon-badge { margin-bottom: 16px; }

.tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--wine-soft); color: var(--wine); font-size: .76rem; font-weight: 600; letter-spacing: .02em;
}
.tag-muted { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); margin-top: 2px; }

.check-list, .dot-list { list-style: none; margin: 0 0 1em; padding: 0; }
.check-list li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--bg-alt); }
.check-list li:last-child { border-bottom: 0; }
.check-list .icon { color: var(--blue); margin-top: 3px; width: 1.15em; height: 1.15em; }
.dot-list li { display: flex; gap: 10px; padding: 4px 0; font-size: .95rem; color: #3a4856; }
.dot-list .icon { color: var(--wine); margin-top: 4px; width: 1em; height: 1em; }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--blue-soft); border: 1px solid #cfe0f1; color: #23415f;
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 28px 0; font-size: .95rem;
}
.callout .icon { color: var(--blue); margin-top: 2px; }
.section-head + .callout { margin-top: -8px; }
.note { display: flex; gap: 10px; font-size: .9rem !important; color: var(--muted) !important; margin: 4px 0 0; }
.note .icon { color: var(--muted); margin-top: 3px; width: 1.05em; height: 1.05em; }

.empty-state {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 36px; border: 1.5px dashed var(--line); border-radius: var(--radius); color: var(--muted); background: #fff;
}

/* contenido plegable (solo se pliega en móviles) */
.more > summary { display: none; }
.more > summary::-webkit-details-marker { display: none; }
@media (max-width: 640px) {
  .more > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    list-style: none; cursor: pointer; padding: 10px 0; margin-top: 4px;
    border-top: 1px solid var(--line); color: var(--blue); font-weight: 600; font-size: .93rem;
  }
  .more > summary .icon { transition: transform .2s; }
  .more[open] > summary .icon { transform: rotate(180deg); }
  .more-body { padding-top: 6px; }
}

/* enfermedades */
.condition h3 { font-size: 1.15rem; }

/* servicios */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--navy); text-decoration: none; font-size: .9rem; font-weight: 500;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.service-group .subhead { display: flex; align-items: center; gap: 14px; }
.service-group .subhead::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.service-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.card .service-title { font-size: 1.18rem; margin: 2px 0 6px; }
.service-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 4px; }
.service-lists h5 { margin-bottom: 6px; }

/* sección oscura */
.section-dark { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #d5e0ec; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .eyebrow { color: var(--wine-light); }
.section-dark .section-lead { color: #c3d1e0; }
.card-dark { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .13); }
.card-dark p { color: #c9d6e3; }
.card-dark .icon-badge { background: rgba(255, 255, 255, .09); color: #fff; margin-bottom: 16px; }
.card-dark .link-arrow { color: #9ec8ef; }
.callout-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #d5e0ec; }
.callout-dark .icon { color: var(--wine-light); }

/* urgencias */
.emergency {
  background: var(--wine-soft); border: 1px solid #ecc9cf; border-left: 5px solid var(--wine);
  border-radius: var(--radius); padding: 26px 28px; color: #4a1620;
}
.emergency-head { display: flex; align-items: center; gap: 12px; color: var(--wine); margin-bottom: 8px; }
.emergency-head .icon { width: 28px; height: 28px; }
.emergency-head h3 { color: var(--wine); margin: 0; font-size: 1.25rem; }
.emergency-action { font-weight: 600; }

/* ubicaciones */
.location address { color: #33414f; font-size: 1rem; margin-bottom: 10px; }
.location h3 { font-family: var(--font-serif); font-size: 1.3rem; }

/* preguntas frecuentes */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; cursor: pointer; list-style: none;
  font-weight: 600; color: var(--navy); font-size: 1.02rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--blue); transition: transform .2s; }
.faq[open] summary .icon { transform: rotate(180deg); }
.faq-body { padding: 0 22px 20px; color: #3a4856; }
.faq-locations { list-style: none; padding: 0; margin: 0 0 1em; }
.faq-locations li { display: flex; gap: 10px; padding: 6px 0; }
.faq-locations .icon { color: var(--wine); margin-top: 3px; }

/* llamada final */
.cta { background: var(--navy-2); color: #fff; padding: 56px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta h2 { color: #fff; margin-bottom: .3em; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
.cta p { color: #cddaea; margin: 0; max-width: 60ch; }
.cta .btn-wa { background: #fff; color: var(--navy); }
.cta .btn-wa:hover { background: var(--blue-soft); color: var(--navy); }

/* pie de página */
.site-footer { background: var(--navy-deep); color: #b9c8d8; padding: 64px 0 28px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.1fr; gap: 40px; }
.brand-light, .brand-light:hover { color: #fff; }
.brand-light .brand-spec { color: #9fb1c4; }
.footer-note { margin: 18px 0 20px; max-width: 42ch; }
.footer-title { color: #fff; font-family: var(--font-sans); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 4px 0; }
.footer-col a, .footer-bottom a { color: #d3dfeb; text-decoration: none; }
.footer-col a:hover, .footer-bottom a:hover { color: #fff; text-decoration: underline; }
.footer-locations li { display: flex; flex-direction: column; padding: 6px 0 10px; }
.footer-locations strong { color: #e7eef5; font-weight: 600; }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 44px; padding-top: 22px; font-size: .88rem;
}
.footer-bottom p { margin: 0; }

/* botón flotante */
.wa-float {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  height: 56px; padding: 0 20px 0 16px; border-radius: 999px;
  background: var(--wa); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: 0 10px 28px rgba(10, 31, 54, .28);
}
.wa-float:hover { background: var(--wa-hover); color: #fff; }
.wa-float .icon { width: 26px; height: 26px; }

.page { min-height: 60vh; }

/* ---------- adaptable ---------- */

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-art { inset: -30px 0 auto; width: 100%; height: 115%; }
  .portrait { width: min(78%, 320px); }
  .split, .split-even { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --header-h: 66px; }
  body { font-size: 1rem; }
  .container { padding: 0 16px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-name { font-size: 1rem; }
  .brand-spec { font-size: .7rem; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .card { padding: 22px; }
  .card-image { margin: -22px -22px 18px; width: calc(100% + 44px); }
  .panel { padding: 22px; }
  .hero-actions .btn { width: 100%; }
  .service-lists { grid-template-columns: 1fr; gap: 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .wa-float { padding: 0; width: 58px; justify-content: center; right: 16px; }
  .site-footer { padding-bottom: 96px; }
  .wa-float span { display: none; }
  .emergency { padding: 22px; }
  .cta-inner .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .site-header, .wa-float, .hero-actions, .card-actions, .cta { display: none !important; }
}
.prose .eyebrow { color: var(--wine); }
