:root {
  --brand: #003057;        /* Everex navy */
  --brand-dark: #00223e;
  --brand-tint: #e9eff4;
  --accent: #e05206;       /* Everex naranja (CTA) */
  --accent-dark: #c0470a;
  --sky: #2ea3f2;          /* azul secundario */
  --ink: #14263a;
  --muted: #5a6b78;
  --line: #dbe3ea;
  --bg: #f4f7f9;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,48,87,.05), 0 10px 30px rgba(0,48,87,.07);
  --maxw: 760px;
  font-synthesis-weight: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  font-size: 17px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--brand); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header ------------------------------------------------------------ */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 15px;
  padding-bottom: 15px;
}
.brandmark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brandmark img { height: 26px; width: auto; display: block; }
.brandmark .tag {
  padding-left: 12px;
  border-left: 1px solid var(--line);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

/* Hero (home) ------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--brand) 0%, #013e70 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px; top: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(46,163,242,.35), transparent 70%);
}
.hero .wrap { padding-top: 44px; padding-bottom: 44px; position: relative; z-index: 1; }
.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8fd0ff;
}
.hero h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 46px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.03;
}
.hero-lede { margin: 12px 0 0; max-width: 52ch; color: #cfe0ee; font-size: 16px; }

/* Main / sections --------------------------------------------------- */
main { padding: 26px 0 60px; }
main.home { padding: 0; display: flex; flex-direction: column; }
main.home .hero { flex: 1; display: flex; align-items: center; }
main.home .hero .wrap { width: 100%; }
.section { padding-top: 34px; padding-bottom: 64px; }
.section h2 {
  margin: 0 0 16px;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Leaflet head ------------------------------------------------------ */
.med-head {
  padding: 26px 24px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--brand-tint), var(--card));
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}
.med-name {
  margin: 0;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--brand);
}
.med-strength { font-weight: 500; color: var(--accent); }
.med-sub { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* Meta grid --------------------------------------------------------- */
.meta { display: grid; grid-template-columns: 1fr 1fr; background: var(--card); }
.meta div { padding: 14px 24px; border-bottom: 1px solid var(--line); }
.meta div:nth-child(2n) { border-left: 1px solid var(--line); }
.meta dt {
  margin: 0;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.meta dd { margin: 3px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; }

/* Buttons ----------------------------------------------------------- */
.actions { padding: 22px 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); }
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.actions .flex-grow { flex: 1 1 220px; }

/* PDF viewer -------------------------------------------------------- */
.viewer { border-top: 1px solid var(--line); background: #eef3f6; }
.pdf-frame { display: block; width: 100%; height: 78vh; min-height: 520px; border: 0; }
.viewer-note { display: none; padding: 22px 24px; color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .pdf-frame { display: none; }
  .viewer-note { display: block; }
}

/* Directory list ---------------------------------------------------- */
.med-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.med-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.med-list a:hover { border-color: var(--brand); transform: translateY(-1px); }
.med-list .name { font-weight: 700; font-size: 18px; color: var(--brand); }
.med-list .gtin { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.med-list .chev {
  color: var(--accent);
  flex: 0 0 auto;
  display: inline-flex;
  width: 34px; height: 34px;
  align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fdece2;
}

/* Legal / footer ---------------------------------------------------- */
.legal {
  margin-top: 26px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}
.legal strong { color: var(--ink); }
.legal p { margin: 0 0 10px; }
.legal p:last-child { margin-bottom: 0; }

.site-footer {
  background: var(--brand);
  color: #b9cdda;
  padding: 26px 0;
  font-size: 13px;
}
.site-footer .wrap { display: flex; flex-direction: column; gap: 4px; }
.site-footer .foot-brand { color: #fff; font-weight: 700; letter-spacing: .02em; }
.site-footer a { color: #8fd0ff; }

/* PDF.js viewer ----------------------------------------------------- */
.pdf-bar {
  position: sticky;
  top: 57px; /* debajo del site-header */
  z-index: 9;
  background: var(--brand-tint);
  border-bottom: 1px solid var(--line);
}
.pdf-bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.pdf-bar .title { font-weight: 700; color: var(--brand); font-size: 15px; }
.pdf-bar .title span { color: var(--accent); font-weight: 500; }
.pdf-bar .sp { flex: 1; }
.pdf-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--brand);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.pdf-bar a svg { width: 17px; height: 17px; }
.pdf-bar a.dl { background: var(--accent); color: #fff; border-color: var(--accent); }

.pdf-doc {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 18px 12px 60px;
}
.pdf-page {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 16px;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 4px;
  overflow: hidden;
}
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-status {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 15px;
}
.pdf-status a { color: var(--brand); font-weight: 700; }

/* Redirect / not found notice --------------------------------------- */
.notice { text-align: center; padding: 44px 0 10px; }
.notice h1 { font-size: 26px; margin: 0 0 8px; color: var(--brand); }
.notice p { color: var(--muted); margin: 0 auto 22px; max-width: 44ch; }
