/* Guías · Servicios Logísticos 2022
   Hoja compartida por las páginas de /guias/ y las legales (/aviso-legal/, /privacidad/
   y /cookies/). La base (cabecera, pie, botones)
   copia la de index.html; si cambia allí, hay que cambiarla aquí también.
   Al modificar este archivo, sube el ?v= en las páginas para que no se quede en caché. */

/* Tipografías servidas desde nuestro hosting (latin). Licencia OFL */
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(/fonts/schibsted-grotesk-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: italic; font-weight: 500; font-display: swap; src: url(/fonts/schibsted-grotesk-italic-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-500-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-mono-600-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #0B1F33;
  --blue: #0B6FAE;
  --blue-soft: #E6F0F8;
  --accent: #FF5B24;
  --ground: #F2F4F6;
  --line: #DDE3E9;
  --line-soft: #EDF1F4;
  --muted: #3E5063;
  --muted-2: #5A6B7C;
  --sky: #7FB6E3;
  --navy-line: #24486B;
  --navy-text: #B4C3D2;
  --ok: #11613E;
  --ok-soft: #E3F4EC;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.ico { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 24px; border-radius: 6px; border: 0; font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn--sm { min-height: 46px; padding: 0 18px; font-size: 15px; }
.btn--lg { min-height: 58px; padding: 0 26px; font-size: 17px; }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--accent:hover { background: #FF7A4F; color: var(--ink); }
.btn--outline { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); font-weight: 600; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #17344F; color: #fff; }
.btn--ghost-dark { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn--ghost-dark:hover { background: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.eyebrow { margin: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--blue); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }

/* Barra superior */
.topbar { background: var(--ink); color: #C5D2DF; font-size: 13px; }
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-block: 10px; }
.topbar__info { display: flex; flex-wrap: wrap; gap: 6px 24px; align-items: center; }
.coords { font-family: var(--mono); letter-spacing: .06em; color: var(--sky); }
.topbar__right { display: flex; gap: 18px; align-items: center; }
.topbar__tel { color: #fff; text-decoration: none; font-weight: 600; }
.topbar__tel:hover { color: var(--accent); }

/* Cabecera */
/* El logo va encima del nombre y tan ancho como él (232 px). Al bajar, la cabecera sube lo que
   miden su relleno de arriba (16 px) y el logo, y se queda fija solo la franja del nombre, el menú
   y el botón. Con el hueco del logo también a 16 px, esa franja mide lo mismo que la cabecera de antes.
   El logo, el nombre y la línea de debajo van un 25 % más grandes que al principio (123 px, 19 px y 11 px) */
.header { --logo-h: 154px; --logo-gap: 16px; --name-size: 23.75px; --sub-size: 13.75px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: calc(-16px - var(--logo-h)); z-index: 20; }
.header .wrap { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-block: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__logo { width: auto; height: 44px; flex: none; }
.header .brand { flex-direction: column; align-items: flex-start; gap: var(--logo-gap); }
.header .brand__logo { height: var(--logo-h); }
.header .brand__text { min-height: 46px; justify-content: center; }
.header .brand__name { font-size: var(--name-size); }
.header .brand__sub { font-size: var(--sub-size); margin-top: 6px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-weight: 800; font-size: 19px; letter-spacing: -.015em; white-space: nowrap; }
.brand__sub { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--blue); margin-top: 5px; }
.nav { margin-bottom: 12px; } /* centra el menú con el botón de 46 px */
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; font-weight: 500; font-size: 15px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover, .nav a[aria-current] { color: var(--blue); }
.header__actions { display: flex; gap: 10px; align-items: center; }
.menu-toggle { display: none; width: 46px; height: 46px; align-items: center; justify-content: center; border: 1.5px solid #C9D3DD; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; }
.menu-toggle .i-close { display: none; }
.nav-open .menu-toggle .i-open { display: none; }
.nav-open .menu-toggle .i-close { display: block; }

/* ===== Cabecera de la guía ===== */
.g-hero { background: #fff; border-bottom: 1px solid var(--line); }
.g-hero .wrap { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: center; padding-block: clamp(32px, 5vw, 64px); }
.g-hero__copy { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted-2); }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 6px; color: #9AAABB; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--blue); }
.g-hero__tag { display: flex; align-items: center; gap: 10px; }
.g-hero h1 { margin: 0; font-size: clamp(36px, 4.6vw, 62px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.g-hero h1 span { color: var(--blue); }
.g-hero__lead { margin: 0; font-size: 19px; line-height: 1.55; color: var(--muted); max-width: 36em; }
.g-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--muted-2); }
.g-meta span { display: inline-flex; align-items: center; gap: 8px; }
.g-meta span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sky); }

/* Ilustración animada de la cabecera */
/* Los puntos del fondo van en CSS y no en el SVG: así no se repintan en cada fotograma de la animación */
.g-art { flex: 1 1 380px; min-width: 0; position: relative; aspect-ratio: 5 / 4; max-height: 420px; background-color: var(--ink); background-image: radial-gradient(#1B3A5A 1.4px, transparent 1.6px); background-size: 14px 14px; border-radius: 12px; overflow: hidden; }
.g-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.g-art__chip { position: absolute; top: 16px; left: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: #fff; background: #132C47; border: 1px solid var(--navy-line); padding: 6px 9px; border-radius: 4px; }
.art-dots { fill: #1B3A5A; }
.art-text { font-family: var(--mono); fill: var(--sky); letter-spacing: 1px; }

/* ===== Cuerpo: índice + artículo ===== */
.g-body .wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-block: clamp(40px, 6vw, 80px); align-items: start; }
.toc { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 8px 0 8px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.is-current { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
.prose { max-width: 780px; min-width: 0; }
.prose > section + section { margin-top: clamp(56px, 7vw, 88px); }
.prose h2 { margin: 0 0 18px; font-size: clamp(28px, 3vw, 38px); line-height: 1.08; letter-spacing: -.025em; font-weight: 800; }
.prose h3 { margin: 32px 0 10px; font-size: 21px; letter-spacing: -.01em; }
/* Solo el texto corrido del artículo; los párrafos y listas de los gráficos llevan sus propios estilos */
.prose > section > p, .prose ul:not([class]) > li, .faq p { font-size: 18px; line-height: 1.65; color: #24384D; }
.prose > section > p { margin: 0 0 16px; }
.prose ul:not([class]) { margin: 0 0 16px; padding-left: 22px; }
/* Solo las listas de texto normales; las de los gráficos (con clase) tienen su propio espaciado */
.prose ul:not([class]) > li + li { margin-top: 8px; }
.prose strong { color: var(--ink); }
.prose .num-label { font-family: var(--mono); font-size: 13px; letter-spacing: .14em; color: var(--blue); display: block; margin-bottom: 10px; }
.note { font-size: 14px !important; line-height: 1.55 !important; color: var(--muted-2) !important; }

/* Cifras clave con contador */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 28px 0 8px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: clamp(30px, 3vw, 38px); line-height: 1; letter-spacing: -.03em; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat span { font-size: 14px; line-height: 1.4; color: var(--muted); }

/* Aviso destacado */
.callout { display: flex; gap: 16px; margin: 28px 0; padding: 22px 24px; background: var(--blue-soft); border-left: 4px solid var(--blue); border-radius: 0 10px 10px 0; }
.callout--accent { background: #FFF1EB; border-left-color: var(--accent); }
.callout .ico { width: 24px; height: 24px; color: var(--blue); margin-top: 3px; }
.callout--accent .ico { color: #C4400F; }
/* Para que un texto largo sin espacios (un email) parta línea en vez de salirse en móviles estrechos */
.callout > div { min-width: 0; overflow-wrap: break-word; }
.callout h3 { margin: 0 0 6px; font-size: 19px; }
.callout p { margin: 0; font-size: 16px; line-height: 1.6; }
.callout p + p { margin-top: 8px; }

/* Panel blanco para los gráficos interactivos */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: clamp(20px, 3vw, 32px); margin: 28px 0; }
.panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; margin-bottom: 20px; }
.panel__head h3 { margin: 0; font-size: 20px; }
.panel__head span { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; color: var(--muted-2); }

/* ===== Línea de pasos vertical (se rellena al bajar) ===== */
.vsteps { list-style: none; margin: 28px 0; padding: 0; position: relative; --fill: 0; }
.vsteps::before, .vsteps::after { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 3px; border-radius: 2px; background: var(--line); }
.vsteps::after { background: var(--accent); transform-origin: top; transform: scaleY(var(--fill)); transition: transform .5s var(--ease); }
.vsteps li { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; padding-bottom: 28px; }
.vsteps li:last-child { padding-bottom: 0; }
.vsteps__mark { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 2px solid #C9D3DD; color: var(--muted-2); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 600; font-size: 15px; transition: background-color .3s, border-color .3s, color .3s, transform .3s var(--ease); }
.vsteps li.is-on .vsteps__mark { background: var(--accent); border-color: var(--accent); color: var(--ink); transform: scale(1.06); }
.vsteps h3 { margin: 8px 0 6px; font-size: 21px; }
.vsteps p { margin: 0; font-size: 17px !important; }
.vsteps .who { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; padding: 4px 8px; border-radius: 4px; background: var(--ground); color: var(--muted); }

/* ===== Calculadora (guía del coche) ===== */
.calc__form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px 20px; }
.calc label, .calc legend { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.calc input[type="number"], .calc select { height: 52px; padding: 0 14px; border: 1.5px solid #C9D3DD; border-radius: 6px; font: inherit; font-size: 17px; font-weight: 500; color: var(--ink); background: #fff; width: 100%; }
.calc input:focus, .calc select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(11, 111, 174, .2); }
.calc fieldset { border: 0; margin: 0; padding: 0; min-width: 0; grid-column: 1 / -1; }
.calc legend { padding: 0; margin-bottom: 10px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; border: 1.5px solid #C9D3DD; border-radius: 6px; font-weight: 600; font-size: 15px; transition: border-color .15s, background-color .15s; }
.seg span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #9AAABB; flex: none; transition: border-color .15s, box-shadow .15s; }
.seg input:checked + span { border-color: var(--ink); background: #F7F9FA; }
.seg input:checked + span::before { border-color: var(--ink); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 8px var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.calc__out { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.calc__total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.calc__total span { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; color: var(--muted-2); }
.calc__total b { font-size: clamp(36px, 5vw, 52px); line-height: 1; letter-spacing: -.04em; font-weight: 800; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 22px; margin: 20px 0 16px; border-radius: 6px; overflow: hidden; background: var(--line-soft); }
.stack i { display: block; height: 100%; width: 0; transition: width .7s var(--ease); }
.c-base { background: var(--ink); }
.c-duty { background: var(--blue); }
.c-vat { background: var(--sky); }
.c-reg { background: var(--accent); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 32px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 15px; color: var(--muted); }
.legend li i { width: 12px; height: 12px; border-radius: 3px; }
.legend li b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ===== Lista de documentos con progreso ===== */
.checker { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist label { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .2s, background-color .2s; }
.checklist label:hover { border-color: #9AAABB; }
.checklist input { position: absolute; opacity: 0; pointer-events: none; }
.checklist .box { width: 28px; height: 28px; border-radius: 6px; border: 2px solid #9AAABB; display: flex; align-items: center; justify-content: center; color: #fff; transition: background-color .2s, border-color .2s; }
.checklist .box .ico { width: 16px; height: 16px; transform: scale(0); transition: transform .25s var(--ease); }
.checklist input:checked + label { border-color: var(--ok); background: #F6FBF8; }
.checklist input:checked + label .box { background: var(--ok); border-color: var(--ok); }
.checklist input:checked + label .box .ico { transform: scale(1); }
.checklist input:focus-visible + label { outline: 3px solid var(--blue); outline-offset: 2px; }
.checklist b { display: block; font-size: 17px; }
.checklist small { display: block; margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.checklist .from { display: inline-flex; gap: 6px; margin-top: 8px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.checklist .req { color: #C4400F; }
.ring { position: sticky; top: 110px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 24px 16px; background: var(--ink); color: #fff; border-radius: 12px; }
.ring__dial { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { fill: none; stroke: #1F3D5C; stroke-width: 12; }
.ring__bar { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .6s var(--ease), stroke .3s; }
.ring.is-done .ring__bar { stroke: #3DDC97; }
.checklist li { position: relative; }
.ring__num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 36px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.prose .ring__msg { margin: 0; font-size: 15px; line-height: 1.45; color: var(--navy-text); min-height: 3em; }

/* ===== Recorrido del contenedor (horizontal) ===== */
.journey { position: relative; padding: 10px 0 0; }
.journey__track { position: relative; height: 70px; margin: 0 8.333%; }
.journey__line { position: absolute; left: 0; right: 0; top: 56px; height: 3px; background: var(--line); border-radius: 2px; }
.journey__fill { position: absolute; left: 0; top: 56px; height: 3px; width: var(--pos, 0%); background: var(--accent); border-radius: 2px; transition: width .8s var(--ease); }
.journey__box { position: absolute; top: 0; left: var(--pos, 0%); width: 52px; height: 30px; margin-left: -26px; transition: left .8s var(--ease); }
.journey__box svg { width: 100%; height: 100%; display: block; animation: bob 2.4s ease-in-out infinite; }
.journey__stops { position: relative; list-style: none; margin: -24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.journey__stops li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; line-height: 1.3; color: var(--muted-2); cursor: pointer; }
.journey__stops li button { all: unset; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; border-radius: 6px; padding: 4px; }
.journey__stops li button:focus-visible { outline: 3px solid var(--blue); }
.journey__stops .pt { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #C9D3DD; transition: border-color .3s, background-color .3s; }
.journey__stops li.is-on { color: var(--ink); font-weight: 600; }
.journey__stops li.is-on .pt { border-color: var(--accent); background: var(--accent); }
.journey__info { margin-top: 22px; padding: 18px 20px; background: var(--ground); border-radius: 10px; min-height: 96px; }
.journey__info b { display: block; font-size: 17px; margin-bottom: 4px; }
.journey__info p { margin: 0; font-size: 16px !important; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Errores frecuentes */
.errs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 24px 0; }
.err { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.err b { display: flex; gap: 10px; align-items: center; font-size: 17px; margin-bottom: 6px; }
.err b::before { content: "!"; width: 24px; height: 24px; flex: none; border-radius: 50%; background: #FFE3D8; color: #C4400F; font-family: var(--mono); font-size: 14px; display: flex; align-items: center; justify-content: center; }
.err p { margin: 0; font-size: 15px !important; line-height: 1.55 !important; }

/* ===== Glosario ===== */
.g-search { display: flex; flex-direction: column; gap: 14px; margin: 24px 0; }
.g-search label { font-size: 14px; font-weight: 600; }
.g-search input { height: 56px; padding: 0 18px; border: 1.5px solid #C9D3DD; border-radius: 8px; font: inherit; font-size: 18px; color: var(--ink); background: #fff; width: 100%; }
.g-search input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(11, 111, 174, .2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #C9D3DD; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.g-count { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; color: var(--muted-2); }
.terms { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.term { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; animation: pop .35s var(--ease) both; }
.term[hidden] { display: none; }
.term dt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.term dt span { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); white-space: nowrap; }
.term dd { margin: 0; font-size: 16px; line-height: 1.6; color: var(--muted); }
.term dd a { font-weight: 600; }
.g-empty { margin: 16px 0 0; padding: 20px; background: #fff; border: 1px dashed #C9D3DD; border-radius: 10px; color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Semáforo de circuitos */
.lights { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 28px; align-items: center; }
.light-pole { background: var(--ink); border-radius: 60px; padding: 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.lamp { width: 64px; height: 64px; border-radius: 50%; background: #1F3D5C; transition: background-color .3s, box-shadow .3s; }
.lights[data-on="verde"] .lamp--verde { background: #3DDC97; box-shadow: 0 0 28px #3DDC97; }
.lights[data-on="naranja"] .lamp--naranja { background: #FFB020; box-shadow: 0 0 28px #FFB020; }
.lights[data-on="rojo"] .lamp--rojo { background: #FF4D4D; box-shadow: 0 0 28px #FF4D4D; }
.light-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.light-list button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .2s, transform .2s var(--ease); }
.light-list button:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.light-list button[aria-pressed="true"] { border-color: var(--ink); transform: translateX(6px); }
.light-list b { display: block; font-size: 17px; margin-bottom: 4px; }
.light-list span { display: block; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* Ruta del tránsito T1 */
.t1 { position: relative; background: var(--ink); border-radius: 12px; overflow: hidden; aspect-ratio: 10 / 3; margin: 24px 0; }
.t1 svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.t1__road { fill: none; stroke: #2C5A80; stroke-width: 3; stroke-dasharray: 2 10; stroke-linecap: round; }
.t1__done { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 600; stroke-dashoffset: 600; animation: road 6s var(--ease) infinite; }
.t1__truck { offset-path: path("M90,170 C220,150 300,80 430,90 S620,120 720,70"); offset-rotate: auto; animation: drive 6s var(--ease) infinite; }
.t1 text { font-family: var(--mono); fill: #fff; font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.t1 .t-sub { fill: var(--sky); font-size: 15px; font-weight: 400; }
@keyframes drive { 0% { offset-distance: 0%; } 70%, 100% { offset-distance: 100%; } }
@keyframes road { 0% { stroke-dashoffset: 600; } 70%, 100% { stroke-dashoffset: 0; } }

/* ===== Incoterms ===== */
.inco-pick { display: flex; flex-direction: column; gap: 14px; margin-bottom: 26px; }
.inco-pick p { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.inco-pick .chips { gap: 6px; }
.inco-pick .chip { font-family: var(--mono); letter-spacing: .06em; min-width: 62px; }
.chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; position: relative; }
.chain li { display: flex; flex-direction: column; gap: 10px; }
.chain .cell { height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--blue); transition: background-color .45s var(--ease), color .45s; }
.chain .cell .ico { width: 24px; height: 24px; }
.chain li.s .cell { background: var(--accent); color: var(--ink); }
.chain small { font-size: 13px; line-height: 1.3; color: var(--muted); text-align: center; }
.chain__risk { position: absolute; top: 26px; height: 80px; width: 0; left: var(--risk, 0%); transition: left .6s var(--ease); pointer-events: none; }
.chain__risk::before { content: ""; position: absolute; left: -2px; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--ink); }
.chain__risk span { position: absolute; top: -26px; left: 0; transform: translateX(var(--shift, -50%)); white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; background: var(--ink); color: #fff; padding: 3px 7px; border-radius: 4px; }
.chain__wrap { position: relative; padding-top: 34px; }
.inco-key { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 22px 0 0; font-size: 14px; color: var(--muted); }
.inco-key span { display: inline-flex; align-items: center; gap: 8px; }
.inco-key i { width: 14px; height: 14px; border-radius: 4px; }
.inco-desc { margin-top: 22px; padding: 20px 22px; background: var(--ground); border-radius: 10px; }
.inco-desc h3 { margin: 0 0 6px; font-size: 20px; }
.inco-desc p { margin: 0; font-size: 16px !important; }
.inco-desc .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.inco-desc .tags span { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; padding: 4px 8px; border-radius: 4px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin: 24px 0; }
.t-inco { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 15px; }
.t-inco th, .t-inco td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.t-inco thead th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); background: #F7F9FA; }
.t-inco tbody tr:last-child td, .t-inco tbody tr:last-child th { border-bottom: 0; }
.t-inco tbody th { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.t-inco tbody th small { display: block; font-family: var(--font); font-weight: 400; font-size: 13px; color: var(--muted-2); white-space: normal; }
.t-inco .grp td { background: var(--ink); color: #fff; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.t-inco tr.is-sel th, .t-inco tr.is-sel td { background: #FFF1EB; }
.v { font-weight: 600; color: #C4400F; }
.c { font-weight: 600; color: var(--blue); }

/* Preguntas frecuentes */
.faq { border-bottom: 1px solid var(--line); }
.faq:first-of-type { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 0; font-size: 19px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-family: var(--mono); font-size: 24px; line-height: 1; color: var(--blue); transition: transform .25s var(--ease); }
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0 0 20px; }

/* ===== Otras guías ===== */
.related { background: #fff; border-top: 1px solid var(--line); }
.related .wrap { padding-block: clamp(56px, 7vw, 88px); }
.related h2 { margin: 12px 0 32px; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.025em; }
.guides { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.guide { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 28px; min-height: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.guide:hover { border-color: var(--ink); transform: translateY(-2px); color: var(--ink); }
.guide__body { display: flex; flex-direction: column; gap: 14px; }
.guide__tag { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--blue); }
.guide__title { font-size: 22px; font-weight: 700; line-height: 1.2; letter-spacing: -.015em; }
.guide__go { align-self: flex-end; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: center; transition: background-color .15s, border-color .15s; }
.guide__go .ico { width: 18px; height: 18px; }
.guide:hover .guide__go { background: var(--accent); border-color: var(--accent); }

/* ===== Páginas legales ===== */
/* Son solo texto: se pintan enteras al cargar, así el índice salta siempre al sitio exacto */
.prose.prose--legal > section { content-visibility: visible; }
.data { display: grid; grid-template-columns: 190px minmax(0, 1fr); margin: 24px 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.data dt, .data dd { margin: 0; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.data dt:first-of-type, .data dd:first-of-type { border-top: 0; }
.data dt { font-family: var(--mono); font-size: 12px; line-height: 25.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); background: #F7F9FA; }
.data dd { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
/* Datos que faltan por rellenar: buscar "Pendiente" antes de publicar */
mark { padding: 1px 5px; border-radius: 3px; background: #FFE3D8; color: var(--ink); }

/* Llamada a la acción */
.cta { background: var(--accent); color: var(--ink); border-top: 2px solid var(--ink); }
.cta :focus-visible { outline-color: var(--ink); } /* el foco azul apenas se ve sobre el naranja */
.cta .wrap { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-end; justify-content: space-between; padding-block: clamp(56px, 7vw, 96px); }
.cta__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.cta h2 { margin: 0; font-size: clamp(32px, 4.2vw, 58px); line-height: 1; letter-spacing: -.035em; font-weight: 800; }
.cta__tel { color: var(--ink); text-decoration: none; font-size: clamp(44px, 6.4vw, 92px); line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.cta__tel:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 10px; }

/* Pie */
.footer { background: var(--ink); color: #C5D2DF; overflow: hidden; }
.footer .wrap { padding-top: 80px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 56px; }
.footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px; }
.footer__col { display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.5; }
.footer__col a { color: #C5D2DF; text-decoration: none; }
.footer__col a:hover { color: #fff; text-decoration: underline; }
.footer__label { margin: 0 0 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--sky); }
.footer .brand { color: #fff; }
.footer .brand__sub { color: var(--sky); }
.footer .brand__logo { height: 36px; padding: 4px 6px; background: #fff; border-radius: 6px; }
.footer__tel { color: #fff !important; font-weight: 700; font-size: 18px; }
.footer__coords { margin: 0; font-family: var(--mono); font-weight: 500; font-size: clamp(40px, 9.4vw, 136px); line-height: 1; letter-spacing: -.05em; color: #16324F; white-space: nowrap; }
.footer__coords::before { content: attr(data-text); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; border-top: 1px solid var(--navy-line); font-size: 13px; }
.footer__bottom nav { display: flex; gap: 20px; }
.footer__bottom a { color: #C5D2DF; }
.footer__signature { margin-top: -32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; text-align: center; }
.footer__signature a { display: inline-flex; line-height: 0; opacity: .9; transition: opacity .2s; }
.footer__signature a:hover { opacity: 1; }
.footer__signature img { width: auto; height: 40px; border-radius: 4px; }
.footer__signature span { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: #C5D2DF; }

.mobile-bar { display: none; }

/* Animaciones de las ilustraciones de cabecera */
.a-bob { transform-box: fill-box; transform-origin: center; animation: bob 3.2s ease-in-out infinite; }
.a-wave { animation: wave 7s linear infinite; }
.a-wave--slow { animation-duration: 11s; }
.a-dash { stroke-dasharray: 6 7; animation: dash2 1.6s linear infinite; }
.a-pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.2s ease-out infinite; }
.a-doc { transform-box: fill-box; transform-origin: center bottom; opacity: 0; animation: doc 7s var(--ease) infinite; }
/* Siglas que se van turnando en la cabecera del glosario (HTML encima del SVG) */
.cycle { position: absolute; left: 12%; right: 12%; top: 22%; bottom: 26%; display: grid; place-items: center; text-align: center; pointer-events: none; }
.cycle__item { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 12px; opacity: 0; animation: cycle 12.5s var(--ease) infinite; }
.cycle__item b { font-size: clamp(52px, 7vw, 80px); line-height: 1; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.cycle__item small { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--sky); }
.cycle__item:nth-child(2) { animation-delay: 2.5s; }
.cycle__item:nth-child(2) b { color: var(--accent); }
.cycle__item:nth-child(3) { animation-delay: 5s; }
.cycle__item:nth-child(4) { animation-delay: 7.5s; }
.cycle__item:nth-child(4) b { color: var(--sky); }
.cycle__item:nth-child(5) { animation-delay: 10s; }
.a-bar { transform-box: fill-box; transform-origin: left center; animation: incobar 12s var(--ease) infinite; }
.a-marker { animation: incomark 12s var(--ease) infinite; }
@keyframes wave { to { transform: translateX(-80px); } }
@keyframes dash2 { to { stroke-dashoffset: -26; } }
@keyframes pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes doc { 0% { opacity: 0; transform: translateY(26px) scale(.92); } 10%, 82% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes cycle { 0% { opacity: 0; transform: translateY(14px); } 3%, 17% { opacity: 1; transform: none; } 20%, 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes incobar { 0%, 10% { transform: scaleX(.02); } 16%, 26% { transform: scaleX(.21); } 32%, 42% { transform: scaleX(.37); } 48%, 58% { transform: scaleX(.6); } 64%, 74% { transform: scaleX(.84); } 80%, 92% { transform: scaleX(1); } 100% { transform: scaleX(.02); } }
@keyframes incomark { 0%, 10% { transform: translateX(0); } 16%, 26% { transform: translateX(80px); } 32%, 42% { transform: translateX(140px); } 48%, 58% { transform: translateX(230px); } 64%, 74% { transform: translateX(320px); } 80%, 92% { transform: translateX(380px); } 100% { transform: translateX(0); } }

/* Lo que está fuera de pantalla al cargar no se maqueta hasta que te acercas: el primer
   layout de la página pasa de ~90 ms a una fracción. "auto" recuerda el tamaño real después. */
.prose > section, .related, .cta, .footer { content-visibility: auto; contain-intrinsic-size: auto 700px; }
.related { contain-intrinsic-size: auto 480px; }
.cta { contain-intrinsic-size: auto 380px; }
.footer { contain-intrinsic-size: auto 560px; }

/* Las animaciones de los dibujos solo corren mientras se ven (el JS añade .is-on).
   Así no gastan procesador cuando están fuera de pantalla. */
.js .g-art:not(.is-on) *, .js .t1:not(.is-on) * { animation-play-state: paused !important; }

/* Aparición al bajar (solo si hay JavaScript) */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ===== Adaptación a pantallas ===== */
/* Entre 901 y 1040 px el menú y el botón no caben con los huecos normales y se parten en dos líneas */
@media (max-width: 1040px) {
  .header .wrap { gap: 16px; }
  .nav ul { gap: 18px; }
}
/* Donde no cabe con el tamaño grande (pantallas de 901 a 960 px y móviles de menos de 330 px),
   el logo y el nombre vuelven al tamaño de antes */
@media (max-width: 330px), (min-width: 901px) and (max-width: 960px) {
  .header { --logo-h: 123px; --name-size: 19px; --sub-size: 11px; }
}
@media (max-width: 1000px) {
  .g-body .wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .toc { position: static; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: 8px; border-left: 0; }
  .toc a { margin: 0; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; background: #fff; }
  .toc a.is-current { border-color: var(--ink); }
}
@media (max-width: 900px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 20px 30px rgba(11, 31, 51, .08); }
  .nav-open .nav { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px clamp(16px, 4vw, 40px) 16px; }
  .nav a { display: flex; min-height: 52px; align-items: center; border-bottom: 1px solid var(--line-soft); font-size: 17px; }
  .menu-toggle { display: inline-flex; }
  .hide-md { display: none !important; }
  .checker { grid-template-columns: minmax(0, 1fr); }
  .ring { position: sticky; top: 84px; z-index: 5; order: -1; flex-direction: row; text-align: left; padding: 14px 16px; box-shadow: 0 10px 24px rgba(11, 31, 51, .18); }
  .ring__dial { width: 96px; height: 96px; }
  .ring__num { font-size: 24px; }
  .ring__msg { min-height: 0; }
}
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .topbar__addr { display: none; }
  .mobile-bar { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px rgba(11, 31, 51, .10); }
  .mobile-bar .btn { flex: 1 1 auto; }
  .mobile-bar__call { width: 56px; height: 56px; flex: none; border-radius: 6px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; }
  .mobile-bar__call:hover { color: #fff; }
  .site { padding-bottom: 84px; }
  .prose > section > p, .prose ul:not([class]) > li, .faq p { font-size: 17px; }
  .data { grid-template-columns: minmax(0, 1fr); }
  .data dt { padding-bottom: 0; background: none; }
  .data dd { padding-top: 2px; border-top: 0; }
  .journey__stops { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; margin-top: 0; }
  .journey__track { display: none; }
  .t1 .t-sub { display: none; }
  .lights { grid-template-columns: 84px minmax(0, 1fr); gap: 16px; }
  .lamp { width: 44px; height: 44px; }
  .light-pole { padding: 12px; gap: 10px; }
  /* En móvil la cadena va en vertical: un tramo por fila y la línea del riesgo en horizontal */
  .chain { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .chain li { flex-direction: row; align-items: center; gap: 14px; }
  .chain .cell { width: 64px; height: 44px; flex: none; border-radius: 6px; }
  .chain .cell .ico { width: 20px; height: 20px; }
  .chain small { font-size: 15px; text-align: left; }
  .chain__wrap { padding-top: 6px; }
  .chain__risk { left: 0; right: 0; width: auto; height: 0; top: calc(3px + var(--i, 0) * 50px); transition: top .6s var(--ease); }
  .chain__risk::before { left: 0; right: 0; top: -2px; bottom: auto; width: auto; height: 4px; }
  .chain__risk span { top: -11px; left: auto; right: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .t1__truck { offset-distance: 100%; }
  .t1__done { stroke-dashoffset: 0; }
  .a-doc { opacity: 1; }
  .cycle__item:first-child { opacity: 1; }
}
