/* NEXU - camada responsiva global para celulares/tablets (2026-09-28) */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:hidden}
body{max-width:100%;overflow-x:hidden}
img,video,canvas,svg{max-width:100%;height:auto}
input,select,textarea,button{max-width:100%;font:inherit}
@media(max-width:780px){
  body{min-width:0!important}
  main,.container,.conteudo,.content,.pagina,.wrap,.perfil-container,.config-container{max-width:100%!important;width:100%!important;padding-left:16px!important;padding-right:16px!important;box-sizing:border-box}
  h1{overflow-wrap:anywhere}
  table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .modal,.modal-content,.modal-conteudo,.painel-modal,.dialog,.dialog-box{max-width:calc(100vw - 24px)!important}
  .grid,.cards,.cards-grid,.servicos-grid,.vagas-grid,.lojas-grid,.produtos-grid{grid-template-columns:1fr!important}
  header.topo{height:auto!important;min-height:64px!important;padding:10px 16px!important;display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:10px!important}
  header.topo>.logo,header.topo .logo,header.topo>.parceiro-logo{width:auto!important;min-width:0!important;max-width:160px!important;flex:0 1 auto!important}
  header.topo>.pesquisa,header.topo .pesquisa{order:3!important;width:100%!important;max-width:none!important}
  header.topo>.menu-principal,header.topo>nav,header.topo .menu-principal{order:4!important;width:100%!important;max-width:100%!important;display:flex!important;justify-content:flex-start!important;gap:22px!important;overflow-x:auto!important;overflow-y:hidden!important;white-space:nowrap!important;-webkit-overflow-scrolling:touch;padding-bottom:3px!important;scrollbar-width:none}
  header.topo>.menu-principal::-webkit-scrollbar,header.topo>nav::-webkit-scrollbar{display:none}
  header.topo>.menu-principal a,header.topo>nav a{flex:0 0 auto!important;font-size:11px!important}
  header.topo .avatar,header.topo>.avatar{margin-left:auto!important;flex:0 0 auto!important}
  .hero,.banner,.cabecalho,.hero-planos{min-height:0!important;height:auto!important}
  .hero h1,.banner h1,.cabecalho h1{font-size:clamp(28px,9vw,46px)!important;line-height:1.05!important}
  .card,.painel,.panel,.perfil-card,.config-card{max-width:100%!important}
  .acoes,.actions,.botoes,.buttons{flex-wrap:wrap!important}
  .acoes button,.actions button,.botoes button,.buttons button{max-width:100%}
}
@media(max-width:480px){
  main,.container,.conteudo,.content,.pagina,.wrap{padding-left:12px!important;padding-right:12px!important}
  header.topo{padding-left:12px!important;padding-right:12px!important}
  input,select,textarea{font-size:16px!important} /* evita zoom automático no iPhone */
  button,.btn,a.btn{min-height:42px}
}

/* ==========================================================
   NEXU MOBILE v2 — header compacto + menu hambúrguer
   Mantém o N/logo à esquerda e o perfil à direita.
   ========================================================== */
@media (max-width: 900px) {
  header.topo,
  body.parceiro-header header.topo {
    height: 70px !important;
    min-height: 70px !important;
    padding: 0 16px !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto auto !important;
    grid-template-rows: 70px !important;
    gap: 10px !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    position: sticky !important;
    top: 0 !important;
    overflow: visible !important;
  }

  header.topo > .logo,
  body.parceiro-header header.topo > .logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 175px !important;
    margin: 0 !important;
    justify-self: start !important;
    overflow: hidden !important;
  }

  header.topo > .logo span:not(.logo-simbolo),
  header.topo > .logo .logo-texto strong { white-space: nowrap !important; }

  header.topo > .pesquisa { display: none !important; }

  header.topo > nav,
  header.topo > .menu-principal,
  body.parceiro-header header.topo > nav,
  body.parceiro-header header.topo > .menu-principal {
    display: none !important;
    position: fixed !important;
    z-index: 10020 !important;
    top: 70px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100dvh - 86px) !important;
    overflow-y: auto !important;
    padding: 10px !important;
    background: #164f73 !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,.25) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    white-space: normal !important;
  }

  header.topo.mobile-menu-open > nav,
  header.topo.mobile-menu-open > .menu-principal,
  body.parceiro-header header.topo.mobile-menu-open > nav,
  body.parceiro-header header.topo.mobile-menu-open > .menu-principal { display: flex !important; }

  header.topo > nav a,
  header.topo > .menu-principal a,
  body.parceiro-header header.topo nav a {
    width: 100% !important;
    min-height: 46px !important;
    padding: 12px 14px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
  header.topo > nav a:hover,
  header.topo > nav a.selecionado,
  header.topo > .menu-principal a:hover,
  header.topo > .menu-principal a.selecionado { background: rgba(255,255,255,.12) !important; }

  .nexu-mobile-menu-btn {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.10) !important;
    display: inline-flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    cursor: pointer !important;
  }
  .nexu-mobile-menu-btn span { width: 21px; height: 2px; border-radius: 4px; background: #fff; display: block; transition: .2s; }
  header.topo.mobile-menu-open .nexu-mobile-menu-btn span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  header.topo.mobile-menu-open .nexu-mobile-menu-btn span:nth-child(2){opacity:0}
  header.topo.mobile-menu-open .nexu-mobile-menu-btn span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

  header.topo > .usuario-menu,
  body.parceiro-header header.topo > .usuario-menu {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    margin: 0 !important;
    display: block !important;
  }
  header.topo .avatar { width: 46px !important; height: 46px !important; min-width: 46px !important; }

  body.parceiro-header header.topo > .notificacao { display: none !important; }
  header.topo .menu-dropdown { right: 0 !important; left: auto !important; max-width: calc(100vw - 24px) !important; }

  /* busca da área cliente entra no menu em telas pequenas */
  .nexu-mobile-search {
    display: flex !important;
    width: 100% !important;
    min-height: 46px !important;
    margin: 2px 0 7px !important;
    background: #fff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }
  .nexu-mobile-search input { min-width: 0 !important; flex: 1 !important; border: 0 !important; outline: 0 !important; padding: 0 13px !important; color:#164f73 !important; font-size:16px !important; font-weight:700 !important; }
  .nexu-mobile-search button { width: 48px !important; border:0 !important; background:#fff !important; color:#164f73 !important; }

  /* largura realmente fluida; evita layout desktop espremido */
  .pagina { width: 100% !important; max-width: 1180px !important; padding-left: 16px !important; padding-right: 16px !important; margin-left:auto !important; margin-right:auto !important; }
}

@media (max-width: 480px) {
  header.topo, body.parceiro-header header.topo { padding: 0 12px !important; gap: 8px !important; }
  header.topo > .logo, body.parceiro-header header.topo > .logo { max-width: 150px !important; }
  header.topo .logo-texto strong { font-size: 20px !important; }
  header.topo .logo-texto small { display:block !important; font-size:6px !important; }
  .pagina { padding-left: 12px !important; padding-right: 12px !important; }
}

/* NEXU FIX — Agenda é exclusiva do MAX também no menu mobile.
   Esta regra precisa vir depois da regra genérica dos links mobile. */
@media (max-width: 900px) {
  body.parceiro-header .nexu-agenda-header { display: none !important; }
  body.parceiro-header.plano-max .nexu-agenda-header { display: flex !important; }
}

/* ==========================================================
   NEXU FIX 2026-09-28 — isolamento real entre desktop/mobile
   ========================================================== */
/* Elementos criados pelo JS mobile jamais aparecem no desktop. */
.nexu-mobile-menu-btn,
.nexu-mobile-search {
  display: none;
}

@media (min-width: 901px) {
  header.topo {
    overflow: visible !important;
  }

  header.topo > .logo {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  header.topo > .pesquisa {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: flex !important;
  }

  header.topo > nav,
  header.topo > .menu-principal {
    grid-column: 3 !important;
    grid-row: 1 !important;
    display: flex !important;
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }

  header.topo > .usuario-menu {
    grid-column: 4 !important;
    grid-row: 1 !important;
    position: relative !important;
    align-self: center !important;
    justify-self: end !important;
  }
}
/* Navegação inferior restrita ao celular; mantém marca e avatar no topo. */
.nexu-bottom-nav,.nexu-bottom-sheet,.nexu-bottom-backdrop{display:none}
@media(max-width:900px){
  header.topo,body.parceiro-header header.topo{grid-template-columns:minmax(0,1fr) auto!important}
  header.topo>.usuario-menu,body.parceiro-header header.topo>.usuario-menu{grid-column:2!important}
  header.topo>.nexu-mobile-menu-btn{display:none!important}
  header.topo.mobile-menu-open>nav,header.topo.mobile-menu-open>.menu-principal{display:none!important}
  body{padding-bottom:calc(76px + env(safe-area-inset-bottom))!important}
  .nexu-bottom-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;z-index:10030;background:#fff;border-top:1px solid #d8e5ec;box-shadow:0 -4px 20px #133a5220;padding:7px 8px calc(7px + env(safe-area-inset-bottom));min-height:64px;box-sizing:border-box}
  .nexu-bottom-nav a,.nexu-bottom-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:52px;border:0;background:transparent;color:#38596b;text-decoration:none;border-radius:10px;cursor:pointer}
  .nexu-bottom-nav span{font-size:24px;line-height:1}.nexu-bottom-nav small{font-size:11px;font-weight:800;white-space:nowrap}
  .nexu-bottom-nav .ativo,.nexu-bottom-nav [aria-expanded=true]{color:#07537b;background:#e8f4fa}
  .nexu-bottom-backdrop:not([hidden]){display:block;position:fixed;inset:0;z-index:10031;background:#071c2a9c}
  .nexu-bottom-sheet:not([hidden]){display:block;position:fixed;bottom:0;left:0;right:0;z-index:10032;background:#fff;border-radius:20px 20px 0 0;padding:18px 16px calc(86px + env(safe-area-inset-bottom));max-height:85dvh;overflow:auto;box-sizing:border-box;box-shadow:0 -10px 30px #0002}
  .nexu-bottom-heading{display:flex;align-items:center;justify-content:space-between;color:#07537b;margin-bottom:12px}.nexu-bottom-heading button{background:#e8f4fa;border:0;border-radius:10px;padding:10px;color:#07537b;font-weight:800}
  .nexu-bottom-links{display:grid;gap:7px}.nexu-bottom-links>a{display:block;padding:14px;border-radius:12px;background:#f0f6f9;color:#154e6c;text-decoration:none;font-weight:750}
  .nexu-bottom-search{display:flex;gap:6px}.nexu-bottom-search input{min-width:0;flex:1;border:1px solid #bed0db;border-radius:10px;padding:10px}.nexu-bottom-search button{border:0;background:#155d82;color:#fff;border-radius:10px;padding:10px}
}
