/* Stile generale per la sezione carrello */
.cart-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1000px;
  margin: 20px auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

/* Sezione sinistra: Lista dei prodotti */
.cart-items {
  width: 60%;
}

.cart-items h2 {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 10px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid #ddd;
}

.cart-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 5px;
}

/* Dettagli dei prodotti */
.cart-details {
  flex-grow: 1;
  margin-left: 15px;
}

.cart-details p {
  margin: 5px 0;
}

.quantity-btn {
  border: none;
  background-color: #ddd;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  margin: 0 5px;
}

.remove-btn {
  background-color: red;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
}

/* Sezione destra: Totale e Info */
.cart-summary {
  width: 35%;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  text-align: center;
}

.cart-summary h3 {
  font-size: 20px;
  margin-bottom: 10px;
}

#total-price {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 20px;
}

/* Info sicurezza e spedizione */
.cart-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.security-info,
.delivery-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #eef3f7;
  padding: 10px;
  border-radius: 5px;
}

.security-info img,
.delivery-info img {
  width: 30px;
  height: 30px;
}

/* Pulsante checkout */
.checkout-button {
  display: block;
  width: 80%;
  padding: 12px;
  background-color: #28a745;
  color: white;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 10px auto 0;
}

.checkout-button:hover {
  background-color: #218838;
}

/* Carosello prodotti suggeriti */
.suggested-products {
  max-width: 1000px;
  margin: 20px auto;
  overflow: hidden;
}

.suggested-products h3 {
  font-size: 20px;
  margin-bottom: 10px;
  text-align: center;
}

/* Contenitore del carosello */
.cart-carousel-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 prodotti per riga su desktop */
  gap: 15px;
  padding-bottom: 10px;
  justify-content: center;
}

.cart-carousel-container::-webkit-scrollbar {
  display: none;
}

/* Card del prodotto */
.carousel-item {
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  max-width: 220px;
}

/* Titolo prodotto */
.carousel-title {
  font-weight: normal;
  font-size: 16px;
  color: black;
  margin-bottom: 5px;
  text-decoration: none; /* rimuove sottolineatura per tutto il link */
}

/* Immagine prodotto */
.carousel-item img {
  width: 100%;
  height: 140px; /* Altezza uniforme per tutte le immagini */
  object-fit: contain; /* Adatta le immagini al riquadro senza tagli */
  border-radius: 5px;
  background-color: #f8f8f8; /* Sfondo chiaro per immagini trasparenti */
}
.carousel-item a {
  text-decoration: none; /* rimuove sottolineatura per tutto il link */
  color: inherit;        /* mantiene il colore originale */
}

/* Prezzo prodotto */
.carousel-price {
  font-size: 14px;
  color: #e60000;
  font-weight: bold;
  margin-top: 5px;
  text-decoration: none; /* rimuove sottolineatura per tutto il link */
}


.cart-carousel-container {
  transition: opacity 1s ease-in-out;
}

.cart-carousel-container.fade-out {
  opacity: 0;
}

.cart-carousel-container.fade-in {
  opacity: 1;
}



/* Media Query per Mobile */
@media (max-width: 768px) {
  .cart-container {
    flex-direction: column;
    align-items: center;
  }

  .cart-items {
    width: 100%;
  }

  .cart-summary {
    width: 100%;
    margin-top: 20px;
  }

  .checkout-button {
    width: 100%;
  }
}

/* Adatta il carosello ai dispositivi mobili */
@media (max-width: 768px) {
  .cart-carousel-container {
    grid-template-columns: repeat(2, 1fr); /* 2 prodotti per riga su mobile */
  }

  .carousel-item {
    max-width: 160px;
  }

  .carousel-item img {
    height: 100px; /* Riduci altezza immagini per schermi piccoli */
  }

  .carousel-title {
    font-size: 14px;
  }

  .carousel-price {
    font-size: 12px;
  }
}
