/* =====================================================================
   MADRE SELVA · ms-nav-fija.css · v1 · 25/10/2026
   Navegación en L persistente para TODA la app autenticada (BASE, PRO, PREMIUM, MS EJECUTIVO y pantallas
   compartidas). Capa global de comportamiento: no cambia colores, tipografías, íconos, textos ni módulos.
   Se carga como ÚLTIMA hoja (postbuild-nav-fija.mjs), después de ms-modulos-v5.css.

   Causa raíz corregida
   · styles-v2.css declara html,body{overflow-x:hidden}. En body eso crea un contenedor de desplazamiento
     que nunca se desplaza (lo hace el viewport), y anula todo position:sticky interno: la barra superior
     (.ms-topzone, ya diseñada sticky) se iba con el contenido en todas las experiencias.
   · ms-nav-l.css (≥981 px) además la forzaba a position:relative para su banda de fondo ::before.
   Solución: overflow-x:clip (recorta igual, pero NO crea contenedor de scroll) y .ms-topzone sticky en
   todos los anchos. El menú lateral ya es fixed en escritorio/tablet; en celular se conserva la barra
   inferior existente (.bottombar, fixed) y el botón «Más».
   ===================================================================== */

/* 1 · Sin contenedor de scroll falso en html/body (conserva el recorte horizontal) */
@supports (overflow:clip){
  html{ overflow-x:clip; }
  body:not(.ms-assist-open){ overflow-x:clip; }
}

/* 2 · Barra superior (trazo horizontal de la L) siempre visible */
html .ms-shell .ms-topzone{
  position:-webkit-sticky; position:sticky !important; top:0 !important; z-index:40;
}
/* Respeta el notch / isla en celulares (viewport-fit=cover ya está declarado en index.html) */
@media (max-width:980px){
  html .ms-shell .ms-topzone{ padding-top:max(var(--ms-nf-pad-top,8px), env(safe-area-inset-top,0px)); }
}

/* 3 · Menú lateral (trazo vertical de la L) siempre visible en escritorio y tablet horizontal.
   styles-v2 ya lo fija ≥981 px; se refuerza la altura dinámica para barras del navegador móvil. */
@media (min-width:981px){
  html .ms-shell .ms-sidebar{ height:100vh; height:100dvh; }
}

/* 4 · Anclas, foco y teclado virtual: lo enfocado nunca queda debajo de la barra superior ni de la inferior.
   --ms-nf-top / --ms-nf-bottom los mide ms-nav-fija.js (fallback conservador sin JS). */
html{
  scroll-padding-top:calc(var(--ms-nf-top,72px) + 12px);
  scroll-padding-bottom:calc(var(--ms-nf-bottom,0px) + 12px);
}
/* Elementos sticky internos (p. ej. el resumen de Nuevo pedido) se ubican debajo de la barra fija */
html .ms-shell .ms-main .summary{ top:calc(var(--ms-nf-top,62px) + 16px); }

/* 5 · Celular horizontal / pantallas muy bajas: la barra superior se compacta sin ocultar controles */
@media (max-width:980px) and (max-height:500px){
  html .ms-shell .ms-topzone{ padding-top:max(4px, env(safe-area-inset-top,0px)) !important; padding-bottom:4px !important; }
}

/* Keep the existing language menu reachable on narrow phones. */
@media (max-width:360px){
  html .ms-shell .ms-topzone.v6{padding-left:6px;padding-right:6px;gap:4px}
  html .ms-shell .ms-topzone.v6 .ms-langdd.top{display:flex;padding:0}
  html .ms-shell .ms-topzone.v6 .ms-langdd.top .ms-langdd-trigger{width:32px;padding:0;justify-content:center}
  html .ms-shell .ms-topzone.v6 .ms-langdd.top .ms-langdd-short,
  html .ms-shell .ms-topzone.v6 .ms-langdd.top .ms-langdd-trigger > svg:last-child{display:none}
  html[data-ms-section="premium"] #app .bottombar :is(a,button){
    min-width:0;white-space:normal;overflow-wrap:anywhere;
    font-size:10px;line-height:1.25;letter-spacing:0;text-align:center;
  }
}

@media print{
  html .ms-shell .ms-topzone{ position:static !important; }
}
