/* Legalin · cabecera común (fija) y botón flotante de WhatsApp. Mismo header en todo el sitio (9-11-2026).
   Clases con prefijo lg- para no chocar con los estilos de portada, guías y páginas de servicio. */
@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage-variable.woff2") format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-italic-variable.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

html { scroll-padding-top: 6rem; }

.lg-top {
  --lg-forest: #145c45; --lg-forest-deep: #0f4a37; --lg-mandarin: #ffb15e; --lg-ink: #183029;
  --lg-paper: #f7f8f2; --lg-shirt: #fffdf7; --lg-graphite: #44464b; --lg-line: rgba(24, 48, 41, .14);
  position: sticky; top: 0; z-index: 60;
  background: #f7f8f2; /* opaco: el logo PNG trae fondo del mismo tono */
  border-bottom: 1px solid transparent;
  font-family: "Bricolage", system-ui, sans-serif; color: var(--lg-ink); line-height: 1.3;
  transition: border-color .2s, box-shadow .2s;
}
.lg-top.is-scrolled { border-bottom-color: var(--lg-line); box-shadow: 0 10px 24px -20px rgba(24, 48, 41, .45); }
.lg-top *, .lg-top *::before, .lg-top *::after { box-sizing: border-box; }
.lg-top a { -webkit-tap-highlight-color: transparent; }
.lg-top a:focus-visible, .lg-top summary:focus-visible { outline: 3px solid #5c465d; outline-offset: 3px; border-radius: 6px; }

.lg-top-in {
  display: flex; align-items: center; gap: 1.5rem;
  max-width: 84rem; margin: 0 auto; min-height: 4.5rem;
  padding: .55rem clamp(1rem, 4.5vw, 4.5rem);
}
.lg-logo { display: block; flex-shrink: 0; line-height: 0; }
.lg-logo img { display: block; width: 8.25rem; height: auto; }

.lg-nav { display: flex; align-items: center; gap: clamp(1.1rem, 2.2vw, 2rem); margin-inline: auto; font-size: .9375rem; }
.lg-nav a { position: relative; white-space: nowrap; color: var(--lg-graphite); text-decoration: none; padding-block: .5rem; transition: color .15s; }
.lg-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--lg-mandarin); transform: scaleX(0); transform-origin: left; transition: transform .2s cubic-bezier(.2, 0, 0, 1); }
.lg-nav a[aria-current="page"] { color: var(--lg-forest); font-weight: 600; }
.lg-nav a[aria-current="page"]::after { transform: scaleX(1); }
@media (hover: hover) { .lg-nav a:hover { color: var(--lg-forest); } .lg-nav a:hover::after { transform: scaleX(1); } }

.lg-actions { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }

/* «Te lo explico» + nota a mano «artículos · blog» que apunta al botón */
.lg-explica-wrap { position: relative; display: inline-flex; }
.lg-explica {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .55rem 1.15rem;
  border-radius: 999px; background: var(--lg-forest); color: var(--lg-shirt);
  font-weight: 650; font-size: .95rem; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .12s;
}
.lg-explica:active { transform: scale(.96); }
.lg-explica.is-current { box-shadow: 0 0 0 3px var(--lg-paper), 0 0 0 5px var(--lg-mandarin); }
@media (hover: hover) { .lg-explica:hover { background: var(--lg-forest-deep); } }
.lg-nota {
  position: absolute; top: calc(100% + .1rem); left: -.35rem;
  display: flex; align-items: flex-start; gap: .1rem;
  font-family: "Newsreader", Georgia, serif; font-style: italic; font-weight: 600;
  font-size: .95rem; line-height: 1; color: var(--lg-forest); white-space: nowrap;
  pointer-events: none; transition: opacity .25s, transform .25s cubic-bezier(.2, 0, 0, 1);
}
.lg-nota svg { width: 1.6rem; height: 1.45rem; flex-shrink: 0; color: var(--lg-mandarin); margin-top: -.2rem; }
.lg-nota span { padding: .5rem .3rem .15rem 0; text-shadow: 0 0 6px var(--lg-paper), 0 0 2px var(--lg-paper); }
.lg-top.is-scrolled .lg-nota { opacity: 0; transform: translateY(-6px); }

.lg-wa {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .45rem 1rem .45rem .8rem;
  border: 1px solid var(--lg-line); border-radius: 999px; color: var(--lg-ink);
  font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: border-color .15s, background .15s;
}
.lg-wa svg { width: 1.1rem; height: 1.1rem; color: var(--lg-forest); }
@media (hover: hover) { .lg-wa:hover { border-color: var(--lg-forest); background: var(--lg-shirt); } }

.lg-top .language-switch { margin: 0 0 0 .25rem; width: auto; font-size: .78rem; }

/* Menú en pantallas chicas */
.lg-menu { display: none; position: relative; }
.lg-menu > summary {
  list-style: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border: 1px solid var(--lg-line); border-radius: 999px; cursor: pointer; color: var(--lg-ink);
}
.lg-menu > summary::-webkit-details-marker { display: none; }
.lg-menu > summary svg { width: 1.2rem; height: 1.2rem; }
.lg-menu .lg-ico-x { display: none; }
.lg-menu[open] .lg-ico-x { display: block; }
.lg-menu[open] .lg-ico-menu { display: none; }
.lg-menu-panel {
  position: absolute; right: 0; top: calc(100% + .6rem); width: min(18rem, calc(100vw - 2rem));
  padding: .5rem; border: 1px solid var(--lg-line); border-radius: 1rem; background: var(--lg-shirt);
  box-shadow: 0 1px 1px rgba(24, 48, 41, .04), 0 18px 40px -16px rgba(24, 48, 41, .35);
}
.lg-menu-panel > a {
  display: flex; align-items: center; min-height: 2.9rem; padding: .3rem .85rem; border-radius: .6rem;
  color: var(--lg-ink); text-decoration: none; font-size: 1rem;
}
.lg-menu-panel > a[aria-current="page"] { color: var(--lg-forest); font-weight: 650; background: rgba(20, 92, 69, .07); }
.lg-menu-panel .lg-menu-wa { margin-top: .35rem; border-top: 1px solid var(--lg-line); border-radius: 0 0 .6rem .6rem; color: var(--lg-forest); font-weight: 650; gap: .5rem; }
.lg-menu-panel .lg-menu-wa svg { width: 1.1rem; height: 1.1rem; }
.lg-menu-panel .language-switch { justify-content: flex-start; padding: 0 .6rem; margin: 0; border-top: 1px solid var(--lg-line); }

@media (max-width: 1280px) {
  .lg-nav, .lg-actions > .language-switch { display: none; }
  .lg-actions { margin-left: auto; }
  .lg-menu { display: block; }
}
@media (max-width: 640px) {
  .lg-top-in { gap: .75rem; min-height: 4rem; padding-block: .45rem; }
  .lg-logo img { width: 6.6rem; }
  .lg-actions { gap: .5rem; }
  .lg-wa { display: none; }
  .lg-explica { min-height: 2.6rem; padding: .45rem .95rem; font-size: .875rem; }
  .lg-nota { font-size: .85rem; left: -.2rem; }
  .lg-nota svg { width: 1.35rem; height: 1.25rem; }
  .lg-menu > summary { width: 2.6rem; height: 2.6rem; }
}
@media (max-width: 340px) { .lg-logo img { width: 5.6rem; } .lg-explica { padding-inline: .7rem; } }

/* Botón flotante de WhatsApp, visible en todo momento */
.lg-wa-flota {
  position: fixed; z-index: 45;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(max(1rem, env(safe-area-inset-bottom)) + var(--lg-wa-alza, 0px));
  display: inline-flex; align-items: center; gap: .55rem;
  height: 3.5rem; padding: 0 1.25rem 0 1rem; border-radius: 999px;
  background: #145c45; color: #fffdf7; text-decoration: none;
  font-family: "Bricolage", system-ui, sans-serif; font-weight: 650; font-size: 1rem; line-height: 1;
  box-shadow: 0 0 0 2px rgba(255, 253, 247, .95), 0 2px 4px rgba(24, 48, 41, .12), 0 14px 30px -10px rgba(15, 74, 55, .55);
  transition: bottom .25s cubic-bezier(.2, 0, 0, 1), transform .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.lg-wa-flota svg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }
.lg-wa-flota::before {
  content: ""; position: absolute; top: .35rem; left: 2.1rem; width: .6rem; height: .6rem; border-radius: 50%;
  background: #ffb15e; box-shadow: 0 0 0 2px #145c45;
}
.lg-wa-flota:active { transform: scale(.95); }
.lg-wa-flota:focus-visible { outline: 3px solid #5c465d; outline-offset: 3px; }
@media (hover: hover) { .lg-wa-flota:hover { background: #0f4a37; transform: translateY(-2px); } }
@media (max-width: 640px) {
  .lg-wa-flota { width: 3.5rem; padding: 0; justify-content: center; }
  .lg-wa-flota span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lg-wa-flota::before { left: auto; right: .55rem; top: .55rem; }
}
@media (prefers-reduced-motion: reduce) { .lg-top, .lg-nota, .lg-wa-flota, .lg-nav a::after { transition: none; } }
@media print { .lg-top, .lg-wa-flota { display: none !important; } }

/* Convivencia con lo que ya era fijo o pegajoso en las páginas */
body .guide-map { top: 6rem; }
.skip:focus, .skip-link:focus, .skip:focus-visible, .skip-link:focus-visible { z-index: 80; }

/* Portada · nota de comisión en el paso 03 de «Cómo funciona» (reemplaza a «Quién hace qué») */
.how-step .how-nota { margin-top: .9rem; padding-left: .85rem; border-left: 2px solid #ffb15e; max-width: 44ch; font-size: .875rem; line-height: 1.5; color: rgba(247, 248, 242, .8); }
