/* Barra de navegación común de las páginas públicas. La pone en cada página
   ~/Projects/Taxipilot Web/herramientas/poner-navegacion.py (entre <!-- NAV --> y <!-- /NAV -->).
   Todo con prefijo tpn- para no chocar con los estilos de cada página. */

/* Cambio de página suave entre páginas de la web (Chrome/Edge 126+, Safari 18.2+; el resto, normal) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: tpn-salir .16s ease-in both; }
::view-transition-new(root) { animation: tpn-entrar .22s ease-out both; }
@keyframes tpn-salir { to { opacity: 0; transform: translateY(-6px); } }
@keyframes tpn-entrar { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

.tpn, .tpn-lateral {
  --tpn-bg: rgba(11, 11, 12, .78);
  --tpn-line: #26262a;
  --tpn-text: #f4f4f5;
  --tpn-muted: #a1a1aa;
  --tpn-yellow: #f2c40f;
}
.tpn {
  position: sticky; top: 0; z-index: 2000;
  background: var(--tpn-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--tpn-line);
  view-transition-name: tpn;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-top: env(safe-area-inset-top);
}
.tpn *, .tpn-lateral * { box-sizing: border-box; }
/* Que no se cuelen los estilos de cada página (ul en rejilla, details con margen, li con color…) */
.tpn ul, .tpn-lateral ul { display: block; gap: 0; margin: 0; padding: 0; list-style: none; }
.tpn li, .tpn-lateral li { color: inherit; font-size: inherit; margin: 0; }
.tpn details, .tpn summary { margin: 0; }
.tpn-in { max-width: 1120px; margin: 0 auto; padding: 0 16px; min-height: 60px; display: flex; align-items: center; gap: 12px; }
.tpn a { color: var(--tpn-text); text-decoration: none; }
.tpn-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.08rem; margin-right: auto; }
.tpn-logo img { width: 34px; height: 34px; border-radius: 9px; display: block; }

/* Pestañas: debajo del título de Información, Tarifas, Descanso y Aeropuerto (cambian sin recargar, ver nav.js) */
.tpn-tabs { --tpn-line: #26262a; --tpn-text: #f4f4f5; --tpn-muted: #a1a1aa; --tpn-yellow: #f2c40f; margin: 0 0 22px; view-transition-name: tpn-tabs; width: min(1088px, calc(100vw - 32px)); position: relative; left: 50%; transform: translateX(-50%); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.tpn-tabs .tpn-pestanas { display: flex; width: 100%; align-items: center; gap: 4px; margin: 0; padding: 4px; list-style: none; background: rgba(255, 255, 255, .04); border: 1px solid var(--tpn-line); border-radius: 14px; max-width: 100%; }
.tpn-tabs li { flex: 1; margin: 0; color: inherit; font-size: inherit; }
.tpn-tabs a {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px;
  color: var(--tpn-muted); font-size: .94rem; font-weight: 600; white-space: nowrap; text-decoration: none; transition: color .15s, background .15s;
}
.tpn-tabs a svg { width: 17px; height: 17px; flex: none; }
.tpn-tabs a:hover { color: var(--tpn-text); background: rgba(255, 255, 255, .06); }
.tpn-tabs a[aria-current="page"] { color: #111; background: var(--tpn-yellow); }
.tpn-tabs a:focus-visible { outline: 3px solid var(--tpn-yellow); outline-offset: 2px; }

/* Línea de carga mientras llega la página nueva */
.tpn-carga { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--tpn-yellow); opacity: 0; }
.tpn.tpn-cargando .tpn-carga { opacity: 1; animation: tpn-cargar 1.2s ease-out forwards; }
@keyframes tpn-cargar { from { width: 0; } to { width: 85%; } }

.tpn-panel {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--tpn-yellow); color: #111 !important; font-weight: 800; font-size: .93rem;
}
.tpn-panel:hover { filter: brightness(1.08); }

.tpn-abrir { display: grid; flex: none; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--tpn-line); background: none; color: var(--tpn-text); cursor: pointer; place-items: center; }
.tpn-abrir svg { width: 22px; height: 22px; }

/* Panel lateral (móvil) */
.tpn-lateral { position: fixed; inset: 0; z-index: 2100; visibility: hidden; }
.tpn-lateral.tpn-abierto { visibility: visible; }
.tpn-fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.tpn-hoja {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(330px, 86vw); overflow-y: auto;
  background: #111113; border-left: 1px solid var(--tpn-line); padding: max(14px, env(safe-area-inset-top)) 14px 24px;
  transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.tpn-abierto .tpn-fondo { opacity: 1; }
.tpn-abierto .tpn-hoja { transform: none; }
.tpn-hoja-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tpn-cerrar { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--tpn-line); background: none; color: var(--tpn-text); cursor: pointer; display: grid; place-items: center; }
.tpn-cerrar svg { width: 20px; height: 20px; }
.tpn-lateral .tpn-grupo { margin-bottom: 14px; }
.tpn-grupo-t { color: var(--tpn-muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 10px 12px 4px; }
.tpn-hoja a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--tpn-text); text-decoration: none; font-size: 1rem; font-weight: 600; }
.tpn-hoja a:hover { background: rgba(255, 255, 255, .06); }
.tpn-hoja a[aria-current="page"] { background: rgba(242, 196, 15, .12); box-shadow: inset 0 0 0 1px rgba(242, 196, 15, .35); }
.tpn-hoja a svg { width: 20px; height: 20px; color: var(--tpn-yellow); flex: none; }
.tpn-hoja .tpn-panel { width: 100%; justify-content: center; margin: 4px 0 14px; height: 46px; font-size: 1rem; }

.tpn :focus-visible, .tpn-lateral :focus-visible { outline: 3px solid var(--tpn-yellow); outline-offset: 2px; }

@media (max-width: 640px) {
  .tpn-tabs .tpn-pestanas { display: flex; width: 100%; gap: 2px; padding: 3px; }
  .tpn-tabs li { flex: 1; }
  .tpn-tabs a { justify-content: center; padding: 0 4px; font-size: .86rem; }
  .tpn-tabs a svg { display: none; }
}
@media print { .tpn, .tpn-lateral, .tpn-tabs { display: none !important; } }
