
/* Fundo da página com imagem estática */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background: url('../img/fundo.jpg') no-repeat center center fixed;
  background-size: cover;
}

/* Folha central simulando uma A4 transparente */
.folha {
  width: 90%;
  max-width: 1100px;
  margin: 40px auto;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background-color: white;
}

/* Cabeçalho */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.logo {
  max-width: 180px;
  height: auto;
}

.dados-contato {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.dados-contato p {
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

/* Sessões */
section {
  margin-bottom: 25px;
}

/* Layout em colunas */
.dados-principais,
.cliente {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.coluna {
  flex: 1 1 200px;
}

.coluna label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.coluna input,
.linha input,
select {
  width: 100%;
  padding: 6px;
  font-size: 14px;
  box-sizing: border-box;
}

/* Tabela de itens */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

table thead {
  background-color: #e0e0e0;
}

table th,
table td {
  border: 1px solid #ccc;
  padding: 6px;
  text-align: center;
}

table input {
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
}

/* Botões */
button {
  padding: 8px 16px;
  font-size: 14px;
  margin-top: 10px;
  cursor: pointer;
  background-color: #00518c;
  color: white;
  border: none;
  border-radius: 4px;
}

button:hover {
  background-color: #003f6f;
}

button.gerar {
  display: block;
  margin: 30px auto 10px auto;
  font-size: 16px;
  padding: 10px 25px;
}

/* Rodapé */
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  font-size: 14px;
}

footer .icones a {
  margin-left: 10px;
}

.icon-small {
  width: 24px;
  height: 24px;
}

body.bg {
  background: url('../img/bg.jpg') no-repeat center center fixed;
  background-size: cover;
}

.nao-imprimir {
  display: block;
}

@media print {
  /* Esconde itens que não devem aparecer */
  .nao-imprimir,
  .logout-btn,
  button,
  select,
  .icones,
  footer,
  table {
    display: none !important;
  }

  /* Ajuste da página */
  @page {
    size: A4;
    margin: 15mm;
  }

  body, html {
    font-family: Arial, sans-serif !important;
    background: white !important;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact;
  }

  .folha {
    width: 100%;
    margin: 0;
    padding: 20mm;
    background: white !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  header {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    margin-bottom: 10px !important;
  }

  .logo {
    max-width: 150px !important;
    margin-bottom: 8px;
  }

  h1 {
    font-size: 18pt !important;
    margin: 5px 0;
  }

  .dados-contato {
    font-size: 10pt !important;
    margin-top: 5px;
  }

  .dados-contato p {
    margin: 2px 0;
  }


  .dados-principais,
  .cliente {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 20px;
  }

  .coluna {
    flex: 1 1 45%;
    max-width: 45%;
    box-sizing: border-box;
  }

  label {
    font-weight: bold;
    font-size: 10pt;
    display: block;
    margin-bottom: 2px;
  }

  input, textarea {
    font-size: 10pt;
    border: none !important;
    background: none !important;
    color: black !important;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  input::placeholder {
    color: black !important;
  }

  /* Itens formatados para impressão */
  #itens-formatados-impressao {
    display: block !important;
    font-size: 10pt;
    margin-top: 25px;  /* Aumenta espaço após os dados do cliente */
    margin-bottom: 30px; /* Espaço antes dos valores finais */
  }

  #itens-formatados-impressao h3 {
    margin-bottom: 10px;
    font-size: 12pt;
    text-transform: uppercase;
    text-align: left;
  }

  #itens-formatados-impressao p {
    margin: 6px 0;
    line-height: 1.4;
  }

  /* Valores finais (total, à vista, parcelado) */
  .linha {
    margin-bottom: 10px;
  }

  .linha label {
    font-weight: bold;
    font-size: 10pt;
  }

  .linha input {
    font-size: 10pt;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px;
    padding: 10px;
  }

  .folha {
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    box-sizing: border-box;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .dados-contato {
    margin-top: 10px;
  }

  .coluna {
    width: 100% !important;
    margin-bottom: 10px;
  }

  section.dados-principais,
  section.cliente {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  table {
    font-size: 14px;
  }

  table thead {
    display: none;
  }

  table tbody tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    padding: 10px;
  }

  table td {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
  }

  .linha {
    display: flex;
    flex-direction: column;
  }

  .linha label {
    margin-bottom: 5px;
  }

  .gerar {
    width: 100%;
  }

  footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .icones a {
    margin: 5px;
  }
}

.logout-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background-color: #002F6C;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background 0.3s ease;
}

.logout-btn:hover {
  background-color: #001f47;
}
