/* Style du bouton d'ajout au panier */
.product-buttons {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
  margin-top: 15px;
}

.cart-icon-button {
  position: relative;
  width: 40px;
  height: 40px;
  border: 2px solid var(--accent-color, --accent-color);
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cart-icon-button:hover {
  background: var(--accent-color, --accent-color);
  transform: translate3d(0px, 0px, 0px) scale3d(1.1, 1.1, 1.1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg);
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  color: white;
}

.cart-icon-button .cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: red;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Style du panier dans le header */
.header-cart {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

/* Style du popup panier */
.cart-popup {
  display: none;
  position: fixed;
  top: 70px;
  right: 20px;
  width: 320px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  height: fit-content !important;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cart-popup.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

p.code-offre {
  font-size: 5px;
  color: white;
}

.cart-item-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}

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

.cart-item-name {
  font-size: 14px;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 12px;
  color: #666;
}

.cart-total {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #eee;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

/* Style du formulaire email */
.email-form {
  margin-top: 15px;
  display: none;
}

.email-form.active {
  display: block;
  animation: slideUp 0.3s ease;
}

.email-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.cart-button {
  position: relative;
  padding: 10px;
  background: var(--accent-color, --accent-color);
  border: none;
  cursor: pointer;
  color: white;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error-color, #ff4444);
  color: white;
  border-radius: 50%;
  font-size: 12px;
}

.cart-popup {
  display: none;
  position: fixed;
  top: 80px;
  right: 20px;
  width: 350px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
}

.cart-popup.show {
  display: block;
  animation: slideIn 0.3s ease;
}

.cart-header {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cart-item-image {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  flex: 1;
  padding-right: 10px;
}

.cart-item-details h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: #1a1f36;
}

.cart-item-details .price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
}

.cart-item-details .prix-reduit {
  font-size: 18px;
  font-weight: 600;
  color: #1a1f36;
}

.cart-item-details .prix-original {
  font-size: 18px;
  font-weight: 300;
  text-decoration: line-through;
  color: #697386;
}

.cart-item-details .reduction {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-color);
  padding: 2px 6px;
  border-radius: 4px;
  background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.cart-item-details .code-offre {
  font-size: 12px;
  color: #697386;
  margin-top: 4px;
}

.cart-footer {
  padding: 15px;
  border-top: 1px solid #eee;
}

.checkout-button {
  width: 100%;
  padding: 10px;
  background: var(--accent-color, --accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 10px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.add-to-cart-button {
  min-width: 40px;
  height: 40px;
  border: 1.5px solid var(--accent-color, #333);
  background: transparent;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0 10px;
}

.add-to-cart-button:hover {
  background: var(--accent-color);
}

.add-to-cart-button svg {
  width: 20px;
  height: 20px;
}

.cart-icon-small {
  width: 16px;
  height: 16px;
}

/* Animation d'ajout au panier */
@keyframes addToCart {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.add-to-cart-button.adding {
  animation: addToCart 0.3s ease;
}

/* Feedback visuel */
.add-to-cart-button:active {
  transform: scale(0.95);
}

/* Message de confirmation */
.cart-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent-color, #333);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.cart-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.cart-item-image-placeholder {
  width: 50px;
  height: 50px;
  background-color: #f0f0f0;
  border-radius: 4px;
}

.product-type {
  display: none;
  /* display: inline-block; */
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent-color, #333);
  color: white;
  font-size: 0.8em;
  margin-top: 4px;
}

.checkout-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.close-cart {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
}

.remove-item {
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.remove-item:hover {
  opacity: 1;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.cart-items {
  max-height: 400px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.cart-item-details {
  flex: 1;
  padding: 0 15px;
}

.cart-item h4 {
  margin: 0;
  font-size: 14px;
}

.cart-item p {
  margin: 5px 0 0;
  color: #666;
}

.cart-footer {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.cart-total {
  font-weight: bold;
  margin-bottom: 10px;
}

.checkout-button {
  width: 100%;
  padding: 10px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.close-cart {
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
}

.remove-item {
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.remove-item:hover {
  opacity: 1;
}

.cart-empty {
  text-align: center;
  padding: 20px;
  color: #666;
  min-height: auto;
  height: auto;
}

.cart-items {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-right: 10px;
  height: auto;
}

.cart-popup:empty,
.cart-popup .cart-empty:only-child {
  height: auto;
  min-height: 100px;
  max-height: none;
  overflow: hidden;
}

/* Style de la scrollbar */
.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Style spécifique pour le panier vide */
.cart-empty {
  text-align: center;
  padding: 20px;
  color: #666;
}

/* Ajustement de la hauteur en fonction du contenu */
.cart-popup:has(.cart-empty) {
  height: auto;
  min-height: 100px;
  max-height: none;
}

/* Style pour le panier avec des articles */
.cart-popup:not(:has(.cart-empty)) {
  min-height: 200px;
  max-height: calc(100vh - 100px);
  height: auto;
  overflow-y: auto;
}

/* Style spécifique pour le panier vide */
.cart-empty {
  text-align: center;
  padding: 20px;
  color: #666;
}

/* Ajustement uniquement pour le panier vide */
.cart-popup:has(.cart-empty:only-child) {
  min-height: 120px;
  max-height: 120px;
  overflow: hidden;
}