body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    padding: 20px;
}

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px;
    width: 230px;
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: scale(1.05);
}

.card img {
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    cursor: zoom-in;
}

.title {
    font-size: 14px;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
}

.price {
    margin: 6px 0;
}

.dzd {
    color: #D9230F;
    font-weight: bold;
}

.add-to-cart {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.add-to-cart:hover {
    background-color: #218838;
}

#cart {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#cart h3 {
    margin-bottom: 15px;
}

#cart ul {
    list-style: none;
    padding: 0;
}

#cart ul li {
    margin-bottom: 10px;
}

#order-form {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#order-form input,
#order-form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

#order-form button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#order-form button:hover {
    background-color: #0069d9;
}

#image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

#image-modal img {
    max-width: 90%;
    max-height: 90%;
}

/* Icône du panier */
#cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compteur du panier */
#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 12px;
}

/* Contenu du panier */
#cart {
    position: fixed;
    top: 80px; /* Ajustez cette valeur en fonction de la taille de l'icône */
    right: 20px;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 999;
}

/* Styles pour les écrans de moins de 768px de large */
@media only screen and (max-width: 768px) {
    #cart {
        width: 90%;
        right: 5%;
        top: 70px;
    }

    #cart-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #cart-count {
        font-size: 10px;
        padding: 1px 4px;
    }
}

.remove-item {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

#checkout-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
}

#checkout-button:hover {
    background-color: #218838;
}



#cart {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

#cart h3 {
    margin-top: 0;
    font-size: 1.5em;
    color: #333;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
}

#cart-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

#cart-items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eaeaea;
}

#cart-items li img {
    width: 50px;
    height: auto;
    margin-right: 10px;
    border-radius: 5px;
}

#cart-items li .item-details {
    flex-grow: 1;
}

#cart-items li .item-details p {
    margin: 0;
    font-size: 14px;
    color: #555;
}

#cart-items li .remove-item {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
}

#cart-total {
    font-weight: bold;
    font-size: 1.2em;
    color: #333;
    margin-top: 10px;
}

.custom-alert .modal-content {
  background-color: #f0f8ff; /* Couleur de fond personnalisée */
  border: 2px solid #007bff; /* Bordure bleue */
  border-radius: 10px;       /* Coins arrondis */
}

.custom-alert .modal-header {
  background-color: #007bff; /* En-tête bleu */
  color: white;              /* Texte blanc */
  border-bottom: none;       /* Suppression de la bordure inférieure */
}

.custom-alert .modal-footer .btn-primary {
  background-color: #28a745; /* Bouton vert */
  border-color: #28a745;
}

/* Style personnalisé pour le bouton de fermeture */


/* Personnalisation du bouton de fermeture */
.modal-header .btn-close {
  background-color: transparent;
  border: none;
  font-size: 1.5rem;
  color: #000;
  opacity: 0.5;
}

.modal-header .btn-close:hover {
  opacity: 1;
  color: #dc3545; /* Rouge Bootstrap */
}


#user-balance {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background-color: #e9fbe5;
      padding: 12px 20px;
      border-radius: 10px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

#balance-amount {
  color: #d9534f; /* Rouge Bootstrap */
  font-weight: bold;
}

.text-success-custom {
  color: #198754; /* Couleur verte de Bootstrap 5 pour btn-success */
  font-weight: bold;
}

 .center {
      text-align: center;
    }

.btn-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 20px; 
    max-width: 350px; /* optionnel, pour forcer le retour à la ligne */
  }

  .btn-grid button {
    flex: 1 0 calc(25% - 20px); /* 4 par ligne avec marge horizontale déduite */
    box-sizing: border-box;
    min-width: 60px;
    padding: 10px 15px;
  }
