/* ===== PANIER ===== */

.cart-section {
  position: fixed;
  top: 10%;
  right: -400px;
  width: 350px;
  height: 80vh; 
  max-height: 90vh;
  overflow: hidden; 
  display: flex;
  flex-direction: column;
  background-color: #fffdf6;
  border-radius: 12px;
  padding: 20px;
  transition: right 0.3s ease-in-out;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-section.show {
  right: 0;
}

.cart-section h3 {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #333;
}

.cart-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.cart-section ul li {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-section ul li:last-child {
  border-bottom: none;
}

.cart-product {
  display: flex;
  align-items: center;
  background-color: transparent;
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  he: 10px;
}

.cart-product-image {
  width: 70px;
  height: auto;
  margin-right: 12px;
}

.cart-product-info {
  flex: 1;
}

.cart-product-name {
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 14px;
}

.cart-product-quantity {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  background-color: #fff;
  font-weight: bold;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


.qty-value {
  display: inline-block;
  width: 30px;
  text-align: center;
  font-size: 16px;
  margin: 0 10px;
}

.cart-product-price {
  font-size: 14px;
  color: #444;
}

.cart-delete-btn {
  border: none;
  background: none !important;
  font-size: 10px !important;
  cursor: pointer;
  color: #000 !important;
  margin-left: 8px;
}

#cartTotal {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  padding: 15px;
  margin-top: auto;
  margin: -10px;
  border-radius: 5px;
}

.cart-section button {
  background: #152040;
  color: white;
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
  margin-top: 10px;
}

.cart-section h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
}

#cartList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.cart-section button:hover {
  background: red;
}

#closeCart {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: #152040;
  cursor: pointer;
}

#closeCart:hover {
  color: red;
}

.cart-btn {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background-color: white;
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  display: inline-block;
}

.cart-btn i {
  font-size: 24px;
  color: #152040;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #d19b6f;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  z-index: 1002;
}

.DisplayPanier-btn {
  background: #e0b78f;
  color: #1e2a57;
  font-family: "lovelo Black";
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  padding: 10px 20px;
  border-radius: 20px;
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px;
  margin-left: auto;
  margin-right: 10px;
}

.DisplayPanier-btn:hover {
  background-color: #d19b6f;
  color: #1e2a57;
}

.cart-header {
  background-color: #d2ae88;
  padding: 10px;
  border-radius: 10px 10px 0 0;
  font-weight: bold;
  color: black;
  text-align: center;
  margin: 0px 0px 10px 0px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
  margin-top: 30px;
  font-size: 18px;
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

#cart-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 20px;
  margin-bottom: 10px;
  justify-items: center;
}

/* Bouton en haut à gauche */
.cart-header-actions {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.cart-header-actions button {
  background-color: #c0392b;
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cart-header-actions button:hover {
  background-color: #e74c3c;
}

/* Infos livraison */
.cart-info {
  text-align: center;
  font-size: 14px;
  color: #555;
  margin-top: 10px;
  line-height: 1.6;
}

.cart-info p {
  margin: 5px 0;
}

/* Bouton centré en bas */
.cart-actions {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-top: 15px;
}

.cart-display-btn {
  background-color: #e0b78f;
  color: #1e2a57;
  font-weight: bold;
  font-size: 16px;
  padding: 10px 20px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.cart-display-btn:hover {
  background-color: #d19b6f;
}
.cart-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: 10px;
}

/* Centrer le h2 visuellement */
.cart-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: bold;
  margin: 0;
  color: #1e2a57;
}

.clear-cart-btn {
  background-color: #c0392b;
  color: white;
  border: none;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.clear-cart-btn:hover {
  background-color: #e74c3c;
}

/* Un élément vide à droite pour équilibrer le flex */
.spacer {
  width: 65px; /* Même largeur que le bouton "Vider" pour équilibrer */
}

@media screen and (max-height: 600px) {
  .cart-section {
    top: 5%;
    height: 90vh;
    padding: 10px;
  }

  .cart-section h3,
  .cart-section h2 {
    font-size: 16px;
  }

  .cart-product {
    /*flex-direction: column;*/
    align-items: flex-start;
  }

  .cart-product-image {
    width: 60px;
    margin-bottom: 5px;
  }

  .qty-btn {
    width: 22px;
    height: 22px;
    font-size: 14px;
     display: flex;
  align-items: center;
  justify-content: center;
  }

  .qty-value {
    font-size: 12px;
  }

  .cart-section button {
    font-size: 14px;
    padding: 8px 10px;
  }

  #cartTotal {
    font-size: 14px;
  }

  .cart-total {
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    padding: 10px;
  }

  .DisplayPanier-btn {
    font-size: 14px;
    padding: 6px 10px;
    margin: 5px auto;
  }
}

/* Mobile (≤ 480px) */
@media screen and (max-width: 480px) {
   .cart-header-line {
    padding: 0 10px;
    margin-bottom: 10px;
    height: 50px;
  }

  .cart-title {
    font-size: 18px;
  }

  .clear-cart-btn {
    font-size: 12px;
    padding: 4px 10px;
  }

  .spacer {
    width: 60px; /* conserve l'équilibre visuel */
  }
  .cart-section {
    right: -100%;
    width: 100%;
    max-width: none;
    top: 0;
    height: 100vh;
    border-radius: 0;
    padding: 15px;
  }

  .cart-section.show {
    right: 0;
  }

  .cart-product-image {
    width: 50px;
    margin-right: 8px;
  }

  .cart-product-name {
    font-size: 10px;
  }

  .qty-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
  }

  .qty-value {
    font-size: 14px;
  }

 /* #cartTotal {
    font-size: 16px;
  }*/

  .cart-btn {
    right: 15px;
    bottom: 80px;
  }

  .DisplayPanier-btn {
    font-size: 16px;
    padding: 8px 15px;
    margin: 8px auto;
  }

  .cart-total {
    font-size: 16px;
    flex-direction: column;
    gap: 10px;
  }

  #cart-container {
    grid-template-columns: repeat(1, 1fr);
    padding: 10px;
    gap: 10px;
  }
}

/* Tablet (481px - 768px) */
@media screen and (max-width: 768px) {
  .cart-section {
    width: 90%;
    max-width: none;
    right: -100%;
    height: 70vh;
    top: 10%;
  }

  .cart-section.show {
    right: 0;
  }

  #cart-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .DisplayPanier-btn {
    font-size: 16px;
    padding: 8px 15px;
  }
}
