/* Panel Container */
.customcartsuggestions-panel {
  position: fixed;
  left: -400px; /* Caché hors de l'écran par défaut */
  top: 50%;
  transform: translateY(-50%);
  width: 350px;
  background-color: #ffffff;
  border: 1px solid #eaeaea; /* subtile bordure */
  border-radius: 0 16px 16px 0; /* Arrondi sur le côté droit */
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.05); /* Ombre douce */
  z-index: 9999;
  padding: 24px;
  transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0;
  visibility: hidden;
}

/* S'affiche uniquement quand le panel prend la classe active */
.customcartsuggestions-panel.active {
  left: 0;
  opacity: 1;
  visibility: visible;
}

.customcartsuggestions-header h4 {
  font-size: 18px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 20px;
  margin-top: 0;
  font-family: inherit; /* Utilise la police du thème */
}

/* Item de suggestion (Carte Produit) */
.customcartsuggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 10px;
  background-color: #fafafb; /* Légèrement gris pour détacher du fond blanc */
  border-radius: 12px;
  transition: background-color 0.2s ease;
}

.customcartsuggestion-item:last-child {
  margin-bottom: 0;
}

.customcartsuggestion-item:hover {
  background-color: #f0f0f2;
}

/* Image carrée */
.ccs-item-image {
  flex: 0 0 65px;
  width: 65px;
  height: 65px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccs-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Infos produit (Nom + Prix) */
.ccs-item-info {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.ccs-item-name {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.3;
    max-height: 2.6em;
    transition: max-height 0.3s ease;
}

.customcartsuggestion-item:hover .ccs-item-name {
    -webkit-line-clamp: initial;
    line-clamp: initial;
    max-height: 10em; /* Hauteur suffisante pour tout afficher */
}

.ccs-item-name:hover {
  text-decoration: underline;
  color: #000000;
}

.ccs-item-price {
  font-size: 14px;
  font-weight: 700;
  color: #000000;
}

/* Bouton Ajouter (+) */
.ccs-item-action {
  flex: 0 0 auto;
}

.ccs-item-action .add-to-cart-or-refresh {
  margin: 0;
}

.ccs-item-action button.ccs-add-btn {
  width: 25px;
  height: 25px;
  padding: 0;
  border-radius: 50%;
  background-color: #000000;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.ccs-item-action button.ccs-add-btn i {
  font-size: 16px;
  line-height: 1;
  margin-right: 0 !important;
}

.ccs-item-action button.ccs-add-btn:hover {
  transform: scale(1.1);
  background-color: #333333;
}

/* Loader custom */
.customcartsuggestions-loader {
  width: 24px;
  height: 24px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #000000;
  border-radius: 50%;
  animation: ccs-spin 1s linear infinite;
  margin: 30px auto;
}

@keyframes ccs-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* En mobile, on le désactive pour ne pas surcharger l'écran */
@media (max-width: 991px) {
  .customcartsuggestions-panel {
    display: none !important;
  }
}

/* Animation fluide pour masquer un produit après ajout */
.customcartsuggestion-item.fade-out {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
