/* ----- Global ----- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: #f8f8f8;
  color: #333;
  padding: 20px;
}
h1 {
  margin-bottom: 20px;
  font-weight: 700;
  margin-top: 100px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #444;
}

/* ----- Container principal (60% pour la gauche et 40% pour la droite) ----- */
.container {
  display: flex;
  flex-wrap: nowrap;
  max-width: 1400px;
  margin: 0 auto;
}
.left-column {
  width: 66%;
  padding-right: 20px;
}
.right-column {
  width: 44%;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 0; /* Pas d'espace entre la description et l'image */
}

/* ----- Encart des dimensions ----- */
.dimension-encart {
  border: 0px solid #f0f0f0;
  background-color: #fafafa;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 20px;
  display: block;
}
.dimension-main {
  font-size: 16px;
  margin-bottom: 5px;
}
.dimension-divider {
  border: none;
  border-top: 1px solid #ccc;
  margin: 5px 0;
}
.dimension-extra {
  margin-top: 5px;
}
.dimension-extra-line {
  font-size: 14px;
  margin-bottom: 3px;
}
.dim-title {
  font-weight: bold;
  color: #7c7c7c;
  font-size: 1.0em;
}
.dim-item {
  font-weight: normal;
  color: #fd2a8d;
  font-size: 1.0em;
}
.dimension-encart .dim-item::before {
  content: "";
}

/* ----- Description ----- */
.description-placeholder {
  background: #fff;
  border-radius: 0;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin: 0; 
}
.description-placeholder div {
  line-height: 1.3 !important;
  font-size: 13px !important;
  margin-bottom: 10px !important;
}

/* ----- Conteneur d'image ----- */
.image-placeholder {
  display: block;
  position: relative;
  overflow: hidden;
  transition: background-color 0.5s ease;
  width: 100%;
  margin: 0;
}
.image-placeholder img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 0;
  transition: none;
}

/* ----- Formulaire ----- */
form {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}
.form-group {
  flex: 1 1 calc(33.33% - 10px);
  min-width: 200px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.config-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  transition: border 0.3s ease;
  outline: none;
}
.config-input:focus {
  border-color: #cbd7d8;
}

/* ----- Bouton principal type "Call to action" ----- */
button[type="submit"] {
  display: inline-block;
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  border: none;
  border-radius: 999px;
  color: #fff;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
button[type="submit"]:hover {
  box-shadow: 0 8px 24px rgba(255,95,109,0.4);
  transform: translateY(-2px);
}

/* ----- Menus déroulants-multi personnalisés ----- */
.custom-multi-container {
  position: relative;
}
.config-input.hidden-select {
  display: none;
}
.custom-multi-summary {
  border: 1px solid #ccc;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  border-radius: 20px;
  transition: border 0.3s ease;
  user-select: none;
}
.custom-multi-summary:hover {
  border-color: #ff82b3;
}

/* ----- Modal général ----- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}
.modal-content {
  background-color: #fff;
  border-radius: 20px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
}
.modal .close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.3s;
}
.modal .close:hover {
  color: #777;
}

/* ----- Options du modal pour menus multi ----- */
.modal-option {
  display: flex;
  align-items: center;
  padding: 6px 0;
  cursor: pointer;
}
.modal-option input {
  margin-right: 10px;
}
.modal-divider {
  text-align: center;
  padding: 4px 0;
  border-bottom: 1px solid #ccc;
  margin: 8px 0;
}

/* ----- Modal pour les messages d'erreur ----- */
.error-modal {
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
}
.error-content {
  background-color: #fff;
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  position: relative;
}
.error-content p {
  margin-bottom: 20px;
  font-size: 16px;
  color: #444;
  line-height: 1.4;
}
#errorOkBtn {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  border: none;
  border-radius: 999px;
  color: #fff;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  outline: none;
}
#errorOkBtn:hover {
  box-shadow: 0 8px 24px rgba(255,95,109,0.4);
  transform: translateY(-2px);
}
.highlight-error {
  border: 2px solid #ff5f6d !important;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  .left-column, .right-column {
    width: 100%;
    padding: 0;
  }
  .right-column {
    margin-top: 20px;
  }
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  .form-group {
    margin-right: 0;
    width: 100%;
  }
  .custom-multi-container {
    display: none;
  }
  .config-input.hidden-select {
    display: block;
  }
}

/* ----- Portfolio Thumbnails ----- */
.portfolio-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.portfolio-item {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.portfolio-item:hover {
    box-shadow: 0 8px 24px rgba(255,95,109,0.4);
    transform: translateY(-2px);
}
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}
.lightbox-content {
    background: #fff;
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(255,95,109,0.4);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 2100;
    transition: color 0.3s ease;
}
.lightbox-close:hover {
    color: #bbb;
}
.portfolio-empty {
    font-style: italic;
    color: #777;
    margin-top: 20px;
}

/* Cartouche pour afficher le prix et le message */
#priceContainer {
    border: 0px solid #333;
    background-color: #fff;
    padding: 10px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: lighter;
    text-align: left;
    margin-left: -19.8px;
}
.price-container {
    margin-bottom: 0px;
}
.price-label,
.price-option-label {
    font-weight: normal;
    font-size: 13px;
}
.price-options {
    margin-top: 0px;
    margin-bottom: 0px;
}
.price-option {
    padding: 0px 0;
    font-size: 13px;
}
.total-sub {
    font-size: 0.8em;
    font-weight: 300;
}
.total-price {
    text-align: left;
    margin-top: 20px;
    font-size: 18px;
    padding: 0px;
    border-radius: 10px;
}
.total-label {
    font-weight: bold;
}
.total-value {
    background: linear-gradient(135deg, #ff5f6d, #ffc371);
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: normal;
}

.btn-standard2 {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0px 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}
.btn-standard2:hover {
  box-shadow: 0 4px 12px rgba(255,165,0,0.4);
}
.spinner {
  margin: 20px auto;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 165, 0, 0.2);
  border-top: 4px solid orange; 
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.btn-standard {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.9em;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}
.btn-standard:hover {
  box-shadow: 0 4px 12px rgba(255,165,0,0.4);
}
<div id="coefErrorPopup"
     style="
       display:none; 
       position: fixed; 
       top: 50%; left: 50%;
       transform: translate(-50%, -50%);
       background: rgba(255, 0, 0, 0.9);
       color: #fff;
       padding: 15px 20px;
       border-radius: 6px;
       font-size: 14px;
       text-align: center;
       z-index: 9999;
     ">
  <span id="coefErrorText"></span>
</div>

/****************************************
 * 4 colonnes grid : .four-columns-grid
****************************************/
.four-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.form-group-col {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.form-group-col label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #555;
}

/****************************************
 * Table epurée et zébrée
****************************************/
#table-lignes {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
/* En-têtes alignés à gauche */
#table-lignes thead th {
  text-align: left;
  background: #fafafa;
  padding: 12px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #ccc;
}
#table-lignes tbody tr {
  border-bottom: 1px solid #eee;
}
/* Zébrage => une ligne sur 2 (optionnel) */
#table-lignes tbody tr:nth-child(even) {
  background: #fdfdfd;
}
#table-lignes td {
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
  line-height: 1.3em;
}

/* Largeur 1ère colonne => 200px */
#table-lignes th:first-child,
#table-lignes td:first-child {
  width: 200px;
}
.lineNumber {
  font-weight: bold;
  margin-bottom: 3px;
}
.repere-line {
  margin-top: 5px;
  font-size: 0.9em;
  color: #555;
}

/* Largeur 2e colonne => 400px + clamp 4 lignes */
#table-lignes th:nth-child(2),
#table-lignes td:nth-child(2) {
  width: 400px;
}
.desc-limited {
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4; /* 4 lignes max */
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2em;
  max-height: 4.8em;
}

/****************************************
 * Boutons "ligne-btn", etc.
****************************************/
.ligne-btn {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  border: none;
  border-radius: 20px;
  color: #fff;
  padding: 5px 10px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  font-size: 12px;
  margin-right: 5px;
}
.ligne-btn:hover {
  box-shadow: 0 4px 12px rgba(255,95,109,0.4);
  transform: translateY(-2px);
}
.big-btn {
  font-size: 15px;
  padding: 8px 20px;
}
.ligne-actions-top {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

/****************************************
 * .edit-section => Description en 1er (3 col),
   puis 4 champs
****************************************/
.edit-section {
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 10px;
  display: none;
}
.edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}
/* desc => 3 col wide */
.edit-desc {
  grid-column: 1/4;
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.edit-desc textarea {
  height: 200px;
  resize: vertical;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 8px;
}
.edit-grid > div label {
  font-weight: bold;
  margin-bottom: 5px;
}
.edit-actions {
  margin-top: 10px;
}
.edit-actions button {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  border: none;
  border-radius: 20px;
  color: #fff;
  padding: 5px 14px;
  margin-right: 8px;
  cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  font-size: 13px;
}
.edit-actions button:hover {
  box-shadow: 0 4px 12px rgba(255,95,109,0.4);
  transform: translateY(-2px);
}

/****************************************
 * TOT area
****************************************/
.total-area {
  text-align: right;
  font-weight: bold;
  margin-top: 15px;
}

/****************************************
 * Some default .card, etc.
****************************************/
.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  position: relative;
}

/* 4 colonnes grid => .four-columns-grid */
.four-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.form-group-col {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.form-group-col label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #555;
}

/****************************************
 * Responsive => 4 col => 2 col => 1 col
****************************************/
@media (max-width:1200px) {
  .four-columns-grid {
    grid-template-columns: repeat(2,1fr);
  }
}
@media (max-width:600px) {
  .four-columns-grid {
    grid-template-columns:1fr;
  }
}

/****************************************
 * Client search container
****************************************/
.client-search-container {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  flex: 1;
}
.client-search-box {
  position: relative;
  flex-shrink:0;
}
.client-suggestions {
  position:absolute;
  top:100%;
  left:0;
  background:#fff;
  border:1px solid #ccc;
  max-height:180px;
  overflow-y:auto;
  display:none;
  z-index:9999;
}
.client-infos.inline-infos {
  display:none;
  border:1px solid #ccc;
  padding:10px;
  max-width:280px;
  margin:0;
  flex-shrink:0;
}




/* ============================
   Ajouts pour la page "ajouter_devis.php"
   ============================ */

/* Pour la card "Créer un Devis" */
.card {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 20px;
  position: relative;
}

/* Autocomplétion client */
.client-search-container {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.client-search-box {
  position: relative;
}
.client-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #ccc;
  max-height: 180px;
  overflow-y: auto;
  display: none; /* masqué par défaut */
  z-index: 9999;
  width: 220px; /* s'adapte à la largeur de l'input, si besoin */
}
.client-suggestions .modal-option {
  padding: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.client-suggestions .modal-option:hover {
  background: #f3f3f3;
}
/* Les infos du client (à droite) */
.client-infos.inline-infos {
  border: 1px solid #ccc;
  background: #fafafa;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 280px;
  display: none;
}

/* Table-lignes (zébrage) */
#table-lignes {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
#table-lignes thead th {
  background: #fafafa;
  border-bottom: 2px solid #ccc;
  text-transform: uppercase;
  font-size: 12px;
  padding: 12px 8px;
}
#table-lignes tbody tr:nth-child(even) {
  background: #fcfcfc;
}
#table-lignes td {
  border-bottom: 1px solid #eee;
  padding: 8px;
  vertical-align: middle;
}

/* Boutons du haut pour "ajouter ligne vide" etc. */
.ligne-actions-top {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
/* Gros bouton coloré */
.big-btn {
  font-size: 15px;
  padding: 8px 18px;
}
/* On garde .ligne-btn existant */

/* Zone Totaux (aligné à droite) */
.total-area {
  text-align: right;
  margin-top: 10px;
}
.total-area p {
  margin: 3px 0;
  font-weight: bold;
}
/* espace sous le label pour Client et Contact en jouant sur le champ */
.column.block > input#clientSearch,
.column.block > select#contactSelect {
  margin-top: 5px !important;
  display: block; /* pour être sûr que ça s’applique comme un bloc */
}
/* ESPACE SOUS LE LABEL NOM COMMERCIAL */
.column.block label[for="commercialSelect"] {
  display: block !important;
  margin-bottom: 28px !important;
}
#transportMessage {
  display: none !important;
}
#submitBtn {
  background: linear-gradient(135deg, #ff5f6d, #ffc371);
  color: #fff;
  font-weight: bold;
  padding: 10px 20px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

#submitBtn.loading {
  color: transparent;
  pointer-events: none;
}

#submitBtn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 4px;
  background: #fff;
  border-radius: 2px;
  animation: loading-bar 2s linear forwards;
  transform: translateY(-50%);
}

@keyframes loading-bar {
  0% { left: 10%; width: 0%; }
  100% { left: 10%; width: 80%; }
}
.two-cols-full {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.two-cols-full .column.block {
  flex: 1 1 100%;
}
.adresse-livraison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.adresse-livraison-col {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.adresse-livraison-col label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}
.adresse-livraison-col input,
.adresse-livraison-col textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 12px;
  margin-top: 5px;
  resize: vertical;
}