body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1, h2 {
    color: #333;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

button:hover {
    background-color: #0056b3;
}

main {
    padding: 15px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.product-card {
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.product-card button {
    background-color: #28a745;
    font-size: 14px;
}

.product-card button:hover {
    background-color: #218838;
}

.cart-section ul {
    list-style: none;
    padding: 0;
}

.cart-section li {
    background-color: white;
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Ajout d'une ombre ici */
    display: flex; /* Assure que le contenu est organisé */
    justify-content: space-between;
    align-items: center;
}

/* Scanner (conservé tel quel pour l'instant) */
#scannerContainer {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: black;
    margin-bottom: 20px;
    overflow: hidden;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 0 100vw rgba(0, 0, 0, 0.5);
    border: 2px dashed white;
    box-sizing: border-box;
}

/* Styles pour le mode paysage sur mobile (optionnel) */
@media (orientation: landscape) {
    main {
        display: flex;
        gap: 15px;
    }
    .products-section, .cart-section {
        flex: 1;
    }
}

/* Styles pour les éléments du panier (laisse comme vous l'avez fourni précédemment) */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.item-info {
    flex-grow: 1;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-name {
    font-weight: bold;
    display: block;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    background-color: #6c757d;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.quantity-btn:hover {
    background-color: #5a6268;
}

.quantity-display {
    min-width: 25px;
    text-align: center;
    font-weight: bold;
    padding: 0 5px;
    flex-shrink: 0;
}

.item-total-price {
    font-weight: bold;
    color: #007bff;
    margin: 0 5px;
    flex-shrink: 0;
}

.remove-btn {
    background-color: #dc3545;
    padding: 5px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.remove-btn:hover {
    background-color: #c82333;
}

.remove-btn i {
    font-size: 16px;
    color: white;
}

/* --- Barre de Recherche (Nouveau look) --- */
.search-bar {
    margin-bottom: 20px; /* Espace sous la barre de recherche */
}

#productSearchInput {
    width: calc(100% - 24px); /* Prend toute la largeur moins le padding */
    padding: 12px; /* Padding généreux pour le confort */
    border: 2px solid #007bff; /* Bordure primaire bleue */
    border-radius: 8px; /* Coins arrondis, cohérents avec d'autres éléments */
    font-size: 17px; /* Taille de police confortable */
    box-sizing: border-box; /* Inclut padding et border dans la largeur */
    transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Transitions douces pour l'interactivité */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Petite ombre pour la profondeur */
}

#productSearchInput::placeholder {
    color: #999; /* Couleur du texte d'exemple plus claire */
    font-style: italic; /* Texte d'exemple en italique */
}

#productSearchInput:focus {
    outline: none; /* Supprime le contour par default au focus */
    border-color: #0056b3; /* Bordure plus foncée au focus */
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.25); /* Anneau lumineux au focus */
}

/* --- Client Phone Input Group (Nouveau look) --- */
.client-phone-group {
    margin-top: 25px; /* Plus d'espace au-dessus du groupe */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.client-phone-group label {
    margin-bottom: 8px; /* Plus d'espace entre le label et les champs */
    font-weight: bold;
    color: #555; /* Légèrement plus doux */
    font-size: 16px;
}

.phone-input-fields {
    display: flex;
    gap: 10px; /* Plus d'espace entre les champs de téléphone */
    width: 100%;
    align-items: center; /* Assure un alignement vertical parfait */
}

#countryCode {
    padding: 10px 12px;
    border: 2px solid #007bff; /* Bordure colorée pour le code pays */
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    appearance: none; /* Supprime le style par défaut du navigateur */
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Icône de flèche personnalisée pour le select */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2C197.4L159.3%2C69.7c-5.8-5.8-15.2-5.8-21%2C0L5.4%2C197.4c-5.8%2C5.8-5.8%2C15.2%2C0%2C21l10.6%2C10.6c5.8%2C5.8%2C15.2%2C5.8%2C21%2C0l110.8-110.8l110.8%2C110.8c5.8%2C5.8%2C15.2%2C5.8%2C21%2C0l10.6-10.6C292.8%2C212.6%2C292.8%2C203.2%2C287%2C197.4z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Petite ombre */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#countryCode:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#clientPhone {
    flex-grow: 1;
    padding: 10px 12px;
    border: 2px solid #ddd; /* Bordure neutre par défaut */
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Petite ombre */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#clientPhone::placeholder {
    color: #aaa; /* Couleur de placeholder plus claire */
}

#clientPhone:focus {
    outline: none;
    border-color: #007bff; /* Bordure bleue au focus */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* --- Payment Method Select (Nouveau look) --- */
.payment-selection {
    margin-top: 20px; /* Plus d'espace au-dessus */
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.payment-selection label {
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
    font-size: 16px;
}

#paymentMethod {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd; /* Bordure neutre par défaut */
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    appearance: none; /* Supprime le style par défaut du navigateur */
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Icône de flèche personnalisée pour le select */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2C197.4L159.3%2C69.7c-5.8-5.8-15.2-5.8-21%2C0L5.4%2C197.4c-5.8%2C5.8-5.8%2C15.2%2C0%2C21l10.6%2C10.6c5.8%2C5.8%2C15.2%2C5.8%2C21%2C0l110.8-110.8l110.8%2C110.8c5.8%2C5.8%2C15.2%2C5.8%2C21%2C0l10.6-10.6C292.8%2C212.6%2C292.8%2C203.2%2C287%2C197.4z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08); /* Petite ombre */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#paymentMethod:focus {
    outline: none;
    border-color: #007bff; /* Bordure bleue au focus */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
/* --- Pagination Controls --- */
.pagination-controls {
    display: flex; /* Active Flexbox pour aligner les éléments enfants */
    justify-content: center; /* Centre les boutons et le libellé horizontalement */
    align-items: center; /* Aligne les éléments verticalement au centre */
    margin-top: 20px;
    margin-bottom: 20px;
    gap: 15px; /* Crée un espace entre les éléments (boutons et libellé) */
    flex-wrap: wrap; /* Permet aux éléments de passer à la ligne sur de petits écrans */
}

.pagination-controls button {
    padding: 8px 15px;
    font-size: 1em;
    cursor: pointer;
    background-color: #007bff; /* Bleu standard */
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    
    /* Assure que le bouton a une hauteur et un alignement internes cohérents */
    min-height: 40px; /* Définit une hauteur minimale */
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #0056b3; /* Bleu plus foncé au survol */
}

/* --- Styles pour l'affichage du numéro de page --- */
.page-info-display {
    font-size: 1.2em; /* Rend le texte plus lisible */
    font-weight: bold;
    color: #444; /* Couleur de texte gris foncé */
    background-color: #f0f0f0; /* Léger fond gris pour le faire ressortir */
    padding: 8px 12px; /* Espacement intérieur */
    border-radius: 5px; /* Coins légèrement arrondis */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Ombre interne subtile */
    min-width: 120px; /* Largeur minimale pour éviter les changements brusques de taille */
    text-align: center; /* Centre le texte horizontalement */
    
    /* Ces propriétés Flexbox sont cruciales pour l'alignement et la hauteur */
    display: flex; /* Rend cet élément aussi un conteneur flex pour son propre contenu */
    align-items: center; /* Centre le texte "Page X / Y" verticalement */
    justify-content: center; /* Centre le texte "Page X / Y" horizontalement */
    min-height: 40px; /* **Ceci est clé : Assure la même hauteur minimale que les boutons** */
}

