/* --------- Onglets --------- */
.cv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.cv-tab {
  padding: 8px 14px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #eee;
  border-radius: 6px;
  transition: background 0.2s ease;
  font-size: 14px;
}

.cv-tab.active {
  background: #ccc;
}

/* --------- Contenu par pièce --------- */
.cv-content {
  display: none;
}
.cv-content.active {
  display: block;
}

/* --------- Zone d'objets --------- */
.cv-items-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}

/* --------- Carte objet --------- */
.cv-item {
  width: 140px;
  background: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  padding: 10px;
  font-size: 13px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
}

.cv-item img {
  width: 90px;
  height: auto;
  margin-bottom: 6px;
}

.item-label {
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
}

/* --------- Contrôles (boutons + champ) --------- */
.item-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
}

.quantity {
  width: 30px;
  height: 30px;
  text-align: center;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 4px;
  line-height: 1;
}

.btn-plus,
.btn-minus {
  width: 30px;
  height: 30px;
  font-size: 16px;
  background: #eee;
  border: 1px solid #bbb;
  border-radius: 4px;
  line-height: 1;
  transition: background 0.2s ease;
}

.btn-plus:hover,
.btn-minus:hover {
  background: #ddd;
}

/* --------- Modale (flottante) --------- */
.modal-content {
  background-color: #fff;
  margin: 120px auto;           /* plus d'espace en haut */
  padding: 30px;
  width: 90%;
  max-width: 700px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

/* --------- Impression ciblée (window.print) --------- */
@media print {
  /* Masquer tout le reste */
  body * {
    display: none !important;
    visibility: hidden !important;
  }

  /* Afficher uniquement la modale et son contenu */
  #summary-modal,
  #summary-modal .modal-content,
  #summary-modal .modal-content * {
    display: block !important;
    visibility: visible !important;
  }

  /* Positionner la modale plein écran A4 */
  #summary-modal .modal-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 10px !important;
    box-shadow: none !important;
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
  }

  /* Table en pleine largeur avec bordures */
  #summary-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
  }
  #summary-table th,
  #summary-table td {
    border: 1px solid #000 !important;
    padding: 8px !important;
  }
  #summary-table thead {
    display: table-header-group !important; /* répéter sur chaque page */
  }

  /* Cacher la croix et les boutons de la modale */
  #summary-modal .close,
  #summary-modal .cv-summary-buttons {
    display: none !important;
  }

  /* Démarrer dès la première page */
  #summary-modal .modal-content {
    page-break-before: always !important;
  }
}
