/* Product Card New Design - Compatible with existing JavaScript */
* {
  box-sizing: border-box;
}

.product-card * {
  font-family: system-ui, -apple-system, sans-serif;
}

.product-card {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}

/* IMAGE ZONE */
.image-zone {
  position: relative;
  height: 240px;
  min-height: 240px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  flex-shrink: 0;
}

/* IMAGE PRODUIT */
.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.3);
  background: #e5e7eb;
  font-size: 48px;
  font-weight: 700;
}

/* BADGES */
.badges-left {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge.featured {
  background: #8b0015;
  color: #fff;
}

.badge.stock {
  background: #9df0c1;
  color: #0b4d2d;
}

.badge.available {
  background: #cfeeff;
  color: #004a75;
}

/* BADGES DROITE */
.badges-right {
  position: absolute;
  top: 10px;
  right: 10px;
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.flash {
  background: #ffb3b3;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  color: #7a0000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.flash strong {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 10px;
}

.discount {
  width: 40px;
  height: 40px;
  background: red;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.3);
}

/* ACTIONS */
.actions {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  display: flex;
  gap: 12px;
  z-index: 10;
}

.action {
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  color: #333;
}

.action:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action.cart {
  color: red;
}

.action.cart.added {
  background: red;
  color: white;
}

.action.added {
  background: #ef4444;
  color: white;
}

.action svg {
  width: 14px;
  height: 14px;
}

/* CONTENT */
.content {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-link-content {
  text-decoration: none;
  color: inherit;
  display: block;
}

.content h3 {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content p {
  font-size: 11px;
  color: #555;
  margin: 0 0 10px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PRICE */
.price-box {
  background: #ffe6e6;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 14px;
  font-weight: 900;
  color: #c00000;
  line-height: 1.2;
}

.price-original {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  text-decoration: line-through;
  line-height: 1.2;
}

.price-info {
  font-size: 10px;
  color: #006400;
  text-align: right;
  line-height: 1.4;
}

.price-info strong {
  font-weight: 700;
}

/* SUPPLIER */
.supplier {
  margin-top: 0;
  font-size: 11px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.supplier-top,
.supplier-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.supplier-top:last-child,
.supplier-bottom:last-child {
  margin-bottom: 0;
}

.supplier-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.supplier-logo-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.supplier-top strong {
  font-weight: 600;
  color: #111827;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-bottom img {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}

.supplier-bottom span {
  color: #111827;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .image-zone {
    height: 200px;
    min-height: 200px;
  }
  
  .badges-left {
    top: 8px;
    left: 8px;
    gap: 5px;
  }
  
  .badge {
    padding: 3px 8px;
    font-size: 8px;
  }
  
  .badges-right {
    top: 8px;
    right: 8px;
    gap: 5px;
  }
  
  .flash {
    padding: 3px 6px;
    font-size: 8px;
  }
  
  .flash strong {
    font-size: 9px;
  }
  
  .discount {
    width: 36px;
    height: 36px;
    font-size: 10px;
  }
  
  .actions {
    bottom: 10px;
    padding: 6px 12px;
    gap: 10px;
  }
  
  .action {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .action svg {
    width: 12px;
    height: 12px;
  }
  
  .content {
    padding: 10px;
  }
  
  .content h3 {
    font-size: 13px;
    margin-bottom: 5px;
  }
  
  .content p {
    font-size: 10px;
    margin-bottom: 8px;
  }
  
  .price-box {
    padding: 6px;
    margin-bottom: 8px;
  }
  
  .price {
    font-size: 13px;
  }
  
  .price-info {
    font-size: 9px;
  }
  
  .supplier {
    font-size: 10px;
    padding-top: 8px;
  }
  
  .supplier-logo,
  .supplier-logo-placeholder {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  
  .supplier-bottom img {
    width: 20px;
    height: 14px;
  }
}

/* Compatibility with existing grid systems */
.marketplace-products-grid .product-card,
.products-grid .product-card,
.related-products-grid .product-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Ensure image zone adapts to card width */
.marketplace-products-grid .product-card .image-zone,
.products-grid .product-card .image-zone,
.related-products-grid .product-card .image-zone {
  width: 100%;
}
