/* Styles de base pour le body */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4; /* Ajout d’un fond neutre */
    overflow-x: hidden; /* Évite le défilement horizontal */
}

/* Partie supérieure divisée en 2 */
#header {
    display: flex;
    height: 60px;
}

#header-gauche {
    background-color: #4CAF50;
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

#header-droit {
    background-color: #2196F3;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Style du sélecteur de catégories */
#categories-select {
    width: 80%;
    padding: 10px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    outline: none;
}

/* Contenu principal */
#contenu {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: 10px; /* Espace entre les sections */
    padding: 10px;
}

#panier {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: linear-gradient(to bottom, #a2c2e8, #e6f2ff);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
}

#contenu-panier {
    background-color: #f4f4f4;
    border-radius: 8px;
    padding: 10px;
    min-height: 100px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

/* Scanner en bas de la page */
#scanner {
    position: fixed;
    bottom: 0;
    left: 28%;
    right: 0;
    background-color: white;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

/* Produits */
#produits {
    flex: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    padding: 10px;
    padding-bottom: 80px;
}

.produit {
    flex: 0 0 20%;
    margin: 10px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 10px;
    transition: transform 0.2s;
}

.produit:hover {
    transform: scale(1.05);
}

.produit img {
    width: 50%;
    height: auto;
    border-radius: 5px;
}

/* Boutons */
button {
    background-color: #db7e0d;
    color: white;
    border: none;
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

/* Icônes */
.icon {
    font-size: 24px;
    margin: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon:hover {
    transform: scale(1.2);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1050;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    width: 50%;
    max-height: 80%;
    overflow-y: auto;
    text-align: center;
}

/* Bouton pour annuler une commande */
button[onclick="AnnulerCommande()"] {
    background-color: red;
}

button[onclick="AnnulerCommande()"]:hover {
    background-color: darkred;
}

/* Input QR code */
#input-qrcode {
    border: 2px solid #DB7E0D;
    border-radius: 5px;
    padding: 8px;
    width: 300px;
    font-size: 16px;
    outline: none;
    transition: box-shadow 0.3s;
}

#input-qrcode:focus {
    border-color: #2196F3;
    box-shadow: 0 0 8px #2196F3;
}

/* Ticket de caisse */
.ticket-caisse {
    width: 300px;
    margin: 20px auto;
    padding: 10px;
    border: 1px solid #000;
    border-radius: 5px;
    background-color: #fff;
}

.header-ticket {
    text-align: center;
    margin-bottom: 10px;
}

.qrcode-ticket {
    width: 100px;
    height: 100px;
}

@media print {
    body * {
        display: none;
    }
    .ticket-caisse, .ticket-caisse * {
        display: block;
    }
}

/* Formulaires */
.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-control {
    flex: 1;
    padding: 10px;
    font-size: 16px;
    margin-bottom: 10px;
}

.table {
    width: 80%;
    margin: auto;
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    margin-top: 20px;
}

/* Responsivité */
@media (max-width: 768px) {
    #panier, #produits {
        flex: 100%;
        min-width: 100%;
    }
    .produit {
        flex: 0 0 100%;
    }
    .modal-content {
        width: 90%;
    }
}



/* =========================
   UI v4 — look pro
========================= */
#header{
  align-items:center;
  padding:10px;
  gap:10px;
  height:auto;
}
#header-gauche, #header-droit{
  border-radius:12px;
  padding:10px;
}
#header-gauche{
  justify-content:flex-start;
  gap:12px;
}
#nouvelle-commande{
  background:#ff8a00;
  border:none;
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  font-weight:700;
}
#categories-select{
  width:100%;
  max-width:520px;
}
#header-droit{
  justify-content:flex-end;
  gap:12px;
}
.icon{
  font-size:22px;
  cursor:pointer;
  user-select:none;
}
#contenu{
  gap:16px;
  padding:16px;
}
#panier{
  border-radius:16px;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
}
#produits{
  flex:2;
  min-width:520px;
  border-radius:16px;
  box-shadow:0 8px 18px rgba(0,0,0,.08);
  background:#fff;
  padding:16px;
}
#panier table{
  background:#fff;
  border-radius:12px;
  overflow:hidden;
}
#panier .btn{
  border-radius:10px;
}

/* Footer panier plus "caisse" */
.panier-footer{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.panier-total{
  font-weight:800;
  font-size:16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:8px 10px;
  background:rgba(0,0,0,.04);
  border-radius:12px;
}
.panier-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.panier-actions .btn{
  width:100%;
  padding:10px 10px;
  font-weight:700;
}
#scanner{
  position:sticky;
  bottom:0;
  background:#fff;
  padding:10px;
  box-shadow:0 -6px 16px rgba(0,0,0,.06);
  border-top:1px solid rgba(0,0,0,.08);
}

/* Modales */
.modal{
  background:rgba(0,0,0,.45);
  padding:14px;
}
.modal-content{
  border-radius:16px;
  max-width:980px;
  width:100%;
  max-height:88vh;
  overflow:auto;
  box-shadow:0 18px 40px rgba(0,0,0,.25);
}
.modal-xl{ max-width:1100px; }
.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:14px 14px 6px 14px;
  border-bottom:1px solid rgba(0,0,0,.08);
}
.modal-footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:10px 14px 14px 14px;
  border-top:1px solid rgba(0,0,0,.08);
}
.modal-grid{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:14px;
  padding:14px;
}
.modal-col{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:14px;
  padding:12px;
  max-height:64vh;
  overflow:auto;
}
.modal-section-title{
  font-weight:700;
  margin-bottom:10px;
}

/* Mobile */
@media (max-width: 900px){
  #produits{ min-width:0; }
  .modal-grid{ grid-template-columns:1fr; }
  .modal-col{ max-height:none; }
}

/* Liste commandes: meilleure lisibilité */
.list-group-item{ border-radius:12px; margin-bottom:8px; }
.list-group-item:last-child{ margin-bottom:0; }
