/* Paleta tomada del logo de Medifarma */
:root {
  --navy: #1b3a6b;
  --navy-dark: #12284d;
  --green: #6aaf3d;
  --green-dark: #548f2e;
  --gray: #6b6b6b;
  --text: #1f2a37;
  --muted: #5b6574;
  --bg: #ffffff;
  --soft: #f3f7f1;
  --border: #e3e8ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(27, 58, 107, 0.08);
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: "Open Sans", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { font-family: "Montserrat", sans-serif; color: var(--navy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }

.container { width: min(1140px, 100% - 32px); margin-inline: auto; }

.eyebrow {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: .6em;
}
.eyebrow--light { color: #bfe3a5; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .85em 1.6em;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--sm { padding: .55em 1.2em; font-size: .9rem; }
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-dark); }
.btn--ghost { border-color: var(--navy); color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }
.btn--light { background: #fff; color: var(--navy); }
.btn--outline-light { border-color: #fff; color: #fff; }
.btn--outline-light:hover { background: rgba(255,255,255,.12); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.header__logo img { height: 48px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a:not(.btn) {
  text-decoration: none; color: var(--text); font-weight: 600;
  font-size: .95rem; position: relative;
}
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--green); transition: width .2s;
}
.nav a:not(.btn):hover::after { width: 100%; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: transform .2s, opacity .2s; }

/* Hero */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(106,175,61,.18), transparent 45%),
    linear-gradient(180deg, #f6f9fc 0%, #fff 100%);
  padding: 72px 0 88px;
}
.hero__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.hero h1 span { color: var(--green); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 560px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__card {
  background: var(--navy);
  border-radius: 28px;
  padding: 40px;
  color: #fff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero__card::before {
  content: ""; position: absolute; inset: auto -60px -60px auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(106,175,61,.25);
}
.cross { position: relative; width: 120px; height: 120px; margin: 0 auto 32px; }
.cross span { position: absolute; background: var(--green); border-radius: 18px; }
.cross span:first-child { inset: 0 38px; }
.cross span:last-child { inset: 38px 0; background: #fff; opacity: .9; }
.hero__stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: center; position: relative; }
.hero__stats li { font-size: .85rem; color: #cfd9ea; }
.hero__stats strong { display: block; font-family: "Montserrat", sans-serif; font-size: 1.7rem; color: #fff; }

/* Secciones */
.section { padding: 88px 0; }
.section--soft { background: var(--soft); }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section__head p:last-child { color: var(--muted); }

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

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.card p { color: var(--muted); margin: 0; }
.card__icon {
  width: 52px; height: 52px; border-radius: 12px;
  background: rgba(106,175,61,.14);
  display: grid; place-items: center; margin-bottom: 18px;
}
.card__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--green-dark); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Banda domicilios */
.section--band { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; }
.section--band h2 { color: #fff; }
.band { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.band__text > p { color: #d3dcec; }
.band__cta { display: flex; flex-direction: column; gap: 14px; align-items: stretch; max-width: 320px; justify-self: end; width: 100%; }
.steps { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: center; gap: 14px; }
.steps span {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-family: "Montserrat", sans-serif;
}

/* Nosotros */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about > div:first-child p { color: var(--muted); }
.values { display: grid; gap: 16px; }
.value { border-left: 4px solid var(--green); background: var(--soft); padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; }
.value p { margin: 0; color: var(--muted); }

/* Sedes */
.tabs { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border); background: #fff; color: var(--navy);
  padding: .5em 1.3em; border-radius: 999px; cursor: pointer;
  font-family: "Montserrat", sans-serif; font-weight: 600;
}
.tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.sedes-tools { display: grid; gap: 18px; justify-items: center; margin-bottom: 12px; }
.sedes-tools .tabs { margin-bottom: 0; }
.sede-search {
  width: min(460px, 100%); font: inherit; padding: .8em 1.1em;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
}
.sede-search:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.sedes-count { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 24px; }
.sedes-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); }
.sede {
  background: #fff; border-radius: var(--radius); padding: 20px;
  border-top: 4px solid var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex; flex-direction: column;
}
.sede--propia { border-top-color: var(--green); }
.sede h3 { font-size: 1rem; margin-bottom: .4em; }
.sede p { margin: 0; color: var(--muted); font-size: .9rem; }
.sede__dep { font-weight: 700; color: var(--green-dark) !important; font-size: .78rem !important; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px !important; }
.sede__dir { flex: 1; }
.sede__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag { font-size: .72rem; font-weight: 600; padding: .25em .7em; border-radius: 999px; background: #eef2f7; color: var(--navy); }
.tag--conv { background: rgba(106,175,61,.15); color: var(--green-dark); }
.tag--movil { background: #fff4e0; color: #9a5b00; }

/* Contacto */
.contact { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; }
.contact > div > p { color: var(--muted); }
.contact__list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.form {
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow); display: grid; gap: 16px;
}
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .92rem; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; padding: .75em .9em;
  border: 1px solid var(--border); border-radius: 10px; background: #fbfcfd;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: transparent; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--muted); font-size: .85rem; }
.form .check input { margin-top: 4px; }
.form__msg { margin: 0; font-size: .9rem; min-height: 1.4em; }
.form__msg.ok { color: var(--green-dark); }
.form__msg.err { color: #c0392b; }

/* Footer */
.footer { background: #0e1f3b; color: #b9c4d6; padding-top: 56px; }
.footer__inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding-bottom: 32px; }
.footer__logo { height: 44px; width: auto; background: #fff; padding: 8px 12px; border-radius: 10px; margin-bottom: 12px; }
.footer__nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.footer__nav a { color: #dfe6f1; text-decoration: none; }
.footer__nav a:hover { color: var(--green); }
.footer__legal { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; font-size: .85rem; }
.footer__legal p { margin: 0; }

.footer__legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer--slim { padding-top: 0; }
.footer--slim .footer__legal { border-top: 0; }
.footer__legal a { color: #8f9bb0; text-decoration: none; }
.footer__legal a:hover { color: #dfe6f1; }

/* Estados financieros */
.fin { max-width: 820px; }
.fin__head { margin-bottom: 40px; }
.fin__head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.fin__head p:last-child { color: var(--muted); }
.fin__year { margin-bottom: 36px; }
.fin__year h2 { font-size: 1.3rem; padding-bottom: 10px; border-bottom: 2px solid var(--green); }
.fin__docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.fin__docs a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text); font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
.fin__docs a:hover { border-color: var(--green); box-shadow: var(--shadow); }
.fin__docs a > span:nth-child(2) { flex: 1; }
.fin__icon svg { width: 24px; height: 24px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.fin__pdf { font-size: .72rem; font-weight: 700; color: #b03a2e; background: #fdecea; padding: .2em .6em; border-radius: 6px; }
.fin__empty { color: var(--muted); padding: 24px; background: var(--soft); border-radius: var(--radius); }

/* Responsive */
@media (max-width: 960px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .hero__inner, .band, .about, .contact { grid-template-columns: 1fr; }
  .band__cta { justify-self: start; }
  .hero__card { max-width: 440px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 8px 16px 20px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .nav .btn { margin-top: 16px; }
  .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); }
  .header__logo img { height: 40px; }
  .section { padding: 64px 0; }
  .hero { padding: 48px 0 64px; }
}
@media (max-width: 520px) {
  .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .hero__card { padding: 28px; }
  .form { padding: 22px; }
}
