/* ============================================================
   ENCARTE AUTOMÁTICO — estilos do módulo (prefixo ea-).
   Segue a identidade do CARTAZ/Preço Pronto (escuro + vermelho).
   ============================================================ */
.ea-btn-nav span { font-size: 18px; }
.ea-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(8, 10, 14, .82);
  backdrop-filter: blur(6px);
  display: flex; align-items: stretch; justify-content: center;
  padding: 18px;
}
.ea-overlay[hidden] { display: none; }
.ea-janela {
  width: min(1280px, 100%);
  background: #10141b; color: #eef1f6;
  border: 1px solid #2a3140; border-radius: 16px;
  display: flex; flex-direction: column; overflow: visible;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.ea-topo {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: #000;
  border-bottom: 3px solid #e11d2e;
}
.ea-topo .ea-logo { font-size: 26px; }
.ea-topo h2 { margin: 0; font-size: 18px; letter-spacing: .5px; }
.ea-topo p { margin: 0; color: #9aa3b5; font-size: 12px; }
.ea-topo .ea-fechar {
  margin-left: auto; background: #222936; color: #fff;
  border: 1px solid #2a3140; border-radius: 8px;
  padding: 8px 14px; cursor: pointer; font-weight: 700;
}
.ea-corpo {
  display: grid; grid-template-columns: 400px 1fr; gap: 14px;
  padding: 14px 18px; overflow: auto;
}
.ea-painel {
  background: #171b22; border: 1px solid #2a3140;
  border-radius: 12px; padding: 14px;
}
.ea-painel h3 { margin: 0 0 8px; font-size: 14px; color: #ffd7db; }
.ea-campo { display: block; margin: 8px 0; font-size: 13px; color: #c6cdd9; }
.ea-campo select, .ea-campo textarea, .ea-campo input {
  width: 100%; margin-top: 4px; padding: 9px;
  border-radius: 8px; border: 1px solid #2a3140;
  background: #0c0e12; color: #eef1f6; font-size: 14px;
}
.ea-campo textarea { font-family: Consolas, monospace; resize: vertical; }
.ea-checks { display: grid; gap: 6px; margin: 10px 0; font-size: 13px; }
.ea-checks label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.ea-linha { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.ea-btn {
  padding: 9px 13px; border-radius: 8px; cursor: pointer;
  border: 1px solid #2a3140; background: #222936; color: #eef1f6;
  font-weight: 600; font-size: 13px; transition: transform .08s ease;
}
.ea-btn:active { transform: scale(.97); }
.ea-btn.primario { background: #2563eb; border-color: #2563eb; }
.ea-btn.sucesso { background: #16a34a; border-color: #16a34a; }
.ea-btn.perigo { background: #e11d2e; border-color: #e11d2e; }
.ea-btn:disabled { opacity: .45; cursor: not-allowed; }
.ea-validacao {
  background: #0c0e12; border: 1px dashed #16a34a;
  border-radius: 8px; padding: 10px; margin: 10px 0; font-size: 13px;
}
.ea-validacao ul { margin: 6px 0; padding-left: 18px; }
.ea-validacao .ea-alerta { color: #fbbf24; }
.ea-grupo-lista { margin: 6px 0; font-size: 13px; }
.ea-grupo-lista strong { color: #ffd7db; }
.ea-hierarquia {
  background: #0c0e12; border: 1px solid #2a3140; border-radius: 8px;
  padding: 10px; font-family: Consolas, monospace; font-size: 12px;
  white-space: pre-wrap; color: #c6cdd9; margin: 8px 0;
}
.ea-previa { display: flex; flex-direction: column; gap: 12px; }
.ea-faixa {
  background: #fff; color: #111; border-radius: 12px; padding: 12px;
}
.ea-faixa-destaque { border: 3px solid #e11d2e; }
.ea-faixa > header { font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; font-size: 13px; }
.ea-faixa > header small { color: #666; font-weight: 400; }
.ea-cards { display: grid; gap: 10px; }
.ea-cols-1 { grid-template-columns: 1fr; }
.ea-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ea-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ea-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ea-card {
  border: 2px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  background: #fff; cursor: grab; display: flex; flex-direction: column;
}
.ea-card.ea-arrastando { opacity: .4; }
.ea-card.ea-alvo { outline: 3px dashed #2563eb; }
.ea-card.ea-fixado { border-color: #7c3aed; }
.ea-img {
  background: #f8fafc; min-height: 120px; max-height: 180px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.ea-faixa-destaque .ea-img { min-height: 170px; max-height: 230px; }
.ea-img img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ea-semimg {
  width: 100%; padding: 18px 6px; text-align: center;
  background: #fef3c7; color: #b45309; font-weight: 700; font-size: 12px;
}
.ea-semimg button { margin-top: 6px; }
.ea-info { padding: 8px; text-align: center; }
.ea-info h4 { margin: 0 0 2px; font-size: 13px; text-transform: uppercase; }
.ea-faixa-destaque .ea-info h4 { font-size: 15px; }
.ea-preco { font-size: 26px; font-weight: 900; color: #e11d2e; }
.ea-faixa-destaque .ea-preco { font-size: 34px; }
.ea-acoes { display: flex; gap: 4px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.ea-acoes button {
  border: 1px solid #e5e7eb; background: #f1f5f9; color: #111;
  border-radius: 6px; padding: 2px 7px; font-size: 12px; cursor: pointer;
}
.ea-hist { display: grid; gap: 6px; margin-top: 6px; }
.ea-hist-item {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: #0c0e12; border: 1px solid #2a3140; border-radius: 8px;
  padding: 7px 9px; font-size: 12px;
}
.ea-checklist { font-size: 13px; }
.ea-checklist .ok { color: #4ade80; }
.ea-checklist .warn { color: #fbbf24; }
.ea-skeleton {
  border-radius: 10px; min-height: 120px;
  background: linear-gradient(90deg, #1b2130 25%, #242c3f 50%, #1b2130 75%);
  background-size: 200% 100%; animation: ea-shimmer 1.1s infinite;
}
@keyframes ea-shimmer { to { background-position: -200% 0; } }
.ea-folha-area { padding: 0; border-top: 1px solid #2a3140; width: 100%; }
.ea-export-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 0;
}
.ea-export-bar[hidden] { display: none; }
.ea-folha {
  background: #fff; color: #111;
  width: 100%; max-width: 1500px; margin: 0 auto;
  position: relative; overflow: visible; overflow-x: hidden; padding: 0;
  box-sizing: border-box;
}
.ea-folha *, .ea-folha *::before, .ea-folha *::after {
  box-sizing: border-box;
}
.ea-ftopo {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 4px solid #e11d2e; padding: 20px 30px 14px;
  margin-bottom: 16px;
}
.ea-fcamp {
  background: #e11d2e; color: #fff; font-weight: 800;
  padding: 6px 16px; border-radius: 20px; font-size: 15px;
}
.ea-ftopo h2 { margin: 8px 0 2px; font-size: 34px; }
.ea-ftopo small { color: #555; font-size: 13px; }
.ea-flogo { font-weight: 900; letter-spacing: 3px; color: #111; font-size: 18px; }
.ea-fsecao { margin-bottom: 14px; width: 100%; }
.ea-fsecao-d { border: 2px solid #e11d2e; border-radius: 0; padding: 10px; }
.ea-fsecao-n { margin-bottom: 10px; }
.ea-frotulo { font-weight: 800; letter-spacing: 2px; font-size: 15px; margin-bottom: 8px; }
.ea-fgrid { display: grid; gap: 10px; width: 100%; }
.ea-fgrid > * { min-width: 0; overflow: hidden; }
/* DESTAQUES: 3 blocos grandes lado a lado */
.ea-fsecao-d .ea-fgrid { grid-template-columns: repeat(3, 1fr); }
.ea-fcard { border: 1px solid #e5e7eb; border-radius: 0; overflow: visible; text-align: center; background: #fff; display: block; }
.ea-fsecao-d .ea-fcard { border-color: #e11d2e; }
.ea-fimg { background: #f8fafc; min-height: 200px; max-height: 280px; display: flex; align-items: center; justify-content: center; }
.ea-fsecao-d .ea-fimg { min-height: 280px; max-height: 360px; }
.ea-fimg img { width: 100%; height: 100%; object-fit: contain; }
.ea-fnome { font-weight: 900; font-size: 13px; text-transform: uppercase; padding: 4px 4px 0; line-height: 1.2; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; }
.ea-fsecao-d .ea-fnome { font-size: 16px; }
.ea-fpeso { font-size: 11px; color: #555; }
.ea-fpreco { font-size: 28px; font-weight: 900; color: #e11d2e; padding-bottom: 6px; }
.ea-fsecao-d .ea-fpreco { font-size: 42px; }
.ea-fpreco small { font-size: 12px; color: #555; }
/* Rodapé preto sólido como no exemplo — empilha abaixo do conteúdo no fluxo */
.ea-frodape {
  background: #111; color: #fff; padding: 8px 30px;
  font-size: 11px; display: flex; justify-content: space-between;
  width: 100%; flex-shrink: 0;
}
/* Produtos menores: grade 4 colunas */
.ea-fsecao-n .ea-fgrid { grid-template-columns: repeat(4, 1fr); }
.ea-fsecao-n .ea-fcard { border-color: #e5e7eb; }
.ea-fsecao-n .ea-fimg { min-height: 100px; max-height: 140px; }
.ea-fsecao-n .ea-fnome { font-size: 11px; }
.ea-fsecao-n .ea-fpreco { font-size: 20px; }
.ea-fsecao-n .ea-fcard { padding-bottom: 4px; }
@media print {
  @page { size: 150mm 200mm; margin: 0; }
  body > *:not(.ea-overlay) { display: none !important; }
  .ea-overlay { position: static; padding: 0; background: #fff; width: 150mm; height: 200mm; }
  .ea-janela { border: 0; box-shadow: none; max-height: none; width: 150mm; height: 200mm; }
  .ea-topo, .ea-corpo, .ea-export-bar { display: none !important; }
  .ea-folha-area { overflow: visible; padding: 0; border: 0; width: 150mm; height: 200mm; }
  .ea-folha { border-radius: 0; max-width: none; width: 150mm; height: 200mm; }
  .ea-frodape { color: #fff; }
}
@media (max-width: 980px) {
  .ea-corpo { grid-template-columns: 1fr; }
  .ea-cols-3, .ea-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- TEMAS DE FUNDO (pasta "TEMAS ENCARTES") ----------
   Com tema ativo: a arte ocupa o topo (padding-top vindo do JS),
   o cabeçalho padrão some e a cor de reserva cobre o resto. */
.ea-folha.ea-com-tema {
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.ea-folha.ea-com-tema .ea-ftopo { display: none; }
.ea-folha.ea-com-tema .ea-fsecao-d { border-color: #111; }
.ea-folha.ea-com-tema .ea-fsecao-d .ea-fcard { border-color: #111; }
