
/* V320 - Mobile: impede botões flutuantes de ficarem um por cima do outro */

@media(max-width:900px){
  :root{
    --mfloat-v320-right:14px;
    --mfloat-v320-bottom:18px;
    --mfloat-v320-size:54px;
    --mfloat-v320-gap:10px;
    --mfloat-v320-step:calc(var(--mfloat-v320-size) + var(--mfloat-v320-gap));
  }

  /*
    Pilha final:
    WhatsApp: embaixo
    Acessibilidade: meio
    Roteiro IA: topo, só se existir
  */

  /* WhatsApp */
  body .whatsapp-float-v252{
    position:fixed!important;
    right:var(--mfloat-v320-right)!important;
    bottom:var(--mfloat-v320-bottom)!important;
    top:auto!important;
    left:auto!important;
    width:var(--mfloat-v320-size)!important;
    height:var(--mfloat-v320-size)!important;
    min-width:var(--mfloat-v320-size)!important;
    min-height:var(--mfloat-v320-size)!important;
    max-width:var(--mfloat-v320-size)!important;
    max-height:var(--mfloat-v320-size)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    z-index:2147482500!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
  }

  body .whatsapp-float-v252 .whatsapp-float-btn-v252{
    position:static!important;
    right:auto!important;
    bottom:auto!important;
    top:auto!important;
    left:auto!important;
    width:var(--mfloat-v320-size)!important;
    height:var(--mfloat-v320-size)!important;
    min-width:var(--mfloat-v320-size)!important;
    min-height:var(--mfloat-v320-size)!important;
    max-width:var(--mfloat-v320-size)!important;
    max-height:var(--mfloat-v320-size)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
  }

  /* Acessibilidade: o WRAPPER controla a posição */
  body .casttur-a11y-widget{
    position:fixed!important;
    right:var(--mfloat-v320-right)!important;
    bottom:calc(var(--mfloat-v320-bottom) + var(--mfloat-v320-step))!important;
    top:auto!important;
    left:auto!important;
    width:var(--mfloat-v320-size)!important;
    height:var(--mfloat-v320-size)!important;
    min-width:var(--mfloat-v320-size)!important;
    min-height:var(--mfloat-v320-size)!important;
    max-width:var(--mfloat-v320-size)!important;
    max-height:var(--mfloat-v320-size)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    z-index:2147482501!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
  }

  /*
    PONTO PRINCIPAL:
    o botão interno NÃO pode continuar fixed, senão sobrepõe outro botão.
  */
  body .casttur-a11y-widget .casttur-a11y-toggle,
  body .casttur-a11y-toggle{
    position:static!important;
    right:auto!important;
    bottom:auto!important;
    top:auto!important;
    left:auto!important;
    width:var(--mfloat-v320-size)!important;
    height:var(--mfloat-v320-size)!important;
    min-width:var(--mfloat-v320-size)!important;
    min-height:var(--mfloat-v320-size)!important;
    max-width:var(--mfloat-v320-size)!important;
    max-height:var(--mfloat-v320-size)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
  }

  /* Roteiro IA: aparece somente logado e fica acima */
  body .ai-route-float-v292{
    position:fixed!important;
    right:var(--mfloat-v320-right)!important;
    bottom:calc(var(--mfloat-v320-bottom) + (var(--mfloat-v320-step) * 2))!important;
    top:auto!important;
    left:auto!important;
    width:var(--mfloat-v320-size)!important;
    height:var(--mfloat-v320-size)!important;
    min-width:var(--mfloat-v320-size)!important;
    min-height:var(--mfloat-v320-size)!important;
    max-width:var(--mfloat-v320-size)!important;
    max-height:var(--mfloat-v320-size)!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    z-index:2147482502!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    border-radius:999px!important;
  }

  /* Centraliza ícones */
  body .ai-route-float-v292 > *,
  body .casttur-a11y-toggle > *,
  body .whatsapp-float-v252 .whatsapp-float-btn-v252 > *,
  body .ai-route-float-v292 svg,
  body .casttur-a11y-toggle svg,
  body .whatsapp-float-v252 svg{
    margin:auto!important;
    position:static!important;
    transform:none!important;
    display:block!important;
  }

  /* Label do IA escondida no mobile para não empurrar */
  body .ai-route-float-v292 span{
    display:none!important;
  }

  /* Painel do WhatsApp acima dos botões */
  body .whatsapp-float-v252 .whatsapp-panel-v252{
    position:fixed!important;
    right:var(--mfloat-v320-right)!important;
    bottom:calc(var(--mfloat-v320-bottom) + var(--mfloat-v320-step))!important;
    width:min(360px, calc(100vw - 28px))!important;
    max-width:calc(100vw - 28px)!important;
    z-index:2147483000!important;
  }

  /* Painel da acessibilidade acima da pilha */
  body .casttur-a11y-widget .casttur-a11y-panel{
    position:fixed!important;
    right:var(--mfloat-v320-right)!important;
    bottom:calc(var(--mfloat-v320-bottom) + (var(--mfloat-v320-step) * 2))!important;
    top:auto!important;
    left:auto!important;
    width:min(320px, calc(100vw - 28px))!important;
    max-width:calc(100vw - 28px)!important;
    transform:none!important;
    z-index:2147483000!important;
  }

  body:has(.ai-route-float-v292) .casttur-a11y-widget .casttur-a11y-panel{
    bottom:calc(var(--mfloat-v320-bottom) + (var(--mfloat-v320-step) * 3))!important;
  }

  body .casttur-a11y-widget.open .casttur-a11y-panel{
    transform:none!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
}

@media(max-width:420px){
  :root{
    --mfloat-v320-right:10px;
    --mfloat-v320-bottom:14px;
    --mfloat-v320-size:50px;
    --mfloat-v320-gap:8px;
  }

  body .whatsapp-float-v252 .whatsapp-panel-v252,
  body .casttur-a11y-widget .casttur-a11y-panel{
    right:10px!important;
    width:calc(100vw - 20px)!important;
    max-width:calc(100vw - 20px)!important;
  }
}
