@charset "utf-8";

/* =========================================================
   LABZAP - LAYOUT PWA/MOBILE
   (Topo fixo + Rodapé fixo + Anti barra do Google)
   Estratégia no MOBILE: html/body NÃO rolam. Quem rola é .conteudo.
   ========================================================= */

:root{
  --zp-topbar-h: 56px;
  --zp-bottomnav-h: 70px; /* ajuste: 70px (padrão). Se necessário use 90px. */

  /* Safe-area (iOS e alguns Android) */
  --zp-safe-top: env(safe-area-inset-top, 0px);
  --zp-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* =========================================================
   Anti “barra/cortina do Google” (Contextual Search / long-press)
   ========================================================= */
html, body{
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* Permite selecionar/copiar SOMENTE em campos editáveis */
input, textarea, select, [contenteditable="true"], [contenteditable=""]{
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* Se quiser permitir seleção em algum bloco específico */
.zp-allow-select, .zp-allow-select *{
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

/* Evita highlight/drag */
*{
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

/* =========================================================
   TOPBAR (UMA única definição)
   ========================================================= */
.zp-topbar{
  position: fixed;
  left: 0; right: 0;
  top: 0;

  height: calc(var(--zp-topbar-h) + var(--zp-safe-top));
  padding-top: var(--zp-safe-top);

  z-index: 2147483647;
  background: #111;
  color: #fff;

  display: flex;
  align-items: center;

  /* estabilidade no Android */
  transform: translate3d(0,0,0);
  will-change: transform;

  box-shadow: 0 1px 0 rgba(0,0,0,.35);

  /* sela micro-gap em alguns aparelhos */
  margin-top: -1px;
}

/* Miolo da topbar */
.zp-topbar .zp-inner{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Link esquerdo */
.zp-left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
}

/* Avatar */
.zp-avatar{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.zp-avatar-fallback{
  font-size: 30px;
}

/* Título */
.zp-title{
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}

.zp-title-strong{
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65vw;
}

.zp-title-sub{
  font-size: 12px;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65vw;
}

/* Menu três pontinhos */
.zp-ellipsis{
  position: relative;
}

.zp-ellipsis-btn{
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  border-radius: 10px;

  background: transparent;
  border: 0;
  color: #fff;

  padding: 0;
}

.zp-ellipsis-btn i{
  font-size: 18px;
  color: #fff;
}

/* Dropdown */
.zp-menu-opcoes{
  display: none;
  position: absolute;
  right: 0;
  top: 46px;

  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);

  z-index: 2147483647;
  min-width: 200px;
  overflow: hidden;
}

.zp-menu-opcoes a{
  color: #222;
}

/* =========================================================
   RODAPÉ FIXO (wrapper .menu-rodape)
   ========================================================= */
.menu-rodape{
  position: fixed;
  left: 0; right: 0; bottom: 0;

  z-index: 2147483000;

  padding-bottom: var(--zp-safe-bottom);
  background: #f8f8f8;
  border-top: 1px solid #ddd;
}

.menu-rodape .navbar1{
  margin: 0;
  border: 0;
  box-shadow: none;
}

.menu-rodape .navbar-nav1{
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.menu-rodape .navbar-nav1 > li{
  flex: 1 1 0;
  text-align: center;
}

.menu-rodape .navbar-nav1 > li > a{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  font-size: 11px;
  text-decoration: none;
}

.menu-rodape .navbar-nav1 i{
  font-size: 18px;
  line-height: 1;
}

/* =========================================================
   FIX AVATAR: impede regra global de IMG estourar
   ========================================================= */
.zp-topbar img{
  width: auto !important;
  height: auto !important;
  max-width: none !important;
}

.zp-topbar .zp-avatar{
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  flex: 0 0 34px !important;
}

/* =========================================================
   BASE: zera margens (seguro)
   ========================================================= */
html, body{
  margin: 0 !important;
}

body{
  box-sizing: border-box;
}

/* Se existir navbar fixa antiga do bootstrap, esconda (quando usar topbar nova) */
body.has-topbar .navbar-fixed-top,
body.has-topbar .navbar.navbar-fixed-top{
  display: none !important;
}

/* =========================================================
   DESKTOP/TELAS GRANDES: body rola normal e compensa topo/rodapé
   (corrige conteúdo por baixo do menu no PC)
   ========================================================= */
@media (hover: hover) and (pointer: fine){

  /* desktop pode rolar no body */
  html, body{
    height: auto;
    overflow-y: auto;
  }

  /* ✅ compensa topbar fixa */
  body.has-topbar{
    padding-top: calc(var(--zp-topbar-h) + var(--zp-safe-top)) !important;
  }

  /* ✅ se tiver bottom-nav fixa, compensa também */
  body.has-bottom-nav{
    padding-bottom: calc(var(--zp-bottomnav-h) + var(--zp-safe-bottom)) !important;
  }

  /* garante que .conteudo não fique preso como no mobile */
  body.has-topbar.has-bottom-nav .conteudo{
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;

    overflow: visible !important;
    -webkit-overflow-scrolling: auto !important;

    background: #fff;
  }
}

/* =========================================================
   APP SHELL (Mobile/PWA): BODY NÃO ROLA, .conteudo ROLA
   ========================================================= */
@media (hover: none) and (pointer: coarse){

  /* No modo mobile, o scroll NÃO acontece no body (evita bugs Samsung/PWA) */
  html, body{
    height: 100%;
    overflow: hidden;
    overscroll-behavior-y: contain;
  }

  /* Evita “duplo offset”: o topo é controlado pela .conteudo */
  body.has-topbar{
    padding-top: 0 !important;
  }

  /* ✅ ÚNICO lugar que rola: .conteudo */
  body.has-topbar.has-bottom-nav .conteudo{
    position: fixed;
    left: 0;
    right: 0;

    top: calc(var(--zp-topbar-h) + var(--zp-safe-top));
    bottom: calc(var(--zp-bottomnav-h) + var(--zp-safe-bottom));

    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;

    /* cor do conteúdo (você ajusta depois) */
    background: #fff;
  }
}

@media (hover: none) and (pointer: coarse){
  body.has-topbar.has-bottom-nav{
    overflow: hidden;
  }
  body.has-topbar.has-bottom-nav .conteudo{
    overflow-y: auto !important;
  }

  /* fallback manual: se não existir .conteudo, force body rolar */
  body.has-topbar.has-bottom-nav.zp-no-conteudo{
    overflow-y: auto !important;
  }
}
/* =========================================================
   FIX DESKTOP (pedidos-listar.php): evita faixa cinza/preta
   Causa comum: colunas/floats sem clearfix + fundo do body/html aparecendo.
   ========================================================= */
@media (hover: hover) and (pointer: fine){

  /* força fundo branco no desktop */
  html, body{
    background: #fff !important;
  }

  /* garante que o "miolo" ocupe a altura da tela (evita buraco) */
  body.has-topbar.has-bottom-nav .conteudo{
    background: #fff !important;
    min-height: calc(
      100vh
      - (var(--zp-topbar-h) + var(--zp-safe-top))
      - (var(--zp-bottomnav-h) + var(--zp-safe-bottom))
    ) !important;
  }

  /* ✅ clearfix: impede colapso de altura quando houver floats/colunas */
  body.has-topbar.has-bottom-nav .conteudo::after{
    content: "";
    display: block;
    clear: both;
  }
}