/* =============================================
   ESTILOS PARA TELA (Preview do relatório)
   ============================================= */

.print-separacao {
  font-family: Arial, sans-serif;
}

/* CADA PEDIDO = UM QUADRADO/CARD */
.pedido-box {
  border: 2px solid #333;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.pedido-box:last-child {
  margin-bottom: 0;
}

/* HEADER DO PEDIDO */
.pedido-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.pedido-numero {
  font-size: 18px;
  font-weight: bold;
  margin: 0;
  color: #1a1a1a;
}

.pedido-cliente {
  font-size: 14px;
  font-weight: bold;
  text-align: right;
  color: #333;
}

/* SEÇÃO DE ITENS */
.pedido-items-section {
  margin: 12px 0;
}

.pedido-items-title {
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  color: #555;
}

.pedido-items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pedido-items li {
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dotted #bbb;
  color: #222;
}

.pedido-items li:last-child {
  border-bottom: none;
}

/* RODAPÉ COM ENDEREÇO E ENVIO */
.pedido-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ccc;
  font-size: 12px;
  color: #444;
}

.pedido-footer-row {
  margin-bottom: 4px;
}

.pedido-envio {
  font-weight: bold;
  text-align: right;
  margin-top: 6px;
  font-size: 13px;
  color: #1a1a1a;
}

/* =============================================
   ESTILOS PARA IMPRESSÃO
   ============================================= */

@media print {
  @page separacao {
    size: A4;
    margin: 10mm;
  }

  @page etiqueta {
    size: 100mm 70mm;
    margin: 0;
  }

  /* Sobrescreve containers fixed/absolute que podem quebrar paginação */
  .print-separacao,
  .print-separacao * {
    position: static !important;
    inset: auto !important;
    transform: none !important;
  }

  .print-separacao {
    page: separacao;
    font-family: Arial, sans-serif;
    font-size: 11pt;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* CADA PEDIDO = UM QUADRADO/CARD */
  .pedido-box {
    border: 2px solid #000;
    padding: 14px;
    margin-bottom: 14px;
    page-break-inside: avoid;
    background: #fff;
  }

  .pedido-box:last-child {
    margin-bottom: 0;
  }

  /* HEADER DO PEDIDO */
  .pedido-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 10px;
  }

  .pedido-numero {
    font-size: 16pt;
    font-weight: bold;
    margin: 0;
  }

  .pedido-cliente {
    font-size: 12pt;
    font-weight: bold;
    text-align: right;
  }

  /* SEÇÃO DE ITENS */
  .pedido-items-section {
    margin: 10px 0;
  }

  .pedido-items-title {
    font-size: 10pt;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    color: #000;
  }

  .pedido-items {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .pedido-items li {
    font-size: 11pt;
    padding: 3px 0;
    border-bottom: 1px dotted #999;
  }

  .pedido-items li:last-child {
    border-bottom: none;
  }

  /* RODAPÉ COM ENDEREÇO E ENVIO */
  .pedido-footer {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #000;
    font-size: 10pt;
    color: #222;
  }

  .pedido-footer-row {
    margin-bottom: 2px;
  }

  .pedido-envio {
    font-weight: bold;
    text-align: right;
    margin-top: 4px;
    font-size: 11pt;
  }

  /* ETIQUETA */
  .print-etiqueta {
    page: etiqueta;
    width: 100mm;
    height: 70mm;
    padding: 4mm;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 9pt;
    border: 1px solid #000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    page-break-after: always;
  }

  .print-etiqueta:last-child {
    page-break-after: auto;
  }

  .print-etiqueta .etiqueta-header {
    font-size: 7pt;
    text-transform: uppercase;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 2mm;
  }

  .print-etiqueta .etiqueta-nome {
    font-size: 11pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 2mm 0;
  }

  .print-etiqueta .etiqueta-cpf {
    font-size: 9pt;
    margin-bottom: 2mm;
  }

  .print-etiqueta .etiqueta-endereco {
    font-size: 8pt;
    line-height: 1.3;
    flex: 1;
  }

  .print-etiqueta .etiqueta-tipo {
    font-size: 8pt;
    font-weight: bold;
    text-align: right;
    border-top: 1px solid #ccc;
    padding-top: 2mm;
  }
}
