/* ==========================================================================
   PRINT — BFA signé (PDF)
   ========================================================================== */

/* ---------- 1) Page box / marges PDF ------------------------------------ */
@page {
  /* Laisse de la place au header du PDF (toutes pages) */
  margin-top: 47mm;
  margin-right: 15mm;
  margin-bottom: 20mm;
  margin-left: 15mm;
  size: auto;
}

@page :first {
  /* 1re page un peu plus compacte si souhaité */
  margin-top: 40mm;
}

/* ---------- 2) Règles générales impression ------------------------------ */
@media print {
  html, body { margin: 0; border: 0; }

  /* Permet au header/footer de tableau de se répéter correctement */
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }

  /* Masque les éléments de contrôle */
  button, .no-print { display: none !important; }

  /* Empêche les coupures malheureuses mais SANS forcer un saut partout */
  * { break-inside: avoid-page; }
}

/* ==========================================================================
   PRINT — Compat projet (on garde les comportements utiles)
   ========================================================================== */

/* Chaque “page” de contenu PDF interne reste isolée */
body .form-modal .pdf_form_inner {
  display: block;
  page-break-after: always;
}

/* Inputs en mode printable : pas de bordure */
body.wp-core-ui .bfq-form.printable select,
.bfq-form.printable input,
.bfq-form.printable select,
.bfq-form.printable .cancel_field > input {
  border-color: transparent !important;
}

/* Évite d’introduire des sauts avant les cellules/titres BFQ existants */
.bfq-form.printable p,
.bfq-form.printable td,
.bfq-form.printable th { page-break-before: avoid; }

/* ==========================================================================
   PRINT — Tableau des vols (BFQ / BFA / BFC)
   ========================================================================== */

/* Hauteur et vertical-align uniformes pour toutes les cellules */
.modal-table.airbook_flight_details th,
.modal-table.airbook_flight_details td {
  height: 40px;                 /* ajuste 35–45px si besoin */
  padding: 4px 6px;
  vertical-align: middle;
}

/* Centrage From / To (contenu en <span>) */
.modal-table.airbook_flight_details .address-filed,
.modal-table.airbook_flight_details .address-filed .destination {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PDF export – serrage */
.airbook_flight_details th,
.airbook_flight_details td {
  height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  vertical-align: middle !important;
}

.airbook_flight_details .table-item {
  min-height: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.airbook_flight_details .address-filed .destination {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
}

/* Colonne Pax souvent étroite → largeur fixée */
.airbook_flight_details th:last-child,
.airbook_flight_details td:last-child {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  text-align: center !important;
}

/* ---------- 3) FIX CENTRAGE DES VALEURS EN INPUT/SELECT ----------------- */
/* On cible les VALEURS (lignes de données) pour Date / ETD / ETA / ETE / Pax.
   On centre le texte DANS le champ et on égalise la hauteur via line-height. */

.bfa-pdf.signed table.airbook_flight_details tbody td:nth-child(1) .table-item input,
.bfa-pdf.signed table.airbook_flight_details tbody td:nth-child(4) .table-item input,
.bfa-pdf.signed table.airbook_flight_details tbody td:nth-child(5) .table-item input,
.bfa-pdf.signed table.airbook_flight_details tbody td:nth-child(6) .table-item input {
  text-align: center !important;
  height: 32px !important;        /* = hauteur imposée plus haut */
  line-height: 32px !important;   /* centre verticalement le texte */
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Pax peut être un <select> : on force le centrage cross-browser */
.bfa-pdf.signed table.airbook_flight_details tbody td:nth-child(7) .table-item select {
  height: 32px !important;
  line-height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;

  text-align: center !important;
  text-align-last: center !important; /* Firefox/Edge */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Par sécurité, si une ligne garde 40px, on hérite proprement */
@media print {
  .bfa-pdf.signed table.airbook_flight_details tbody tr td .table-item input,
  .bfa-pdf.signed table.airbook_flight_details tbody tr td .table-item select {
    height: inherit !important;
    line-height: inherit !important;
  }
}

/* ==========================================================================
   PRINT — Gap fiable avant “Important Notes”
   ========================================================================== */

/* Espace structurel géré par le moteur d’impression */
.bfa-pdf.signed .form-notice-wrap.important_notes {
  margin-top: 30px !important;     /* ajuste l’espace ici */
  padding-top: 0 !important;
  page-break-before: avoid !important;
}

/* Anti-collapsing quand le bloc commence en haut d’une nouvelle page */
.bfa-pdf.signed .form-notice-wrap.important_notes::before {
  content: "";
  display: block;
  height: 30px;                    /* même valeur que margin-top */
}

/* ==========================================================================
   FIN
   ========================================================================== */