/* ============================================
   DESIGN FINAL POUR CARTES DE PRODUITS
   Selon maquette exacte
   ============================================ */

/* ========================================
   STYLES GLOBAUX POUR LES PRIX
   ======================================== */

/* Couleur orange pour tous les prix */
.product-price,
.product-price-final,
.current-price,
.price-current,
.text-primary.fw-bold,
.h6.text-primary {
    color: #F27A1A !important;
}

/* ========================================
   CARTES DE PRODUITS
   ======================================== */

.product-card-final {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: none;
}

.product-card-final:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* Conteneur de l'image - Plus grand */
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    aspect-ratio: 1 / 1;
}

.product-image-final {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-link {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card-final:hover .product-image-final {
    transform: scale(1.05);
}

/* Badge en haut à gauche */
.badge-top-left {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-nouveau {
    background: #2ecc71;
    color: white;
}

.badge-rupture {
    background: #e74c3c;
    color: white;
}

.badge-promo {
    background: #ff6348;
    color: white;
}

/* Badges de classement pour meilleures ventes */
.badge-ranking-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.badge-ranking-2 {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: white;
}

.badge-ranking-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: white;
}

.badge-bestseller {
    background: #3498db;
    color: white;
}

/* Badge IA pour recommandations */
.badge-ia {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Badge de stock recommandé */
.badge-stock-recommande {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Bouton wishlist en haut à droite */
.wishlist-button-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.wishlist-button-wrapper .btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wishlist-button-wrapper .btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wishlist-button-wrapper .btn i {
    font-size: 1.3rem;
}

.wishlist-button-wrapper .btn-outline-secondary {
    background: white;
    border: none;
}

.wishlist-button-wrapper .btn-outline-secondary i {
    color: #666;
}

.wishlist-button-wrapper .btn-danger {
    background: white;
    border: none;
}

.wishlist-button-wrapper .btn-danger i {
    color: #dc3545;
}

/* Corps de la carte - Ultra compact pour look pro */
.product-info {
    padding: 0.4rem 0.5rem;
}

.card-body.product-info {
    padding: 0.4rem 0.5rem !important;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.15rem;
    line-height: 1.2;
    height: auto;
    max-height: 2.4em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Titre produit pour recommandations */
.product-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.product-name a:hover {
    color: #3498db;
}

/* Notation - Compact */
.product-rating {
    color: #ffa500;
    font-size: 0.7rem;
}

.rating-count {
    color: #7f8c8d;
    font-size: 0.65rem;
    margin-left: 0.2rem;
}

/* Wrapper du rating - ultra compact */
.rating-wrapper,
.d-flex.align-items-center.mb-1,
.d-flex.align-items-center.mb-2 {
    display: flex;
    align-items: center;
    margin-bottom: 0.15rem !important;
}

/* Footer avec prix et stock sur la même ligne */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-top: 0.15rem;
}

.product-price,
.product-price-final {
    font-size: 0.95rem;
    font-weight: 700;
    color: #F27A1A;
    display: inline;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
}

.price-old-final {
    font-size: 0.7rem;
    color: #95a5a6;
    text-decoration: line-through;
    font-weight: 400;
    display: block;
    white-space: nowrap;
}

/* Badges de stock */
.badge-stock-final {
    background: #27ae60;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-epuise-final {
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Alerte stock faible */
.stock-warning {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #e67e22;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 4px;
}

.stock-warning i {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .product-info {
        padding: 0.4rem 0.5rem;
    }

    .product-name {
        font-size: 0.75rem;
        margin-bottom: 0.15rem;
    }

    .product-price-final {
        font-size: 0.9rem;
    }

    .badge-top-left {
        padding: 3px 8px;
        font-size: 0.6rem;
    }
    
    .d-flex.align-items-center.mb-1 {
        margin-bottom: 0.15rem !important;
    }
    
    .product-rating {
        font-size: 0.7rem;
    }
    
    .rating-count {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .product-card-final {
        border-radius: 8px;
    }
    
    .product-info {
        padding: 0.35rem 0.45rem;
    }

    .badge-top-left {
        top: 6px;
        left: 6px;
        padding: 2px 6px;
        font-size: 0.55rem;
    }

    .wishlist-button-wrapper {
        top: 6px;
        right: 6px;
    }
    
    .wishlist-button-wrapper .btn {
        width: 30px;
        height: 30px;
    }
    
    .wishlist-button-wrapper .btn i {
        font-size: 1rem;
    }

    /* Footer prix et panier - layout en colonne sur mobile pour plus d'espace */
    .product-footer {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    /* Nom du produit - 3 lignes sur mobile */
    .product-name {
        font-size: 0.72rem;
        margin-bottom: 0.15rem;
        max-height: 3.6em;
        -webkit-line-clamp: 3;
        line-height: 1.2;
    }
    
    /* Prix responsive mobile - sur toute la largeur */
    .product-price-final {
        font-size: 0.85rem;
        display: flex;
        flex-direction: row;
        align-items: baseline;
        gap: 0.4rem;
        width: 100%;
    }
    
    .price-old-final {
        font-size: 0.65rem;
        display: inline;
    }
    
    /* Boutons actions en ligne sur toute la largeur */
    .product-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Bouton ajouter sur toute la largeur sur mobile */
    .btn-add-to-cart {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    
    .btn-add-to-cart span {
        display: inline;
    }
    
    .btn-add-to-cart i {
        font-size: 0.9rem;
    }
    
    .badge-stock-final,
    .badge-epuise-final {
        padding: 2px 5px;
        font-size: 0.55rem;
    }
    
    .stock-warning {
        font-size: 0.55rem;
        width: 100%;
        margin-top: 2px;
    }
    
    .stock-warning i {
        font-size: 0.6rem;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-final {
    animation: fadeInUp 0.5s ease;
}

/* ========================================
   SECTION BOUTONS D'ACTION (AJOUTER AU PANIER + WISHLIST)
   ======================================== */

/* Conteneur des boutons d'action en bas de la carte */
.product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* Bouton Ajouter au panier - Petit et compact */
.btn-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #F27A1A;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-add-to-cart:hover {
    background: #e06a0a;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(242, 122, 26, 0.3);
}

.btn-add-to-cart:active {
    transform: translateY(0);
}

.btn-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-add-to-cart i {
    font-size: 1rem;
}

/* Bouton wishlist dans les actions */
.btn-wishlist-action {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-wishlist-action:hover {
    border-color: #dc3545;
    background: #fff5f5;
}

.btn-wishlist-action i {
    font-size: 1.1rem;
    color: #666;
    transition: color 0.3s ease;
}

.btn-wishlist-action:hover i {
    color: #dc3545;
}

.btn-wishlist-action.in-wishlist {
    background: #fff5f5;
    border-color: #dc3545;
}

.btn-wishlist-action.in-wishlist i {
    color: #dc3545;
}

/* Responsive pour les boutons d'action */
@media (max-width: 768px) {
    .btn-add-to-cart {
        padding: 7px 10px;
        font-size: 0.75rem;
    }
    
    .btn-add-to-cart i {
        font-size: 0.9rem;
    }
    
    .btn-wishlist-action {
        width: 34px;
        height: 34px;
    }
    
    .btn-wishlist-action i {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .product-actions {
        gap: 6px;
        margin-top: 8px;
    }
    
    .btn-add-to-cart {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
    
    .btn-add-to-cart i {
        font-size: 0.85rem;
    }
    
    .btn-wishlist-action {
        width: 32px;
        height: 32px;
    }
    
    .btn-wishlist-action i {
        font-size: 0.9rem;
    }
}
