/*!
 * SuperNet - CSS Panier Moderne
 * Styles pour une expérience panier élégante et intuitive
 * Version: 1.0 - Design System SuperNet
 */

/* =============================================================================
   VARIABLES ET TOKENS DE DESIGN
   ========================================================================== */

:root {
  --cart-primary: var(--supernet-primary, #4CAF50);
  --cart-primary-dark: var(--supernet-primary-hover, #388E3C);
  --cart-success: #28a745;
  --cart-warning: #ffc107;
  --cart-danger: #dc3545;
  
  --cart-bg-main: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  --cart-bg-card: #ffffff;
  --cart-bg-header: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  
  --cart-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --cart-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
  --cart-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.15);
  --cart-shadow-primary: 0 6px 24px rgba(76, 175, 80, 0.3);
  
  --cart-radius-sm: 8px;
  --cart-radius-md: 12px;
  --cart-radius-lg: 16px;
  --cart-radius-xl: 20px;
  
  --cart-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   AMÉLIORATIONS POUR LES ÉLÉMENTS DE PRODUIT DU PANIER
   ========================================================================== */

/* Conteneur principal des produits */
#cart-detailed-product {
  padding: 0;
  background: transparent;
}

/* =============================================================================
   LIGNE PRODUIT PANIER ÉPURÉE
   ========================================================================== */

/* Conteneur principal épuré */
.supernet-cart-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: var(--cart-transition);
}

.supernet-cart-line:hover {
  border-color: var(--cart-primary);
  box-shadow: 0 2px 8px rgba(3, 129, 65, 0.1);
}

/* Image produit compacte */
.cart-product-image {
  flex: 0 0 60px;
}

.cart-product-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #f0f0f0;
}

/* Informations produit */
.cart-product-info {
  flex: 1;
  min-width: 0;
}

.product-name a {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  display: block;
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.product-name a:hover {
  color: var(--cart-primary);
}

/* Nutri-Score compact */
.nutriscore-compact {
  margin-bottom: 0.3rem;
}

.nutriscore-compact img {
  height: 20px;
  width: auto;
}

/* Prix unitaire compact */
.unit-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.old-price {
  text-decoration: line-through;
  color: #999;
  font-size: 0.9rem;
}

.discount-badge {
  background: var(--cart-danger);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.current-price {
  color: var(--cart-primary);
  font-weight: 600;
  font-size: 1rem;
}

/* Attributs compacts */
.product-attributes-compact {
  font-size: 0.85rem;
  color: #666;
}

.attribute {
  margin-right: 0.8rem;
}

/* Actions compactes */
.cart-product-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}

/* Contrôle quantité épuré */
.quantity-control {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.qty-btn {
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-primary);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--cart-transition);
}

.qty-btn:hover {
  background: var(--cart-primary);
  color: white;
}

.qty-input {
  border: none;
  background: transparent;
  width: 40px;
  text-align: center;
  font-weight: 600;
  color: #333;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.qty-input:focus {
  outline: none;
  background: rgba(3, 129, 65, 0.1);
}

.gift-qty {
  padding: 0.3rem 0.8rem;
  background: #e7f3ff;
  color: #0066cc;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Prix total */
.line-total {
  min-width: 80px;
  text-align: center;
}

.line-total strong {
  color: var(--cart-primary);
  font-size: 1.1rem;
  font-weight: 700;
}

.gift-text {
  color: #0066cc;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Bouton suppression épuré */
.remove-action {
  flex: 0 0 auto;
}

.remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 50%;
  color: var(--cart-danger);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  transition: var(--cart-transition);
}

.remove-btn:hover {
  background: var(--cart-danger);
  color: white;
  transform: scale(1.1);
  text-decoration: none;
}

/* =============================================================================
   RESPONSIVE ÉPURÉ
   ========================================================================== */

@media (max-width: 768px) {
  .supernet-cart-line {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  
  .cart-product-info {
    flex: 1 1 100%;
    order: 2;
  }
  
  .cart-product-image {
    order: 1;
  }
  
  .cart-product-actions {
    order: 3;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.5rem;
  }
}

/* Ligne de produit moderne */
.cart-overview-line,
.cart-line {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: var(--cart-radius-md);
  margin-bottom: 1rem;
  transition: var(--cart-transition);
  box-shadow: var(--cart-shadow-sm);
}

.cart-overview-line:hover,
.cart-line:hover {
  box-shadow: var(--cart-shadow-md);
  transform: translateY(-2px);
  border-color: var(--cart-primary);
}

/* Image du produit */
.cart-line .product-image {
  flex: 0 0 100px;
  margin-right: 1.5rem;
}

.cart-line .product-image img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--cart-radius-sm);
  box-shadow: var(--cart-shadow-sm);
}

/* Informations produit */
.cart-line .product-line-info {
  flex: 1;
  min-width: 0;
}

.cart-line .product-line-info .product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.cart-line .product-line-info .product-name a {
  color: inherit;
  text-decoration: none;
}

.cart-line .product-line-info .product-name a:hover {
  color: var(--cart-primary);
}

.cart-line .product-attributes {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

/* Badge Nutri-Score dans le panier */
.cart-line .nutriscore-badge {
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* Prix et quantité */
.cart-line .product-quantity {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
}

.cart-line .product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cart-primary);
  white-space: nowrap;
}

.cart-line .product-price .regular-price {
  color: var(--cart-primary);
}

.cart-line .product-price .discount-percentage {
  background: var(--cart-danger);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* Contrôles de quantité modernes */
.cart-line .input-group {
  display: flex;
  align-items: center;
  background: #f8f9fa;
  border-radius: var(--cart-radius-sm);
  padding: 0.2rem;
  width: fit-content;
}

.cart-line .input-group .btn {
  background: transparent;
  border: none;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cart-primary);
  font-weight: 600;
  border-radius: 4px;
  transition: var(--cart-transition);
  cursor: pointer;
}

.cart-line .input-group .btn:hover {
  background: var(--cart-primary);
  color: white;
}

.cart-line .input-group input {
  border: none;
  background: transparent;
  text-align: center;
  width: 50px;
  font-weight: 600;
  color: #333;
}

/* Bouton supprimer moderne */
.cart-line .remove-from-cart {
  padding: 0.5rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 50%;
  color: var(--cart-danger);
  text-decoration: none;
  transition: var(--cart-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.cart-line .remove-from-cart:hover {
  background: var(--cart-danger);
  color: white;
  transform: scale(1.1);
}

/* =============================================================================
   RÉSUMÉ ET TOTAUX MODERNISÉS
   ========================================================================== */

/* Totaux du panier */
.cart-detailed-totals {
  padding: 1.5rem;
  background: white;
}

.cart-detailed-totals .cart-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #f1f1f1;
  font-size: 1rem;
}

.cart-detailed-totals .cart-summary-line:last-child {
  border-bottom: none;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cart-primary);
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px solid var(--cart-primary);
}

.cart-detailed-totals .cart-summary-line .label {
  color: #333;
  font-weight: 500;
}

.cart-detailed-totals .cart-summary-line .value {
  font-weight: 600;
  color: var(--cart-primary);
}

/* =============================================================================
   BOUTONS D'ACTION MODERNISÉS
   ========================================================================== */

/* Actions du panier */
.cart-detailed-actions {
  padding: 2rem 1.5rem;
  background: white;
  border-top: 1px solid #e9ecef;
}

.cart-detailed-actions .btn {
  width: 100%;
  padding: 1.2rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--cart-radius-md);
  transition: var(--cart-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  text-decoration: none;
}

.cart-detailed-actions .btn-primary {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%) !important;
  color: white !important;
  box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4) !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.cart-detailed-actions .btn-primary:hover {
  background: linear-gradient(135deg, #FF5252 0%, #FF7979 100%) !important;
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.5) !important;
  color: white !important;
  text-decoration: none;
}

.cart-detailed-actions .btn-primary .material-icons {
  font-size: 1.3rem;
}

/* Effet de brillance pour tous les boutons checkout */
.cart-detailed-actions .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.cart-detailed-actions .btn-primary:hover::before {
  left: 100%;
}


/* =============================================================================
   AMÉLIORATIONS RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .cart-overview-line,
  .cart-line {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }
  
  .cart-line .product-image {
    flex: none;
    margin-right: 0;
    margin-bottom: 1rem;
    align-self: center;
  }
  
  .cart-line .product-quantity {
    justify-content: space-between;
    width: 100%;
  }
  
  .cart-detailed-actions .btn {
    padding: 1rem;
    font-size: 1rem;
  }
}

/* =============================================================================
   MESSAGES ET ALERTES
   ========================================================================== */

.cart-overview .alert {
  border-radius: var(--cart-radius-md);
  border: none;
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cart-overview .alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
}

.cart-overview .alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

.cart-overview .alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

/* =============================================================================
   ANIMATIONS ET MICRO-INTERACTIONS
   ========================================================================== */

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.cart-overview-line {
  animation: slideInFromLeft 0.5s ease-out;
}

.cart-count-badge {
  animation: bounceIn 0.6s ease-out;
}

/* =============================================================================
   PERSONNALISATIONS SUPERNET SPÉCIFIQUES
   ========================================================================== */

/* Intégration avec le design system SuperNet */
.cart-overview-line .nutriscore-badge img {
  max-height: 30px;
  width: auto;
}

/* Messages de stock */
.cart-line .product-availability {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  font-weight: 500;
  display: inline-block;
  margin-top: 0.5rem;
}

.cart-line .product-availability.available {
  background: #d4edda;
  color: #155724;
}

.cart-line .product-availability.last-items {
  background: #fff3cd;
  color: #856404;
}

.cart-line .product-availability.unavailable {
  background: #f8d7da;
  color: #721c24;
}

/* Loading states */
.cart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: white;
  border-radius: var(--cart-radius-lg);
}

.cart-loading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--cart-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* =============================================================================
   SURCHARGES POUR COMPATIBILITÉ PRESTASHOP
   ========================================================================== */

/* Force l'application de nos styles sur les éléments PrestaShop */
#main .cart-overview tbody tr.cart-overview-line {
  background: white !important;
  border: 1px solid #e9ecef !important;
  border-radius: var(--cart-radius-md) !important;
  margin-bottom: 1rem !important;
  box-shadow: var(--cart-shadow-sm) !important;
}

#main .cart-overview tbody tr.cart-overview-line:hover {
  box-shadow: var(--cart-shadow-md) !important;
  transform: translateY(-2px) !important;
}

/* Assurer la cohérence des couleurs */
.card.cart-container,
.card.cart-summary {
  border: none !important;
  border-radius: var(--cart-radius-lg) !important;
  box-shadow: var(--cart-shadow-md) !important;
}

.card.cart-container .card-block,
.card.cart-summary .card-block {
  padding: 2rem !important;
}

/* Harmonisation des titres */
.card h1.h1,
.card h2,
.card h3 {
  color: #333 !important;
  font-weight: 600 !important;
}