/*
 * print_ticket_80mm.css — Règles d'impression pour tickets thermiques 80 mm.
 *
 * Papier : 80 mm de large, hauteur continue (auto).
 * Zone utile : 72 mm (80 mm − 2×3 mm de marges latérales effectives).
 * Contrainte imprimante thermique : MONOCHROME noir sur blanc uniquement.
 *   — Interdit : gris, dégradés, fonds colorés, ombres.
 *   — Toutes les données fiscales (CODE DEF, EMCF, QR) sont identiques à la
 *     version A4 ; seule la présentation change.
 *
 * Architecture extensible :
 *   Pour ajouter un gabarit 58 mm, créer print_ticket_58mm.css en copiant ce
 *   fichier et en ajustant uniquement les valeurs de largeur.
 *   Pour un profil cuisine/bar, créer print_profile_cuisine.css qui importe
 *   ce fichier et redéfinit uniquement les sections concernées.
 *
 * Classes utilisées par facture_ticket_80mm.html :
 *   .t80-page, .t80-header, .t80-client, .t80-lines, .t80-totals,
 *   .t80-fiscal, .t80-qr, .t80-footer
 *   — Préfixe « t80- » pour zéro collision avec Bootstrap ou faccontrol-*.
 */


/* ══════════════════════════════════════════════════════════════════════════
   STYLES ÉCRAN — aperçu simulant le rouleau thermique
   ══════════════════════════════════════════════════════════════════════════ */

.t80-screen-wrapper {
  background: #e8e8e8;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.t80-page {
  width: 80mm;
  min-height: 40mm;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8pt;
  line-height: 1.55;
  padding: 4mm;
  box-sizing: border-box;
  /* Ombre légère uniquement à l'écran pour simuler le papier */
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* ── En-tête (société + document) ──────────────────────────────────────── */
.t80-header {
  text-align: center;
  margin-bottom: 3mm;
  border-bottom: 1px dashed #000;
  padding-bottom: 3mm;
}
.t80-header img {
  max-width: 30mm;
  max-height: 18mm;
  display: block;
  margin: 0 auto 2.5mm;
}
.t80-header-company {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.4;
  margin-bottom: 1.5mm;
}
.t80-header-meta {
  font-size: 7pt;
  line-height: 1.7;
}
.t80-pdv-name {
  font-size: 11.5pt;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 1mm;
}
.t80-header-title {
  font-size: 9pt;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 3mm;
  margin-bottom: 1.5mm;
}
.t80-header-num {
  font-size: 8.5pt;
  font-weight: 700;
  margin-bottom: 1.5mm;
}

/* ── Section client (affichée uniquement si client renseigné) ───────────── */
.t80-client {
  font-size: 7.5pt;
  border-bottom: 1px dashed #000;
  padding: 2mm 0;
  margin-bottom: 2mm;
}
.t80-client-label {
  font-weight: 700;
  font-size: 7pt;
  text-transform: uppercase;
  margin-bottom: 1mm;
}

/* ── Tableau des lignes articles ────────────────────────────────────────── */
.t80-lines {
  width: 100%;
  margin-bottom: 2mm;
}
.t80-lines table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5pt;
}
.t80-lines thead th {
  font-weight: 700;
  font-size: 7pt;
  text-align: left;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 1.5mm 0;
}
.t80-lines thead th.t80-col-right {
  text-align: right;
}
.t80-lines tbody td {
  vertical-align: top;
  padding: 1.2mm 0;
}
.t80-lines tbody td.t80-col-right {
  text-align: right;
  white-space: nowrap;
}
.t80-lines tbody td.t80-col-center {
  text-align: center;
  white-space: nowrap;
}
.t80-lines tbody td.t80-qty-value {
  font-size: 5.8pt;
}
/* Désignation : retour à la ligne propre sur 72mm */
.t80-desig {
  word-break: break-word;
  line-height: 1.45;
}
.t80-desig-taxe {
  font-size: 6.5pt;
  color: #444;  /* gris léger à l'écran ; en impression = noir via @media print */
}
.t80-lines tfoot td {
  border-top: 1px dashed #000;
  padding-top: 1.5mm;
}

/* ── Zone totaux ────────────────────────────────────────────────────────── */
.t80-totals {
  font-size: 7.5pt;
  border-top: 1px dashed #000;
  border-bottom: 1px dashed #000;
  padding: 2.5mm 0;
  margin-bottom: 2mm;
}
.t80-totals-row {
  display: flex;
  justify-content: space-between;
  line-height: 1.7;
}
.t80-totals-row.t80-subtotal {
  font-size: 7pt;
}
.t80-totals-row.t80-tva-group {
  font-size: 7pt;
}
.t80-totals-row.t80-total-tva {
  font-size: 7pt;
  font-weight: 700;
  border-top: 1px dashed #000;
  padding-top: 1mm;
  margin-top: 0.5mm;
}
.t80-totals-row.t80-remise {
  font-size: 7pt;
}
.t80-totals-row.t80-grand-total {
  font-size: 10pt;
  font-weight: 900;
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 2mm 0;
  margin: 1.5mm 0;
}
.t80-totals-row.t80-paye {
  font-size: 8pt;
}
.t80-totals-row.t80-monnaie {
  font-size: 8pt;
  font-weight: 700;
}

/* ── Zone fiscale DGI / EMCF ────────────────────────────────────────────── */
.t80-fiscal {
  font-size: 6.5pt;
  border-top: 1px solid #000;
  border-bottom: 1px dashed #000;
  padding: 2mm 0;
  margin-bottom: 2mm;
  line-height: 1.7;
}
.t80-fiscal-title {
  font-size: 7pt;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 1.5mm;
}
.t80-fiscal-row {
  display: flex;
  gap: 1mm;
}
.t80-fiscal-label {
  font-weight: 700;
  flex-shrink: 0;
}

/* ── QR Code ────────────────────────────────────────────────────────────── */
.t80-qr {
  text-align: center;
  padding: 1mm 0;
  margin-bottom: 1mm;
}
.t80-qr img {
  max-width: 28mm;
  max-height: 28mm;
  display: block;
  margin: 0 auto;
}

/* ── Pied de ticket ─────────────────────────────────────────────────────── */
.t80-footer {
  font-size: 6.5pt;
  text-align: center;
  border-top: 1px dashed #000;
  padding-top: 3mm;
  line-height: 1.7;
}
.t80-footer-thanks {
  font-size: 7.5pt;
  font-weight: 700;
  margin-bottom: 1.5mm;
}

/* ── Séparateur tirets ──────────────────────────────────────────────────── */
.t80-sep {
  border: none;
  border-top: 1px dashed #000;
  margin: 2.5mm 0;
}
.t80-sep-solid {
  border: none;
  border-top: 1px solid #000;
  margin: 2.5mm 0;
}


/* ══════════════════════════════════════════════════════════════════════════
   @MEDIA PRINT — règles actives uniquement lors de l'impression / export PDF
   ══════════════════════════════════════════════════════════════════════════ */

@media print {

  /* ── Page : rouleau thermique continu ────────────────────────────────── */
  @page {
    size: 80mm 297mm;
    margin: 2mm 0;
  }

  /* ── Corps : largeur papier, monochrome strict ───────────────────────── */
  html, body {
    width: 80mm;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── Conteneur page ticket ───────────────────────────────────────────── */
  .t80-screen-wrapper {
    background: #fff;
    padding: 0;
    display: block;
  }
  .t80-page {
    width: 80mm;
    padding: 2mm 3mm;
    margin: 0;
    background: #fff;
    color: #000;
    box-shadow: none;
    font-size: 8pt;
  }

  /* ── Masquage éléments non imprimables ───────────────────────────────── */
  .no-print,
  .sidebar,
  .header,
  .footer,
  .navbar,
  .breadcrumb,
  .card-header,
  nav {
    display: none !important;
  }

  /* ── Monochrome : forcer noir/blanc sur tout ─────────────────────────── */
  * {
    color: #000 !important;
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ── Exceptions : bordures et traits restent noirs ───────────────────── */
  .t80-fiscal-title,
  .t80-totals-row.t80-grand-total,
  .t80-desig-taxe {
    color: #000 !important;
  }

  /* ── QR Code : taille maximale sans débordement (72mm utiles) ─────────── */
  .t80-qr img {
    max-width: 28mm;
    max-height: 28mm;
    display: block;
    margin: 0 auto;
  }

  /* ── Tableau lignes articles ─────────────────────────────────────────── */
  .t80-lines table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.5pt;
  }
  .t80-lines thead th {
    font-size: 7pt;
    padding: 0.5mm 0;
  }

  /* ── Évite les coupures de page intempestives dans les zones clés ────── */
  .t80-fiscal,
  .t80-qr,
  .t80-totals {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* ── Liens : texte pur ───────────────────────────────────────────────── */
  a {
    text-decoration: none;
    color: #000 !important;
  }

}
