


.app-container {
    background-color: #f8f9fa;
    /* Gris très clair type pro */
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Grille de produits optimisée (Flexbox avec gestion précise des largeurs) */
#produits-container {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
    /* Compensation du padding des cartes */
}

/* --- LOGIQUE RESPONSIVE DE LA GRILLE --- */

/* 1. PC (Par défaut : 4 colonnes) */
#produits-container>div {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 10px;
}

/* 2. TABLETTE (Écrans moyens : 3 colonnes) */
@media (max-width: 992px) {
    #produits-container>div {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

/* 3. MOBILE (Petit écrans : 2 colonnes) */
@media (max-width: 576px) {
    #produits-container>div {
        flex: 0 0 50%;
        max-width: 50%;
        padding: 6px;
        /* Espacement plus serré pour gagner de la place */
    }
}

/* --- LA CARTE PRODUIT --- */
.card {
    border: 1px solid #eee;
    /* Liseré léger */
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: #0c2175;
}

/* Zone Image */
.card-img-top {
    width: 100%;
    height: 220px;
    object-fit: contain;
    padding: 15px;
    background-color: #fff;
    transition: transform 0.5s ease;
}

@media (max-width: 768px) {
    .card-img-top {
        height: 160px;
        /* Ajustement hauteur mobile */
        padding: 10px;
    }
}

/* Corps de la carte */
.card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    color: #2d3436;
    height: 2.8em;
    /* Maintient l'alignement précis des boutons */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}

/* Prix */
.card-body .fw-bold {
    /* color: #d90429; */
    /* Rouge plus impactant ou garde ton #0c2175 */
    font-size: 1.15rem !important;
    margin-bottom: 12px;
    display: block;
}

/* ===================== SÉLECTEUR DE QUANTITÉ PRO ===================== */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

/* ===================== CORRECTIF VISIBILITÉ QUANTITÉ ===================== */

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centre l'ensemble des 3 éléments */
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2px 5px;
    border: 1px solid #e9ecef;
    width: fit-content;
    /* S'adapte au contenu pour ne pas s'écraser */
    margin: 0 auto 12px auto;
    /* Centre le sélecteur dans la carte */
}

.btn-qty {
    background-color: #fff;
    border: 1px solid #dee2e6;
    color: #0c2175;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    /* Empêche le bouton de rétrécir si la carte est petite */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-qty:hover {
    background-color: #0c2175;
    color: #ffffff;
}

.quantity-selector input {
    border: none !important;
    background: transparent !important;
    font-weight: 700;
    font-size: 1rem;
    /* Taille de police légèrement augmentée */
    color: #333;
    width: 45px !important;
    /* Largeur augmentée pour laptop */
    text-align: center;
    outline: none !important;
    appearance: none;
    /* Supprime le style système */
    -moz-appearance: textfield;
    /* Cache les flèches sur Firefox */
}

/* Supprime les flèches sur Chrome, Safari, Edge */
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Bouton Ajouter au Panier */
.btn-ajout {
    background-color: #0c2175;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 5px;
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-ajout:hover {
    background-color: #08164d;
    box-shadow: 0 4px 12px rgba(12, 33, 117, 0.3);
}

/* Responsive pour très petits écrans (iPhone SE etc.) */
@media (max-width: 380px) {
    .card-body {
        padding: 8px;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .btn-ajout {
        font-size: 0.7rem;
        padding: 10px 2px;
    }
}