/* 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: #EC2166;
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

#header-droit {
    background-color: #EC2166;
    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 */
/* Modals - Styles généraux */
.modal {
    display: none; /* Masqué par défaut */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* Fond semi-transparent */
    justify-content: center;
    align-items: center;
}

/* Contenu des modales */
.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out; /* Animation légère */
}

/* Bouton de fermeture (positionné en haut à droite) */
.modal-content .close {
    float: right;
    font-size: 24px;
    cursor: pointer;
    color: #555;
}

.modal-content .close:hover {
    color: #db7e0d;
}

/* Animation pour les modales */
@keyframes slideDown {
    from {
        transform: translateY(-20%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Apparence des boutons dans les modales */
.modal-content button {
    background-color: #db7e0d;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.modal-content button:hover {
    background-color: #45a049;
}

/* Champs de formulaire dans les modales */
.modal-content input,
.modal-content select {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.modal-content input:focus {
    border-color: #2196F3;
    box-shadow: 0 0 5px #2196F3;
    outline: none;
}

/* Adaptabilité pour les petits écrans */
@media (max-width: 768px) {
    .modal-content {
        width: 90%; /* Réduction de la largeur sur les petits écrans */
    }
}


/* 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%;
    }
}
