/* =====================================================================
   Cgurito · Design System
   Brand register: editorial confidence, warm-but-not-cream, calm medical
   Audit-driven: no AI traps, no eyebrow grammar, no 01/02/03 scaffolding
   ===================================================================== */

:root {
  /* ── Color (OKLCH, leans slightly toward emerald, NOT toward cream) ── */
  --bg:           oklch(0.985 0.004 170);    /* near-white, micro emerald tint */
  --bg-soft:      oklch(0.955 0.008 170);    /* tinted section bg */
  --bg-strong:    oklch(0.20  0.012 200);    /* drenched section (deep ink) */
  --surface:      oklch(0.995 0.002 170);
  --ink:          oklch(0.165 0.012 220);    /* near-black, cool */
  --ink-2:        oklch(0.320 0.010 220);
  --muted:        oklch(0.500 0.008 200);
  --muted-2:      oklch(0.640 0.006 200);
  --border:       oklch(0.905 0.007 170);
  --border-2:     oklch(0.945 0.005 170);
  --accent:       oklch(0.380 0.080 162);    /* deep emerald */
  --accent-2:     oklch(0.470 0.090 162);
  --accent-soft:  oklch(0.945 0.020 162);
  --accent-ink:   oklch(0.96  0.015 162);    /* for use on dark/drenched bg */

  /* ── Type ── */
  --font-sans:    'Geist', -apple-system, system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;
  --font-display: 'Spectral', Georgia, serif;

  /* ── Fluid spacing ── */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  clamp(32px,  3vw,  44px);
  --s-7:  clamp(48px,  5vw,  72px);
  --s-8:  clamp(64px,  7vw,  104px);
  --s-9:  clamp(96px,  10vw, 160px);

  /* ── Radii (audit ceiling: 14px on cards) ── */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-pill: 999px;

  /* ── Elevation ── */
  --sh-1: 0 1px 2px rgba(17,17,16,.05);
  --sh-2: 0 4px 14px -4px rgba(17,17,16,.06);
  --sh-lift: 0 12px 36px -14px rgba(17,17,16,.16);

  /* ── Motion ── */
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* ── Z-scale (semantic, not arbitrary) ── */
  --z-base: 1;
  --z-sticky: 10;
  --z-nav: 50;
  --z-modal: 100;
  --z-toast: 200;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.005em;
}

::selection { background: var(--accent); color: var(--accent-ink); }

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button { font: inherit; }

/* ── Typography ────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  color: var(--ink);
  letter-spacing: -0.024em;
  line-height: 1.05;
  font-weight: 500;
  text-wrap: balance;
  margin: 0;
}
.display {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: -0.022em;
  line-height: 1.02;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

p { text-wrap: pretty; }

/* Hero kicker (the ONLY eyebrow on the page — used deliberately, not as scaffold) */
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 450;
  letter-spacing: 0;
}
.kicker-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  animation: kicker-pulse 2.6s var(--ease) infinite;
}
@keyframes kicker-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}

/* ── Container ─────────────────────────────────────────────────────── */
.wrap     { max-width: 1180px; margin: 0 auto; padding: 0 var(--s-5); }
.wrap-lg  { max-width: 1280px; margin: 0 auto; padding: 0 var(--s-5); }
.wrap-sm  { max-width: 820px;  margin: 0 auto; padding: 0 var(--s-5); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 20px;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.005em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background-color .2s var(--ease),
              color .2s var(--ease), border-color .2s var(--ease),
              box-shadow .25s var(--ease);
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 0 0 1px var(--ink), inset 0 1px 0 rgba(255,255,255,.06);
}
.btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -10px var(--accent);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px var(--accent);
}
.btn-accent:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--accent-2), 0 10px 28px -10px var(--accent);
}

.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--border);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--ink); }

.btn-link {
  color: var(--ink); padding: 0; height: auto;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  transition: opacity .15s;
}
.btn-link:hover { opacity: .55; }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; gap: 6px; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 15.5px; }

/* Pill arrow icon nudge on hover */
.btn .arrow { transition: transform .25s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Navbar ────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-2);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: var(--font-display); font-weight: 400;
  font-size: 24px; letter-spacing: -0.025em;
  color: var(--ink);
  font-style: italic;
}
.brand .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
}

.nav-links {
  display: flex; gap: clamp(20px, 2.5vw, 36px);
  align-items: center;
}
.nav-link  {
  color: var(--muted); font-size: 14px; font-weight: 450;
  position: relative; padding: 4px 0;
  transition: color .18s var(--ease);
}
.nav-link::after {
  content: ''; position: absolute; left: 50%; right: 50%; bottom: -2px;
  height: 1px; background: var(--ink);
  transition: left .25s var(--ease), right .25s var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link.active::after { left: 0; right: 0; }
.nav-link.active { color: var(--ink); }

.nav-actions { display: flex; gap: 10px; align-items: center; }

.cart-btn {
  position: relative;
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink); transition: all .18s var(--ease);
}
.cart-btn:hover { border-color: var(--ink); }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ── Hero with video background ─────────────────────────────────────── */
.hero {
  position: relative;
  padding: var(--s-9) 0 var(--s-9);
  min-height: clamp(640px, 88vh, 920px);
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  z-index: var(--z-base);
  overflow: hidden;
  transform: translateY(var(--bg-y, 0)) scale(var(--bg-scale, 1));
  transform-origin: center top;
  will-change: transform;
}
.hero-bg-video {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%; min-height: 100%;
  width: auto; height: auto;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02);
}
.hero-bg-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(95deg,
      var(--bg) 0%,
      color-mix(in srgb, var(--bg) 92%, transparent) 30%,
      color-mix(in srgb, var(--bg) 60%, transparent) 55%,
      color-mix(in srgb, var(--bg) 10%, transparent) 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 24%, transparent),
      transparent 28% 72%,
      color-mix(in srgb, var(--bg) 65%, transparent));
}

.hero-content {
  position: relative; z-index: 2;
  max-width: 720px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: var(--s-5) 0 var(--s-5);
  max-width: 14ch;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}
.hero-sub {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 0 var(--s-6);
  font-weight: 420;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Footer-of-hero: signal trust without "metric template" */
.hero-meta {
  margin-top: var(--s-8);
  display: flex; gap: var(--s-7); flex-wrap: wrap;
  padding-top: var(--s-5);
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  max-width: 720px;
}
.hero-meta-item {
  font-size: 13.5px;
  color: var(--muted);
  letter-spacing: 0;
}
.hero-meta-item strong {
  color: var(--ink);
  font-weight: 550;
}

/* ── Section primitives ───────────────────────────────────────────── */
.section {
  padding: var(--s-9) 0;
  position: relative;
}
.section--soft { background: var(--bg-soft); }
.section--dark {
  background: var(--bg-strong);
  color: var(--accent-ink);
}
.section--dark h2 { color: var(--accent-ink); }
.section--dark .display em { color: oklch(0.78 0.12 162); }

/* ── Process (Cómo funciona) — editorial, NOT numbered cards ─── */
.process {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--s-8);
  align-items: start;
}
.process-lede h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  letter-spacing: -0.025em;
}
.process-lede h2 em {
  font-style: italic; color: var(--accent); font-weight: 300;
}
.process-lede p {
  color: var(--muted); font-size: 16px; line-height: 1.55;
  max-width: 38ch; margin: var(--s-5) 0 0;
}

.process-steps {
  list-style: none; padding: 0; margin: 0;
  counter-reset: step;
}
.process-step {
  display: grid;
  grid-template-columns: 44px minmax(140px, 200px) 1fr;
  align-items: baseline;
  column-gap: var(--s-6);
  row-gap: 8px;
  padding: var(--s-6) 0;
  border-top: 1px solid var(--border);
  counter-increment: step;
  position: relative;
}
.process-step:last-child { border-bottom: 1px solid var(--border); }
.process-step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  padding-top: 6px;
}
.process-step .step-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 3.4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  align-self: start;
}
.process-step h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-size: clamp(1.25rem, 1.5vw, 1.4rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.2;
  color: var(--ink);
}
.process-step p {
  grid-column: 3;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 6px 0 0;
  max-width: 52ch;
}

/* ── Editorial 2-col category list (replaces icon-card grid) ─── */
.cats-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: var(--s-5); flex-wrap: wrap;
  margin-bottom: var(--s-7);
}
.cats-head h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  letter-spacing: -0.025em;
  max-width: 14ch;
}
.cats-head h2 em { font-style: italic; color: var(--accent); font-weight: 300; }
.cats-head p { color: var(--muted); font-size: 15px; max-width: 38ch; margin: 0; }

.cats {
  list-style: none; padding: 0; margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--s-8);
  border-top: 1px solid var(--border);
}
.cat-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  padding: 18px 0;
  border-bottom: 1px solid var(--border-2);
  color: var(--ink);
  position: relative;
  transition: padding-left .25s var(--ease);
}
.cat-row::before {
  content: '';
  position: absolute;
  left: -8px; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: translateY(-50%) scale(.5);
  transition: opacity .2s var(--ease), transform .25s var(--ease);
}
.cat-row:hover { padding-left: 16px; }
.cat-row:hover::before { opacity: 1; transform: translateY(-50%) scale(1); }
.cat-row .name {
  font-size: 17px;
  font-weight: 480;
  letter-spacing: -0.012em;
}
.cat-row .count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.cat-row .arrow {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  transition: transform .25s var(--ease), color .2s var(--ease);
}
.cat-row:hover .arrow { color: var(--ink); transform: translateX(4px); }

/* ── Trust: replace 4-card cliché with editorial paragraph + meta ─── */
.trust {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 2fr;
  gap: var(--s-8);
  align-items: start;
}
.trust-lede {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  align-self: start;
}
.trust-body {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--accent-ink);
  max-width: 26ch;
}
.trust-body em { font-style: italic; color: oklch(0.78 0.12 162); }
.section--dark .trust-lede { color: color-mix(in srgb, var(--accent-ink) 60%, transparent); }

.trust-footnotes {
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: 1px solid color-mix(in srgb, var(--accent-ink) 18%, transparent);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-5);
  font-size: 13.5px;
}
.foot-fact {
  color: color-mix(in srgb, var(--accent-ink) 75%, transparent);
  line-height: 1.45;
}
.foot-fact strong {
  display: block;
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ── CTA closing ──────────────────────────────────────────────────── */
.cta {
  padding: var(--s-9) 0 var(--s-9);
  text-align: left;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--s-7);
  align-items: end;
}
.cta-headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  letter-spacing: -0.028em;
  line-height: 1.0;
  max-width: 16ch;
}
.cta-headline em { font-style: italic; color: var(--accent); font-weight: 300; }
.cta-aside {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 38ch;
  padding-bottom: 6px;
}
.cta-aside .btn { margin-top: var(--s-4); }

/* ── Footer ──────────────────────────────────────────────────────── */
.foot {
  margin-top: 0;
  padding: var(--s-9) 0 var(--s-7);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--s-6);
}
.foot h5 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--s-4); font-weight: 500;
}
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot ul li { margin-bottom: 10px; }
.foot ul a {
  color: var(--ink-2); font-size: 14px;
  transition: color .15s;
}
.foot ul a:hover { color: var(--accent); }
.foot-tagline {
  color: var(--muted);
  font-size: 14.5px;
  max-width: 320px;
  line-height: 1.5;
  margin: var(--s-3) 0 0;
}
.foot-bottom {
  margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: var(--s-4);
  font-size: 13px; color: var(--muted);
  flex-wrap: wrap;
}

/* ── Tags ───────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em;
  background: var(--bg-soft); color: var(--muted);
  border: 1px solid var(--border-2);
}
.tag-fonasa {
  background: oklch(0.97 0.04 95);
  color: oklch(0.38 0.10 50);
  border-color: oklch(0.88 0.07 90);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* ── Catalog (exam_list) ────────────────────────────────────────── */
.catalog {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--s-7);
  padding: var(--s-7) 0 var(--s-9);
}
.filters {
  position: sticky; top: 92px;
  align-self: start;
  font-size: 14px;
}
.filters h6 {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 var(--s-3); font-weight: 500;
}
.filter-search {
  width: 100%; height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface);
  font: inherit; font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .2s;
}
.filter-search:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 10%, transparent);
}
.filter-search::placeholder { color: var(--muted-2); }

.filter-list { list-style: none; padding: 0; margin: var(--s-5) 0 0; }
.filter-list li { margin-bottom: 1px; }
.filter-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-1);
  color: var(--ink-2); font-size: 13.5px;
  transition: background-color .12s, color .12s;
}
.filter-list a:hover { background: var(--bg-soft); color: var(--ink); }
.filter-list a.active {
  background: var(--ink);
  color: var(--bg);
}
.filter-list a.active .count { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.filter-list .count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.cat-results-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: var(--s-5);
  margin-bottom: var(--s-5);
  border-bottom: 1px solid var(--border);
}
.cat-results-head h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.024em;
}
.cat-results-head h1 em { font-style: italic; color: var(--muted); font-weight: 300; }
.cat-results-head .count {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Exam row — refined Linear/Stripe feel */
.exam-list { list-style: none; padding: 0; margin: 0; }
.exam {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: var(--s-5);
  padding: 18px 0 18px 12px;
  border-bottom: 1px solid var(--border-2);
  position: relative;
  transition: background-color .15s var(--ease);
}
.exam::before {
  content: '';
  position: absolute; left: 0; top: 22px;
  width: 3px; height: 0;
  background: var(--accent);
  border-radius: var(--r-pill);
  transition: height .2s var(--ease);
}
.exam:hover {
  background: var(--bg-soft);
}
.exam:hover::before { height: calc(100% - 36px); }

.exam-meta {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 6px; flex-wrap: wrap;
}
.exam-name {
  font-size: 15px; font-weight: 480;
  color: var(--ink);
  line-height: 1.4;
  max-width: 64ch;
}
.exam-prep {
  font-size: 12.5px; color: var(--muted);
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 6px;
}
.exam-prep::before { content: '↳'; opacity: .5; }

.exam-right {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
.exam-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.exam-price .cur {
  font-size: 12px; color: var(--muted);
  margin-right: 1px;
  font-family: var(--font-sans);
  font-variant-numeric: normal;
}

.add-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.add-btn:hover {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.add-btn svg { width: 13px; height: 13px; }

.exam-empty {
  padding: var(--s-9) 0;
  text-align: center;
  color: var(--muted);
}
.exam-empty .display {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-style: italic;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* Pagination */
.pag {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin-top: var(--s-7);
  font-family: var(--font-mono);
}
.pag a, .pag .pag-current {
  height: 36px; min-width: 36px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-1);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink); background: var(--surface);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, background-color .15s;
}
.pag a:hover { border-color: var(--ink); }
.pag .pag-current { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pag .pag-meta { color: var(--muted); border: none; background: none; }

/* ── Toast ─────────────────────────────────────────────────────── */
.toast {
  position: fixed; right: var(--s-5); bottom: var(--s-5); z-index: var(--z-toast);
  padding: 14px 18px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-2); font-size: 14px;
  box-shadow: var(--sh-lift);
  animation: toast-in .35s var(--ease);
}
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Section reveal (entrance) ─────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── Hamburger + Drawer mobile ──────────────────────────────────── */
.nav-burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
  padding: 0;
}
.nav-burger:hover { border-color: var(--ink); }

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
}
.mobile-drawer[hidden] { display: none; }
.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 32%, transparent);
  opacity: 0;
  transition: opacity .24s var(--ease, ease-out);
}
.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 360px);
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .24s var(--ease, ease-out);
  box-shadow: -8px 0 32px color-mix(in srgb, var(--ink) 10%, transparent);
}
.mobile-drawer.is-open .mobile-drawer-backdrop { opacity: 1; }
.mobile-drawer.is-open .mobile-drawer-panel { transform: translateX(0); }
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-2);
}
.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-drawer-nav {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.mobile-drawer-link {
  display: block;
  padding: 14px 22px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 450;
  letter-spacing: -0.005em;
  border-left: 2px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.mobile-drawer-link:hover { background: var(--bg-soft); }
.mobile-drawer-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.mobile-drawer-link--sub {
  font-size: 14px;
  color: var(--muted);
  padding: 10px 22px;
}
.mobile-drawer-foot {
  padding: 16px 22px 22px;
  border-top: 1px solid var(--border-2);
  background: var(--bg-soft);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .process { grid-template-columns: 1fr; gap: var(--s-7); }
  .cta-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .trust { grid-template-columns: 1fr; gap: var(--s-6); }
}
@media (max-width: 760px) {
  /* Navbar: hamburger reemplaza nav-links y botones de cuenta/staff */
  .nav-links { display: none; }
  .nav-burger { display: inline-flex; }
  .nav-staff-btn,
  .nav-auth-btn { display: none; }

  .cats { grid-template-columns: 1fr; gap: 0; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; }

  /* Process steps: layout vertical simple en mobile.
     El grid original tiene 3 columnas (número · kicker · texto) que no
     caben en mobile, así que pasamos a block-flow y mostramos el número
     como prefijo del kicker. */
  .process-step {
    display: block;
    padding: var(--s-5) 0;
  }
  .process-step::before {
    display: inline-block;
    margin-right: 10px;
    padding-top: 0;
    vertical-align: baseline;
  }
  .process-step .step-label {
    display: inline-block;
    font-size: clamp(1.8rem, 7vw, 2.4rem);
    margin-bottom: var(--s-3);
  }
  .process-step > div {
    margin-top: var(--s-2);
  }
  .process-step h3 { font-size: 17px; }
  .process-step p  { font-size: 14.5px; max-width: 100%; margin-top: 6px; }

  .exam { grid-template-columns: 1fr; row-gap: 12px; }
  .exam-right { flex-direction: row; align-items: center; justify-content: space-between; }
  .hero { min-height: auto; padding: var(--s-8) 0; }
  .hero-bg-overlay {
    background:
      linear-gradient(180deg,
        var(--bg) 0%,
        color-mix(in srgb, var(--bg) 85%, transparent) 45%,
        color-mix(in srgb, var(--bg) 50%, transparent) 70%,
        color-mix(in srgb, var(--bg) 88%, transparent) 100%);
  }
  .hero-meta { gap: var(--s-5); }

  /* Inline grids comunes: forzar a 1 columna y permitir shrink */
  [style*="grid-template-columns: 1fr 340px"],
  [style*="grid-template-columns: 1fr 360px"],
  [style*="grid-template-columns: 1fr 480px"] {
    grid-template-columns: 1fr !important;
    min-width: 0 !important;
  }
  /* Resúmenes sticky en mobile: no flotar */
  [style*="position: sticky"] {
    position: static !important;
    width: auto !important;
  }
  /* Texto largo sin guiones debe romper para no causar overflow */
  body { overflow-x: hidden; }
  main, .wrap, .wrap-lg, .wrap-sm { max-width: 100%; }
  h1, h2, h3, h4, p, a, span, div {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; gap: var(--s-5); }
  .foot-bottom { flex-direction: column; gap: 6px; }

  /* Wrap defensivo en padding lateral */
  .wrap, .wrap-lg, .wrap-sm {
    padding-left: var(--s-4);
    padding-right: var(--s-4);
  }
  /* Hero más compacto en pantallas pequeñas */
  .hero-title { font-size: clamp(2rem, 9vw, 3.2rem); }
  .hero-sub { font-size: 15px; }

  /* Inline grids 2-col en formularios mobile: colapsar a 1 columna */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ── Tablas admin: scroll horizontal en mobile ────────────────────── */
.admin-table-wrap {
  -webkit-overflow-scrolling: touch;
  position: relative;
}
.admin-table th,
.admin-table td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
/* La columna 'Examen' / 'Pack' es la de nombre largo: permitirle wrap
   manteniendo el min-width de la tabla para que igual haga scroll */
.admin-table th.col-fluid,
.admin-table td.col-fluid {
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  min-width: 240px;
}
@media (max-width: 760px) {
  .admin-table-wrap::after {
    content: '← desliza →';
    display: block;
    position: sticky;
    bottom: 0;
    left: 0;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    padding: 4px 0;
    background: linear-gradient(to top, var(--surface) 60%, transparent);
    pointer-events: none;
  }
}
