* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Work Sans', system-ui, sans-serif;
  background: #FAF6EF;
  color: #201F1C;
}
h1, h2, h3 { font-family: 'Space Grotesk', system-ui, sans-serif; }
button { font-family: inherit; cursor: pointer; }

/* ---------- ESTADOS (carregando / erro / pausado / vazio) ---------- */
.tela-estado {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  gap: 14px;
}
.tela-estado h1 { font-size: 20px; color: #0E6B54; }
.tela-estado p { font-size: 14px; color: #5E5D59; max-width: 320px; line-height: 1.5; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #E3EFEA;
  border-top-color: #0E6B54;
  border-radius: 50%;
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.botao-principal {
  display: inline-block;
  padding: 13px 22px;
  border: none;
  border-radius: 14px;
  background: #0E6B54;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(14,107,84,0.25);
}

/* ---------- BLOCO FIXO (cabeçalho + faixa + abas) ---------- */
.topo-fixo {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #FAF6EF;
}

/* ---------- CABEÇALHO ---------- */
.cabecalho {
  padding: 9px 20px 8px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 2;
  box-shadow: 0 1px 0 rgba(31,30,29,0.06);
}
.linha-vendedor { display: flex; align-items: center; gap: 10px; }
.foto-vendedor {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0E6B54, #0B5744);
  color: #FAF6EF;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 6px rgba(14,107,84,0.3), 0 0 0 3px #FFFFFF, 0 0 0 4px rgba(14,107,84,0.14);
}
.dados-vendedor { display: flex; flex-direction: column; gap: 1px; flex-grow: 1; min-width: 0; }
.nome-vendedor { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frase-vendedor { font-size: 11px; font-style: italic; color: #5E5D59; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- BANNER SEMANA ---------- */
.banner-semana {
  background: linear-gradient(135deg, #0E6B54 0%, #0B5744 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  box-shadow: 0 4px 14px rgba(14,107,84,0.28);
  position: relative;
  z-index: 1;
}
.banner-titulo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.banner-datas {
  font-size: 10.5px;
  font-weight: 600;
  opacity: 0.92;
  white-space: nowrap;
}

/* ---------- ABAS DE CATEGORIA ---------- */
.categoria-tabs {
  display: flex;
  gap: 6px;
  padding: 9px 20px;
  overflow-x: auto;
  background: #FAF6EF;
}
.categoria-tab {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid rgba(31,30,29,0.16);
  background: #FFFFFF;
  color: #3D3D3A;
  white-space: nowrap;
  transition: background 0.15s, box-shadow 0.15s;
}
.categoria-tab.ativa {
  background: linear-gradient(135deg, #0E6B54, #0B5744);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(14,107,84,0.35);
}

/* ---------- LISTA DE ITENS ---------- */
.lista-itens {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 20px 24px;
  background-image: radial-gradient(circle, rgba(14,107,84,0.07) 1px, transparent 1px);
  background-size: 16px 16px;
  min-height: 200px;
}
.sem-itens {
  text-align: center;
  color: #5E5D59;
  padding: 30px 0;
  font-size: 14px;
}

.item-card {
  border-radius: 18px;
  border: 0.5px solid rgba(31,30,29,0.05);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 2px 10px rgba(32,31,28,0.07);
  transition: box-shadow 0.15s, transform 0.1s;
}
.item-card:active { transform: scale(0.995); }
.item-icone {
  width: 60px; height: 60px;
  border-radius: 14px;
  background-color: #FFFFFF;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(32,31,28,0.10), inset 0 0 0 1px rgba(32,31,28,0.04);
}
.item-icone.tem-foto { cursor: zoom-in; }
.item-corpo { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.item-descricao { font-size: 14px; font-weight: 600; line-height: 1.35; }
.item-codigos { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #5E5D59; flex-wrap: nowrap; overflow: hidden; }
.item-codigos span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-codigos .divisor { width: 1px; height: 10px; background: rgba(31,30,29,0.2); flex-shrink: 0; }

.item-acao-linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.item-preco {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 15px;
  color: #FAF6EF; background: linear-gradient(135deg, #2A2925, #171613);
  padding: 5px 11px; border-radius: 8px;
  box-shadow: 0 2px 6px rgba(23,22,19,0.25);
}
.item-interesse-pill {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 12px; font-weight: 600;
  border: 1.5px solid #0E6B54;
  background: #FFFFFF; color: #0E6B54;
  white-space: nowrap;
  transition: box-shadow 0.15s;
}
.item-interesse-pill:active { box-shadow: 0 2px 8px rgba(14,107,84,0.25); }
.item-qty {
  display: flex; align-items: center; gap: 8px;
  background: #F0EEE6; border-radius: 100px; padding: 3px;
  box-shadow: inset 0 1px 2px rgba(32,31,28,0.06);
}
.item-qty button {
  width: 26px; height: 26px; border-radius: 50%; border: none;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.item-qty .btn-dec { background: #FFFFFF; color: #201F1C; box-shadow: 0 1px 3px rgba(32,31,28,0.12); }
.item-qty .btn-inc { background: linear-gradient(135deg, #0E6B54, #0B5744); color: #FFFFFF; box-shadow: 0 2px 6px rgba(14,107,84,0.35); }
.item-qty .qty-valor { min-width: 14px; text-align: center; font-weight: 700; font-size: 13px; }

/* ---------- RODAPÉ ---------- */
.rodape {
  position: sticky; bottom: 0;
  padding: 14px 20px 18px;
  background: #FFFFFF;
  border-top: 0.5px solid rgba(31,30,29,0.12);
  box-shadow: 0 -6px 20px rgba(32,31,28,0.06);
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.rodape .botao-principal {
  flex: 1;
  min-width: 0;
  padding: 15px 10px; border-radius: 14px; font-size: 14px; border: none;
  background: linear-gradient(135deg, #0E6B54, #0B5744);
  box-shadow: 0 6px 18px rgba(14,107,84,0.3);
  transition: box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rodape .botao-principal:active { transform: scale(0.98); }
.rodape .botao-principal:disabled { background: #F0EEE6; color: #6B6A62; cursor: default; box-shadow: none; }

.botao-pre-pedido {
  flex-shrink: 0;
  width: 54px;
  border-radius: 14px;
  border: 1.5px solid rgba(14,107,84,0.3);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.botao-pre-pedido:active { transform: scale(0.95); }
.botao-pre-pedido:disabled { border-color: rgba(31,30,29,0.12); cursor: default; }
.botao-pre-pedido:disabled svg { stroke: #B7B5AC; }

.botao-limpar {
  flex-shrink: 0;
  width: 54px;
  border-radius: 14px;
  border: 1.5px solid rgba(185,28,28,0.3);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}
.botao-limpar:active { transform: scale(0.95); }
.botao-limpar:disabled { border-color: rgba(31,30,29,0.12); cursor: default; }
.botao-limpar:disabled svg { stroke: #B7B5AC; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,19,17,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-caixa {
  background: #FFFFFF;
  border-radius: 16px;
  padding: 22px 20px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-titulo {
  font-size: 16px;
  font-weight: 700;
  color: #1F1E1D;
  line-height: 1.35;
}
.modal-texto {
  font-size: 13.5px;
  color: #5E5D59;
  margin-top: 8px;
  line-height: 1.4;
}
.modal-botoes {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.modal-btn {
  flex: 1;
  padding: 12px 10px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}
.modal-btn-principal {
  background: linear-gradient(135deg, #0E6B54, #0B5744);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(14,107,84,0.25);
}
.modal-btn-secundario {
  background: #F0EEE6;
  color: #4A4944;
}

.botao-pdf {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #E3EFEA;
  border: none;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(14,107,84,0.18);
  transition: box-shadow 0.15s, transform 0.1s;
}
.botao-pdf:active { transform: scale(0.95); }
.botao-pdf:disabled { background: #F0EEE6; cursor: default; box-shadow: none; }
.botao-pdf:disabled svg { stroke: #B7B5AC; }
.rodape-aviso { text-align: center; font-size: 11px; color: #5E5D59; margin-top: 8px; }

@media (max-width: 380px) {
  .item-card { flex-wrap: wrap; }
}

/* ---------- ORDENAR POR PREÇO (na barra verde, só na aba aberta) ---------- */
.ordem-preco {
  appearance: none; -webkit-appearance: none;
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  color: #0E6B54;
  background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%230E6B54' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 6px center;
  border: none;
  border-radius: 999px;
  padding: 4px 18px 4px 8px;
  flex-shrink: 0;
  max-width: 34%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.ordem-preco.ativa { background-color: #F6B21B; color: #1F1E1D; }

/* ---------- FOTO AMPLIADA (toque na foto do produto) ---------- */
.foto-zoom-fundo {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,20,30,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.foto-zoom-fundo[hidden] { display: none; }
.foto-zoom-caixa {
  position: relative;
  background: #FFFFFF;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.foto-zoom-img {
  display: block;
  width: 180px; height: 180px;   /* 3x a foto do cartão (60px) */
  max-width: calc(100vw - 68px); max-height: calc(100vw - 68px);
  object-fit: contain;
  border-radius: 12px;
}
.foto-zoom-fechar {
  position: absolute; top: -12px; right: -12px;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: #1F1E1D; color: #FFFFFF;
  font-size: 20px; line-height: 32px; text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
