/* ============================================================
   BET DOS BROTHERS - CSS DE IMPRESSÃO TÉRMICA (58mm / 80mm)
   Projetado para maquininhas POS, Mini Impressoras Bluetooth e USB
   ============================================================ */

/* Container de visualização na tela (Simulação de Bobina Térmica) */
.thermal-receipt-preview {
  background: #ffffff;
  color: #000000;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  padding: 14px 10px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11.5px;
  line-height: 1.35;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  border-top: 5px solid #22c55e;
  position: relative;
  user-select: text;
}

/* Divisor tracejado estilo bobina */
.thermal-divider {
  border: none;
  border-top: 1px dashed #000000;
  margin: 7px 0;
}

.thermal-divider-double {
  border: none;
  border-top: 2px solid #000000;
  margin: 8px 0;
}

/* Cabeçalho */
.thermal-header {
  text-align: center;
}

.thermal-bank-title {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.thermal-tagline {
  font-size: 9.5px;
  font-weight: 600;
  margin-bottom: 4px;
}

.thermal-code-badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 900;
  border: 1.5px solid #000;
  padding: 2px 8px;
  margin: 4px 0;
  letter-spacing: 1px;
}

.thermal-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
}

/* Lista de Apostas / Jogos */
.thermal-items {
  margin: 6px 0;
}

.thermal-item-block {
  margin-bottom: 7px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #888;
}

.thermal-item-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.thermal-match-title {
  font-weight: 900;
  font-size: 11.5px;
}

.thermal-league-sub {
  font-size: 9.5px;
  color: #333;
}

.thermal-market-pick {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  margin-top: 2px;
}

.thermal-odd-val {
  font-weight: 900;
}

/* Totais & Financeiro */
.thermal-summary {
  margin: 6px 0;
}

.thermal-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
}

.thermal-sum-row.highlight {
  font-size: 13px;
  font-weight: 900;
  margin-top: 4px;
  border-top: 1px dashed #000;
  padding-top: 4px;
}

/* QR Code & Segurança */
.thermal-qr-box {
  text-align: center;
  margin: 8px 0 4px 0;
}

.thermal-qr-img {
  width: 130px;
  height: 130px;
  margin: 0 auto;
  display: block;
}

.thermal-qr-caption {
  font-size: 9px;
  font-weight: bold;
  margin-top: 3px;
  letter-spacing: 0.3px;
}

/* Rodapé / Regras */
.thermal-footer-notes {
  text-align: center;
  font-size: 8.5px;
  line-height: 1.25;
  color: #222;
  margin-top: 6px;
  white-space: pre-line;
}

.thermal-cut-mark {
  text-align: center;
  font-size: 9px;
  letter-spacing: 3px;
  margin-top: 10px;
}

/* ============================================================
   REGRAS DE IMPRESSÃO (@media print)
   Oculta a interface da web e imprime apenas a bobina
   ============================================================ */
@media print {
  @page {
    margin: 0;
    size: auto;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
  }

  /* Ocultar tudo que não for o recibo térmico */
  .navbar,
  .main-layout,
  .mobile-slip-trigger,
  .modal-header,
  .modal-actions,
  .btn-close-modal,
  .toast-box {
    display: none !important;
  }

  .modal-overlay {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .modal-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  /* Exibir apenas a área do recibo */
  .thermal-receipt-preview,
  .thermal-receipt-preview * {
    visibility: visible !important;
  }

  .thermal-receipt-preview {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 58mm !important; /* padrão 58mm */
    max-width: 58mm !important;
    margin: 0 !important;
    padding: 3mm !important;
    box-shadow: none !important;
    border: none !important;
    border-top: none !important;
    font-size: 10pt !important;
    line-height: 1.2 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .thermal-qr-img {
    width: 32mm !important;
    height: 32mm !important;
  }
}

/* Suporte para papel 80mm quando configurado */
body[data-paper="80mm"] .thermal-receipt-preview {
  max-width: 420px;
}

@media print {
  body[data-paper="80mm"] .thermal-receipt-preview {
    width: 78mm !important;
    max-width: 78mm !important;
  }
}
