/* TESSIRVE 5.17.269 — menú móvil a pantalla completa y tamaño fluido.
 * El espacio restante se reparte entre las cuatro filas de Destacados.
 * Sin alturas fijas por teléfono; 100dvh sigue las barras dinámicas del navegador.
 * No afecta escritorio, colores, logos ni enlaces.
 */
@media(max-width:782px){
  html body.tessirve-theme .ms-site-header .ms-site-header-inner>.ms-primary-nav.is-open{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
    gap:0!important;
    box-sizing:border-box!important;
    height:calc(100dvh - var(--ms-header-mobile-height,54px) - var(--ms-admin-space,0px))!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--ms-header-mobile-height,54px) - var(--ms-admin-space,0px))!important;
    padding:7px 9px max(8px,env(safe-area-inset-bottom))!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    animation:tsv269MobileOpen .3s cubic-bezier(.18,.75,.2,1) both!important;
  }

  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-mobile-quicklinks{
    display:flex!important;
    flex:1 1 0px!important;
    flex-direction:column!important;
    min-height:232px!important;
    margin:0 0 3px!important;
    padding:7px 8px 8px!important;
    border-radius:18px!important;
    box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-kicker{
    flex:0 0 auto!important;
    min-height:17px!important;
    margin:0 0 4px!important;
    padding:1px 1px 3px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid{
    display:grid!important;
    flex:1 1 0px!important;
    min-height:0!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(4,minmax(0,1fr))!important;
    grid-auto-rows:minmax(0,1fr)!important;
    gap:5px!important;
    align-content:stretch!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink{
    box-sizing:border-box!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    min-width:0!important;
    padding:3px 3px!important;
    gap:2px!important;
    border-radius:14px!important;
    overflow:hidden!important;
    font-size:clamp(.66rem,1.9vh,.85rem)!important;
    line-height:1.12!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink>.ms-mobile-quicklink-icon{
    width:min(72px,98%)!important;
    height:clamp(20px,calc((100dvh - 510px) / 7),55px)!important;
    min-height:0!important;
    max-height:calc(100% - 17px)!important;
    flex:0 1 auto!important;
    overflow:hidden!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink>.ms-mobile-quicklink-icon>img{
    width:auto!important;
    height:auto!important;
    max-width:min(70px,100%)!important;
    max-height:100%!important;
    object-fit:contain!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink>span:last-child{
    flex:0 0 auto!important;
    max-width:100%!important;
    font-size:inherit!important;
    line-height:1.07!important;
    white-space:normal!important;
  }
  /* LPF: la ventana especial también debe obedecer la altura disponible. */
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink:first-child .ms-mobile-quicklink-lpf-icon{
    width:36px!important;
    min-width:0!important;
    max-width:36px!important;
    height:clamp(20px,calc((100dvh - 510px) / 7),55px)!important;
    min-height:0!important;
    max-height:calc(100% - 17px)!important;
    flex:0 1 auto!important;
    overflow:hidden!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink:first-child .ms-mobile-quicklink-lpf-icon>img{
    height:115%!important;
    width:auto!important;
    max-height:none!important;
    top:50%!important;
    left:-3px!important;
    object-fit:contain!important;
    transform:translateY(-50%)!important;
  }

  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-mobile-menu-kicker{
    flex:0 0 auto!important;
    min-height:17px!important;
    margin:2px 5px 3px!important;
    padding:1px 0 3px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu{
    display:grid!important;
    flex:0 0 auto!important;
    row-gap:3px!important;
    column-gap:5px!important;
    padding:2px 2px 3px!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent{
    min-height:0!important;
    height:clamp(34px,4.8dvh,45px)!important;
    box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent>.ms-menu-parent-head{
    height:100%!important;
    min-height:0!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-menu-parent-toggle{
    height:100%!important;
    min-height:0!important;
    box-sizing:border-box!important;
    padding:5px 24px!important;
    font-size:clamp(.82rem,2vh,.94rem)!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-mobile-menu-tessirve-heading{
    min-height:0!important;
    height:auto!important;
    margin:1px 0 0!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-mobile-menu-tessirve-heading>.ms-mobile-menu-kicker{
    min-height:15px!important;
    margin:0 5px!important;
    padding:1px 0 3px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>li:is(.ms-menu-agenda-item,.ms-menu-ranking-item,.ms-menu-history-item){
    min-height:0!important;
    height:clamp(29px,3.8dvh,37px)!important;
    box-sizing:border-box!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>li:is(.ms-menu-agenda-item,.ms-menu-ranking-item,.ms-menu-history-item)>a{
    min-height:0!important;
    height:100%!important;
    box-sizing:border-box!important;
    padding:4px 3px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
}

@keyframes tsv269MobileOpen{
  from{opacity:0; transform:translateY(-7px)}
  to{opacity:1; transform:translateY(0)}
}
@media(prefers-reduced-motion:reduce){
  html body.tessirve-theme .ms-site-header .ms-site-header-inner>.ms-primary-nav.is-open{
    animation:none!important;
  }
}

/* Dispositivos de poca altura: ningún espacio mínimo debe obligar a cortar la
 * fila de accesos. Si se abren submenús, el desplazamiento interno sigue activo. */
@media (max-width:782px) and (max-height:620px){
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-mobile-quicklinks{
    min-height:193px!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink>.ms-mobile-quicklink-icon{
    height:clamp(15px,3.1dvh,23px)!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open .ms-mobile-quicklinks-grid>.ms-mobile-quicklink:first-child .ms-mobile-quicklink-lpf-icon{
    height:clamp(15px,3.1dvh,23px)!important;
  }
}
@media(max-width:782px){
  /* El selector de país/continente sigue expandiéndose de verdad; no lo fuerza
   * la altura compacta inicial. El scroll sólo aparece cuando hace falta. */
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent:has(.ms-mobile-submenu:not([hidden])),
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent:has(.ms-menu-parent-toggle[aria-expanded="true"]){
    height:auto!important;
    min-height:34px!important;
    overflow:visible!important;
  }
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent:has(.ms-mobile-submenu:not([hidden]))>.ms-menu-parent-head,
  html body.tessirve-theme .ms-site-header .ms-primary-nav.is-open>.ms-site-menu>.ms-menu-parent:has(.ms-menu-parent-toggle[aria-expanded="true"])>.ms-menu-parent-head{
    height:clamp(34px,4.8dvh,45px)!important;
  }
}
