/* BASE GERAL */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #121212;
  color: #f5f5f5;
  display: flex;
  flex-direction: column;
  padding: 0;
}

h1 {
  color: #ff9800;
  text-align: center;
  margin: 1rem 0;
}

/* CABEÇALHO FIXO */
#cabecalho {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #1f1f1f;
  border-bottom: 2px solid #333;
  position: sticky;
  top: 0;
  z-index: 10;
}

#cabecalho input,
#cabecalho select {
  padding: 5px 10px;
  border-radius: 4px;
  border: none;
  background: #2c2c2c;
  color: white;
}

/* PAINEL DE FILTROS */
#painel-filtros {
  background: #1a1a1a;
  border-right: 1px solid #333;
  padding: 10px;
  width: 250px;
  max-height: 90vh;
  overflow-y: auto;
  position: sticky;
  top: 70px;
  float: left;
}

.aba-filtro {
  margin-bottom: 20px;
}

.aba-filtro h3 {
  margin: 5px 0;
  font-size: 14px;
  color: #ff9800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.lista-filtro {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  transition: max-height 0.3s ease-out;
  overflow: hidden;
}

.lista-filtro.oculto {
  max-height: 0 !important;
  padding: 0;
}

.filtro-btn {
  background: #2c2c2c;
  color: white;
  padding: 2px 6px;
  border: 1px solid #444;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s;
}
.filtro-btn:hover { background: #3d3d3d; }
.filtro-btn.ativo { background: #4caf50; border-color: #388e3c; }

/* TABELA */
table {
  border-collapse: collapse;
  width: calc(100% - 270px);
  margin-left: 270px;
  margin-bottom: 60px;
}

thead th {
  position: sticky;
  top: 90px;
  background: #222;
  color: #ff9800;
  border-bottom: 2px solid #333;
  padding: 8px;
}

td {
  padding: 4px 8px; /* antes era 8px */
  border-bottom: 1px solid #333;
  vertical-align: top; /* isso faz o conteúdo grudar no topo */
}

opct {
 opacity: 50%;
 font-size: 0.8em;
}

input[type="number"] {
  width: 60px;
  background: #2c2c2c;
  color: white;
  border: 1px solid #555;
  padding: 2px 4px;
}

tr.linha-produto.oculto { display: none; }

tr.grupo {
  background: #2e2e2e;
  color: #f5f5f5;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 14px;
  height: 40px;
  position: sticky;
  top: 120px;
  z-index: 4;
  cursor: pointer;
}
tr.grupo:hover { background: #424242; }

/* ALERTA */
input.alerta {
  border-color: red;
  background-color: #3a0000;
}

/* RESUMO E BOTÃO */
#resumo {
  position: relative;
  background: #1f1f1f;
  padding: 10px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  max-width: calc(100% - 300px);
}

#enviar {
  position: relative;
  background: #ff9800;
  color: black;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
#enviar:hover { background: #f57c00; }

/* MENSAGEM DE PROCESSAMENTO */
#msg-processando {
  background: #000;
  color: white;
  padding: 15px;
  font-size: 16px;
  text-align: center;
}

/* RESPONSIVO */
@media screen and (max-width: 800px) {
  #painel-filtros {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    z-index: 999;
    overflow-y: auto;
  }
  table { width: 100%; margin-left: 0; }
  #resumo { left: 10px; max-width: calc(100% - 120px); }
  #enviar { right: 10px; }
  #botao-filtros {
    display: block;
    position: fixed;
    top: 10px;
    left: 10px;
    background: #333;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    z-index: 1000;
    cursor: pointer;
  }
}

/* CHIPS */
.chip {
  background: #2c2c2c;
  border-radius: 12px;
  padding: 2px 6px;
  margin: 1px;
  font-size: 11px;
  display: inline-block;
  white-space: nowrap;
}
.chip-divider {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #666;
  margin: 0 4px;
  vertical-align: middle;
}
.chip.filtro-ativo { background: #4caf50 !important; color: #fff; }
.chip-modelo { background: rgba(33,150,243,0.2); }
.chip-medida { background: rgba(158,158,158,0.2); }
.chip-info   { background: rgba(76,175,80,0.2); }

.detalhes-grupo {
  display: flex;
  gap: 2px;           /* menos espaço entre colunas */
  justify-content: center;
  align-items: flex-start; /* alinha no topo, não no centro */
  flex-wrap: wrap;    /* permite quebrar se necessário */
}

.detalhes-coluna {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: flex-start;
}


/* OUTROS ELEMENTOS */
.cod-secundario { font-size: 10px; color: #aaa; }
.marca-label { font-size: 11px; color: #ff9800; margin-top: 2px; }
.tooltip { cursor: help; font-size: 12px; margin-left: 4px; }
.preco-original { text-decoration: line-through; font-size: 12px; color: #888; }
.preco-desconto { color: #4caf50; font-weight: bold; }

/* === CHIP INTERAÇÃO === */
.chip {
  transition: background 0.2s ease, transform 0.2s ease;
}

.chip:hover {
  transform: scale(1.05);
  filter: brightness(1.2);
}

/*cada tipo com um leve brilho diferente */
.chip-modelo:hover { background: rgba(33,150,243,0.3); }
.chip-medida:hover { background: rgba(158,158,158,0.3); }
.chip-info:hover   { background: rgba(76,175,80,0.3); }
