/* ============================================================
   UniPlace — Styles MOBILE
   ============================================================ */

/* ============================================================
   📱 ÉTAPE 1 — BASES GLOBALES MOBILE
   ============================================================ */
@media (max-width: 768px) {
    body { font-size: 15px !important; line-height: 1.5 !important; -webkit-font-smoothing: antialiased; }
    h1, .h1 { font-size: 1.4rem !important; line-height: 1.3; }
    h2, .h2 { font-size: 1.25rem !important; line-height: 1.3; }
    h3, .h3 { font-size: 1.15rem !important; }
    h4, .h4 { font-size: 1.05rem !important; }
    h5, .h5, h6, .h6 { font-size: 0.95rem !important; }

    .container, .container-fluid { padding-left: 12px !important; padding-right: 12px !important; }

    .btn { min-height: 44px; padding: 10px 18px; font-size: 15px; font-weight: 600; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
    .btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 8px; }
    .btn-lg { min-height: 52px; padding: 14px 24px; font-size: 16px; font-weight: 700; border-radius: 12px; }

    .form-control, .form-select, textarea { min-height: 44px; padding: 10px 14px; font-size: 16px !important; border-radius: 10px; }
    .card { border-radius: 12px !important; box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important; margin-bottom: 12px; }
    .card-body { padding: 14px !important; }

    .mb-4 { margin-bottom: 1rem !important; }
    .mb-5 { margin-bottom: 1.25rem !important; }
    .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .py-5 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .row.g-3 { --bs-gutter-x: 8px; --bs-gutter-y: 8px; }
    .row.g-4 { --bs-gutter-x: 10px; --bs-gutter-y: 10px; }

    .alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
    .table-responsive { border-radius: 10px; font-size: 0.85rem; }
    .table td, .table th { padding: 10px 8px; white-space: nowrap; }
    .pagination { flex-wrap: wrap; gap: 4px; }
    .pagination .page-link { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 600; }
}
@media (max-width: 480px) {
    .container, .container-fluid { padding-left: 8px !important; padding-right: 8px !important; }
    h1, .h1 { font-size: 1.25rem !important; }
    h2, .h2 { font-size: 1.1rem !important; }
    .btn { font-size: 14px; }
    .card-body { padding: 12px !important; }
}

/* ============================================================
   📱 ÉTAPE 2 — NAVBAR type app native (VERSION CORRIGÉE)
   ============================================================ */
@media (max-width: 991px) {

    /* 1. Barre principale */
    .navbar.navbar-expand-lg {
        position: sticky;
        top: 0;
        z-index: 1040;
        height: 56px !important;
        padding: 0 !important; /* On gère le padding dans le container */
        background: #fff !important;
        border-bottom: 1px solid #eee;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        display: flex;
        align-items: center;
    }

    /* 2. Container flexible : on utilise flex pour aligner Gauche / Centre / Droite */
    .navbar.navbar-expand-lg .container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important; /* Pousse les blocs aux extrémités */
        padding: 0 8px !important;
        height: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important; /* INTERDIT de passer à la ligne */
    }

    /* 3. Burger à gauche (Flexbox) */
    .navbar .navbar-toggler {
        order: 1;
        border: none !important;
        padding: 10px !important;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 !important;
        flex-shrink: 0;
    }
    .navbar .navbar-toggler:focus { box-shadow: none !important; }
    .navbar .navbar-toggler i { font-size: 28px; }

    /* 4. Logo au centre */
    .navbar .navbar-brand {
        order: 2;
        font-size: 1.15rem !important;
        font-weight: 800;
        margin: 0 0 0 8px !important; /* Pousse un peu vers la droite du burger */
        padding: 0;
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 1; /* Peut rétrécir si nécessaire */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .navbar .navbar-brand img {
        height: 28px !important;
        width: 28px !important;
        margin-right: 4px !important;
        flex-shrink: 0;
    }

    /* 5. Actions (Panier + Avatar) à droite (Flexbox) */
    #navActions {
        order: 3;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin-left: auto !important; /* Pousse à droite */
        margin-right: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important; /* Ne rétrécit JAMAIS */
    }
    
    #navActions .nav-item {
        display: flex;
        align-items: center;
        padding: 0 4px;
    }
    
    #navActions .nav-link {
        padding: 8px 6px !important;
        min-width: 40px;
        min-height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    #navActions .nav-link i.bi-cart3 { font-size: 22px; }

    /* Badge panier */
    #navActions .badge {
        font-size: 10px !important;
        padding: 2px 5px !important;
        min-width: 16px;
        top: 2px !important;
        right: 2px !important;
        transform: none !important;
    }

    /* Avatar */
    #navActions .user-avatar-nav {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    
    /* Cache la flèche du dropdown pour l'avatar */
    #navActions .dropdown-toggle::after {
        display: none !important;
    }

    /* Dropdown profil */
    #navActions .dropdown-menu {
        position: fixed !important;
        top: 56px !important;
        right: 8px !important;
        left: auto !important;
        min-width: 260px;
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        z-index: 1045;
    }

    /* 6. Le menu burger qui s'ouvre */
    .navbar .navbar-collapse {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 60px;
        background: #fff;
        z-index: 1039;
        overflow-y: auto;
        padding: 12px !important;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
        /* On s'assure que le collapse ne casse pas le flex quand il est fermé */
        flex-basis: auto;
    }
    .navbar .navbar-collapse.show,
    .navbar .navbar-collapse.collapsing { display: block !important; }

    /* Items du burger */
    .navbar .navbar-nav { width: 100%; margin: 0 !important; }
    .navbar .navbar-nav .nav-item { width: 100%; border-bottom: 1px solid #f1f1f1; }
    .navbar .navbar-nav .nav-item:last-child { border-bottom: none; }
    .navbar .navbar-nav .nav-link {
        padding: 14px 8px !important; font-size: 16px !important;
        font-weight: 500; min-height: 52px; display: flex;
        align-items: center; gap: 10px;
    }
    .navbar .navbar-nav .nav-link i { font-size: 20px; width: 24px; text-align: center; }

    /* Dark mode */
    body.dark-mode .navbar.navbar-expand-lg { background: #1e1e1e !important; border-bottom-color: #333 !important; }
    body.dark-mode .navbar .navbar-collapse { background: #1e1e1e !important; border-top-color: #333 !important; }
    body.dark-mode .navbar .navbar-nav .nav-item { border-bottom-color: #333 !important; }
}

/* ============================================================
   🚑 FIX DÉFINITIF — Navbar parfaitement alignée
   ============================================================ */
@media (max-width: 991px) {

    /* On force le container à être un flex strict */
    .navbar.navbar-expand-lg .container {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* 1. BURGER : taille fixe, pas de marge */
    .navbar .navbar-toggler {
        flex-shrink: 0 !important;
        margin-right: 8px !important;
    }

    /* 2. LOGO : On lui interdit de disparaître ! */
    .navbar .navbar-brand {
        display: flex !important;
        flex-shrink: 0 !important; /* Ne rétrécit plus */
        font-size: 1.15rem !important;
        margin: 0 auto 0 0 !important; /* Pousse les actions à droite */
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 3. ACTIONS (Panier + Profil) : collées à droite, sans marges Bootstrap */
    #navActions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin: 0 !important; /* Annule le margin-left: auto de Bootstrap */
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    /* On force les <li> à ne pas avoir de marges */
    #navActions .nav-item {
        margin: 0 !important;
        padding: 0 2px !important;
    }
    
    /* Le lien prend une taille tactile de 44x44 */
    #navActions .nav-link {
        padding: 8px !important;
        min-width: 40px;
        min-height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================================
   🚑 AJUSTEMENT — Espace à droite pour l'avatar
   ============================================================ */
@media (max-width: 991px) {
    /* On ajoute 12px d'espace à droite du container */
    .navbar.navbar-expand-lg .container {
        padding-right: 12px !important;
        padding-left: 8px !important;
    }
    
    /* On s'assure que le panier et l'avatar ont un peu d'espace entre eux */
    #navActions .nav-item:last-child {
        padding-right: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================================
   📱 ÉTAPE 3 — CARTES PRODUITS (style Jumia/Amazon)
   ============================================================ */
@media (max-width: 768px) {

    /* 1. Forcer 2 colonnes par ligne */
    .row.g-2 > .col-6,
    .row.g-3 > .col-6,
    .row.g-4 > .col-6,
    .row > [class*="col-"] .card-produit { 
        /* On laisse Bootstrap gérer les colonnes (col-6) mais on s'assure que la grille est propre */
    }

    /* 2. Design de la carte */
    .card-produit {
        border-radius: 12px !important;
        border: 1px solid #f0f0f0 !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
        overflow: hidden !important;
        margin-bottom: 0 !important;
        background: #fff;
        transition: transform 0.1s ease, box-shadow 0.1s ease;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Effet "tap" quand on clique sur la carte (comme une app) */
    .card-produit:active {
        transform: scale(0.97);
        box-shadow: 0 0 0 rgba(0,0,0,0) !important;
    }

    /* 3. IMAGE CARRÉE (1:1) — Fini les 170px fixes ! */
    .card-produit .card-img-top,
    .card-produit img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important; /* Le secret pour des images parfaitement carrées */
        object-fit: cover !important;   /* Remplit le carré sans déformer */
        border-radius: 0 !important;
    }

    /* 4. Le contenu (texte, prix) */
    .card-produit .card-body {
        padding: 8px 10px !important;
        flex: 1; /* Pousse le contenu vers le bas si l'image est plus petite */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    /* 5. Titre du produit */
    .card-produit .card-title {
        font-size: 13px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        color: #333 !important;
        height: 34px !important; /* Force 2 lignes maximum */
        margin-bottom: 6px !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal !important;
    }

    /* 6. Prix en vert Jumia */
    .card-produit .prix-fcfa {
        font-size: 15px !important;
        font-weight: 800 !important;
        color: #198754 !important; /* Vert */
        margin-top: auto; /* Colle le prix en bas de la carte */
        margin-bottom: 4px !important;
        display: block;
    }

    /* 7. Petites étoiles / badge vendeur (si présents) */
    .card-produit .rating-stars,
    .card-produit .badge {
        font-size: 10px !important;
        margin-bottom: 4px;
    }

    /* 8. Espacement entre les cartes (gap) */
    .row.g-2, .row.g-3, .row.g-4 {
        --bs-gutter-x: 8px !important;
        --bs-gutter-y: 8px !important;
    }
}

/* ============================================================
   📱 ÉTAPE 4 — FILTRES EN ACCORDÉON
   ============================================================ */
@media (max-width: 768px) {

    /* Carte des filtres */
    .card.mb-4:has(h5), 
    .filter-sidebar,
    .col-lg-3 .card {
        border: none !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
        background: #fff;
        overflow: hidden;
    }

    /* Titre de la carte filtres */
    .card-header, .card-title {
        font-size: 15px !important;
        font-weight: 700 !important;
        padding: 12px 16px !important;
        background: #f8f9fa !important;
        border-bottom: 1px solid #eee !important;
        margin: 0 !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
    }

    /* Le petit "+" à droite du titre (si tu utilises un collapse Bootstrap) */
    .card-header::after {
        content: "▼";
        font-size: 10px;
        color: #888;
        transition: transform 0.3s;
    }
    .card-header[aria-expanded="true"]::after {
        transform: rotate(180deg);
    }

    /* Les inputs (checkboxes, radios) dans les filtres */
    .form-check {
        padding: 10px 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #f8f9fa;
    }
    .form-check:last-child {
        border-bottom: none;
    }
    .form-check-label {
        font-size: 14px !important;
        font-weight: 500;
        color: #444;
        cursor: pointer;
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    /* Agrandir la checkbox pour le tactile */
    .form-check-input {
        width: 20px !important;
        height: 20px !important;
        margin-right: 12px !important;
        flex-shrink: 0;
    }

    /* Barre de recherche sur la page produits */
    .input-group {
        border-radius: 10px !important;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .input-group .form-control {
        border: none !important;
        padding-left: 16px !important;
    }
    .input-group .btn {
        border: none !important;
        background: #f8f9fa !important;
        color: #333 !important;
    }
}

/* ============================================================
   📱 ÉTAPE 5 — PANIER STICKY en bas
   ============================================================ */
@media (max-width: 991px) {
    .panier-sticky-mobile {
        position: fixed;
        bottom: 60px; /* juste au-dessus de la bottom nav (60px) */
        left: 0;
        right: 0;
        z-index: 1029; /* sous la bottom nav (1030) */
        padding: 8px 12px;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        animation: slideUpPanier 0.3s ease-out;
        pointer-events: none;
    }
    .panier-sticky-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background: #0d6efd;
        color: #fff;
        border-radius: 14px;
        padding: 10px 14px;
        box-shadow: 0 6px 24px rgba(13, 110, 253, 0.35);
        pointer-events: auto;
    }
    .panier-sticky-info {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 500;
    }
    .panier-sticky-info i {
        font-size: 22px;
    }
    .panier-sticky-info strong {
        font-weight: 800;
        font-size: 16px;
    }
    .panier-sticky-inner .btn {
        background: #fff !important;
        color: #0d6efd !important;
        border: none !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        padding: 8px 14px !important;
        border-radius: 10px !important;
        min-height: 40px;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
    }
    .panier-sticky-inner .btn:active {
        transform: scale(0.96);
    }

    /* Animation d'apparition */
    @keyframes slideUpPanier {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* Si page panier/checkout → pas de sticky (déjà géré côté Jinja) */

    /* Dark mode */
    body.dark-mode .panier-sticky-inner {
        background: #198754;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.4);
    }
    body.dark-mode .panier-sticky-inner .btn {
        color: #198754 !important;
    }
}

/* ============================================================
   🚑 FIX PLEIN ÉCRAN MOBILE (Anti-débordement horizontal)
   ============================================================ */
@media (max-width: 991px) {
    
    /* 1. Empêcher le body et le html de scroller sur les côtés */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 2. Le conteneur principal ne doit jamais dépasser */
    .container, .container-fluid, main {
        max-width: 100vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    /* 3. Corriger les images ou éléments qui dépassent */
    img, table, pre, blockquote {
        max-width: 100% !important;
    }

    /* 4. La navbar et la bottom-nav doivent être collées aux bords (sans marges) */
    .navbar.navbar-expand-lg {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .mobile-bottom-nav {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        /* On s'assure que les 5 icônes sont bien réparties */
        justify-content: space-around !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 5. La barre sticky du panier ne doit pas déborder */
    .panier-sticky-mobile {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* 6. Corriger le stepper (panier/commande) qui peut être trop large */
    .checkout-stepper {
        width: 100% !important;
        padding: 15px 5px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
}

/* ============================================================
   🚑 FIX DERNIÈRE BORDURE — Navbar et Bottom Nav Plein Écran
   ============================================================ */
@media (max-width: 991px) {

    /* 1. Le container de la navbar doit toucher les bords */
    .navbar.navbar-expand-lg .container {
        padding-left: 12px !important; 
        padding-right: 12px !important; 
        max-width: 100vw !important;
        width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* 2. La Bottom Nav doit être parfaitement collée à gauche et à droite */
    .mobile-bottom-nav {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex !important;
        justify-content: space-around !important;
        box-sizing: border-box !important;
    }

    /* 3. On s'assure que les 5 éléments sont bien répartis */
    .mobile-bottom-nav .nav-item {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 8px 0 !important;
    }

    /* 4. La barre sticky du panier (si active) touche aussi les bords */
    .panier-sticky-mobile {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* ============================================================
   🚑 FIX ULTIME — Plein écran absolu sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* 1. Le body et le HTML prennent TOUT l'écran, pas de marges */
    html, body {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        background-color: #f4f6f8; /* Garde ta couleur de fond */
    }

    /* 2. On casse les limites de Bootstrap sur le main et le container */
    main, 
    .container, 
    .container-fluid,
    main > .container,
    main > .container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }

    /* 3. La Navbar prend TOUTE la largeur, collée aux bords */
    .navbar.navbar-expand-lg {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .navbar.navbar-expand-lg .container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* 4. La Bottom Nav prend TOUTE la largeur, collée aux bords */
    .mobile-bottom-nav {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex !important;
        justify-content: space-around !important;
        box-sizing: border-box !important;
    }
    .mobile-bottom-nav .nav-item {
        flex: 1 !important;
        margin: 0 !important;
        padding: 8px 0 !important;
    }
}

/* ============================================================
   🚑 FIX ULTIME — Plein écran absolu sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* 1. Le body et le HTML prennent TOUT l'écran, pas de marges */
    html, body {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        background-color: #f4f6f8; /* Garde ta couleur de fond */
    }

    /* 2. On casse les limites de Bootstrap sur le main et le container */
    main, 
    .container, 
    .container-fluid,
    main > .container,
    main > .container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }

    /* 3. La Navbar prend TOUTE la largeur, collée aux bords */
    .navbar.navbar-expand-lg {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .navbar.navbar-expand-lg .container {
        width: 100vw !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* 4. La Bottom Nav prend TOUTE la largeur, collée aux bords */
    .mobile-bottom-nav {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex !important;
        justify-content: space-around !important;
        box-sizing: border-box !important;
    }
    .mobile-bottom-nav .nav-item {
        flex: 1 !important;
        margin: 0 !important;
        padding: 8px 0 !important;
    }
}

/* ============================================================
   🚑 FIX DÉFINITIF — Contenu 100% dans l'écran (sans décalage)
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On empêche TOUT débordement horizontal, sur TOUT le site */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        position: relative;
        left: 0;
        right: 0;
    }

    /* 2. Tous les éléments enfants doivent tenir dans l'écran */
    body * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* 3. Les conteneurs Bootstrap ne doivent pas dépasser */
    .container,
    .container-fluid,
    main,
    main > .container {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        margin: 0 auto !important;
    }

    /* 4. Les images et tableaux doivent s'adapter */
    img, video, iframe, table {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 5. La navbar et la bottom nav collent bien aux bords */
    .navbar.navbar-expand-lg,
    .mobile-bottom-nav {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
    }

    /* 6. On s'assure que l'icône "Profil" (5e item) a assez de place */
    .mobile-bottom-nav .nav-item {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
    .mobile-bottom-nav .nav-item:last-child {
        margin-right: 4px !important; /* Espace à droite pour ne pas être coupé */
    }
}

/* ============================================================
   🚑 FIX ANTI-DÉCALAGE (v3) — Force tout à rester à sa place
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On bloque le body ET le html sur la largeur exacte de l'écran */
    html, body {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        position: relative;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 2. On ne touche PAS aux éléments fixes (navbar, bottom nav, panier sticky) */
    .navbar, .mobile-bottom-nav, .panier-sticky-mobile {
        /* On les laisse faire leur vie */
    }

    /* 3. On force les conteneurs à rester dans l'écran */
    .container, .container-fluid, main, main > .container, main > .container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }

    /* 4. On empêche TOUT le contenu (sauf navbar/bottom nav) de dépasser */
    body > *:not(.navbar):not(.mobile-bottom-nav):not(.panier-sticky-mobile):not(script) {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* 5. Cas spécifiques : les blocs qui pourraient déborder */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .row > [class*="col-"] {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 6. La navbar prend TOUTE la largeur de l'écran */
    .navbar.navbar-expand-lg {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .navbar.navbar-expand-lg .container {
        width: 100vw !important;
        max-width: 100vw !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    /* On s'assure que l'avatar n'est pas coupé */
    #navActions .nav-item:last-child {
        margin-right: 0 !important;
        padding-right: 4px !important;
    }

    /* 7. La bottom nav prend toute la largeur, avec de l'espace pour le profil */
    .mobile-bottom-nav {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom)) 4px !important;
        box-sizing: border-box !important;
    }
    .mobile-bottom-nav .nav-item:last-child {
        margin-right: 4px !important;
    }
}

/* ============================================================
   🚑 RESET FINAL — App native sur mobile (et simulation PC)
   ============================================================ */
@media (max-width: 991px) {

    /* 1. Forcer le body et html à être EXACTEMENT la taille de l'écran */
    html, body {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        background-color: #f4f6f8 !important;
    }

    /* 2. TOUS les conteneurs principaux (main, container, etc.) doivent prendre 100% et rien d'autre */
    main, 
    main > div,
    main > div > div,
    .container, 
    .container-fluid, 
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl {
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        box-sizing: border-box !important;
    }

    /* 3. La Navbar et Bottom Nav doivent toucher les bords de l'écran */
    .navbar.navbar-expand-lg,
    .mobile-bottom-nav {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* 3b. Le container à l'intérieur de la navbar */
    .navbar.navbar-expand-lg .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* 4. On retire les margins Bootstrap qui causent des décalages */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 8px !important;
    }
    .row > * {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 5. S'assurer que l'avatar et l'icône profil ne sont pas coupés */
    #navActions {
        margin-right: 4px !important;
    }
    #navActions .nav-item {
        padding-right: 0 !important;
    }
    #navActions .nav-item:last-child {
        margin-right: 4px !important;
    }
    .mobile-bottom-nav .nav-item:last-child {
        margin-right: 4px !important;
    }

    /* 6. Les éléments Bootstrap classiques (btn, form, card) restent dans l'écran */
    .btn, .form-control, .form-select, .card, .alert, .badge {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ============================================================
   🚑 FIX DERNIER DÉTAIL — Bannières plein écran
   ============================================================ */
@media (max-width: 991px) {
    
    /* 1. Toutes les bannières (hero, sections colorées) prennent 100% */
    .hero-section, 
    .hero, 
    .banner, 
    [class*="hero"],
    [class*="banner"],
    [style*="linear-gradient"],
    [style*="background-image"],
    [style*="background: linear-gradient"] {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: calc(-50vw + 50%) !important;
        margin-right: calc(-50vw + 50%) !important;
        border-radius: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        box-sizing: border-box !important;
    }

    /* 2. Le contenu à l'intérieur des bannières garde ses marges de texte */
    .hero-section > *, 
    .banner > *,
    [class*="hero"] > *,
    [class*="banner"] > * {
        max-width: 100% !important;
    }
}

/* ============================================================
   🎯 FIX AVATAR — Pousser l'avatar vers la gauche
   ============================================================ */
@media (max-width: 991px) {
    /* On ajoute un espace à droite dans le conteneur de la navbar */
    .navbar.navbar-expand-lg .container {
        padding-right: 20px !important; /* 20px d'espace à droite */
    }

    /* On s'assure que l'avatar a assez de place */
    #navActions {
        margin-right: 5px !important;
    }
}

/* ============================================================
   🎯 FIX AVATAR v2 — Encore plus d'espace à droite
   ============================================================ */
@media (max-width: 991px) {
    /* On augmente l'espace à droite du conteneur de la navbar */
    .navbar.navbar-expand-lg .container {
        padding-right: 30px !important; /* 30px au lieu de 20px */
    }

    /* On pousse l'avatar lui-même vers la gauche */
    #navActions {
        margin-right: 8px !important; /* Un peu plus d'espace */
    }

    /* On s'assure que le cercle de l'avatar n'est pas coupé */
    #navActions .user-avatar-nav {
        margin-right: 4px !important;
    }
}

/* ============================================================
   🌙 DARK MODE FIX — Visibilité des boutons et éléments
   ============================================================ */
body.dark-mode {
    /* 1. Le fond général */
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}

/* 2. Les textes qui doivent être clairs */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode h4, body.dark-mode h5, body.dark-mode h6,
body.dark-mode p, body.dark-mode span, body.dark-mode div {
    color: #e0e0e0 !important;
}

/* 3. Les cartes, la navbar, les barres */
body.dark-mode .card, 
body.dark-mode .navbar,
body.dark-mode .mobile-bottom-nav,
body.dark-mode .offcanvas,
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
}

/* 4. Les boutons (très important !) */
body.dark-mode .btn-outline-primary {
    color: #6ea8fe !important;
    border-color: #6ea8fe !important;
}
body.dark-mode .btn-outline-secondary {
    color: #a0a0a0 !important;
    border-color: #a0a0a0 !important;
}
body.dark-mode .btn-light, 
body.dark-mode .btn-white {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #444 !important;
}

/* 5. Les champs de formulaire (filtres, recherche) */
body.dark-mode .form-control, 
body.dark-mode .form-select,
body.dark-mode textarea {
    background-color: #2c2c2c !important;
    color: #fff !important;
    border-color: #444 !important;
}
body.dark-mode .form-control::placeholder {
    color: #888 !important;
}

/* 6. Les catégories (bulles) sur la page produits */
body.dark-mode .btn-outline-primary.rounded-pill {
    color: #6ea8fe !important;
    border-color: #6ea8fe !important;
}
body.dark-mode .btn-outline-secondary.rounded-pill {
    color: #aaa !important;
    border-color: #555 !important;
}

/* 7. La barre sticky du panier en bas */
body.dark-mode .panier-sticky-inner {
    background: #198754 !important; /* Un vert plus sombre pour le dark mode */
    color: #fff !important;
}
body.dark-mode .panier-sticky-inner .btn {
    background: #fff !important;
    color: #198754 !important;
}

/* 8. Le tiroir de filtres (Offcanvas) */
body.dark-mode .offcanvas-header {
    background-color: #1e1e1e !important;
    border-bottom-color: #333 !important;
}
body.dark-mode .offcanvas-body {
    background-color: #121212 !important;
}
body.dark-mode .offcanvas-title {
    color: #fff !important;
}

/* 9. Les prix et les badges (on les garde bien visibles) */
body.dark-mode .prix-fcfa {
    color: #2ea86c !important; /* Vert plus clair */
}
body.dark-mode .badge.bg-light {
    background-color: #333 !important;
    color: #fff !important;
}

/* 10. La barre du bas (bottom nav) */
body.dark-mode .mobile-bottom-nav {
    border-top-color: #333 !important;
}
body.dark-mode .mobile-bottom-nav .nav-item {
    color: #888 !important;
}
body.dark-mode .mobile-bottom-nav .nav-item.active {
    color: #2ea86c !important;
}

/* ============================================================
   🚑 FIX DÉCALAGE — Titres et Grilles de produits
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On empêche les rangées (row) de déborder */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. On s'assure que les colonnes ne dépassent pas */
    .col-6, .col-md-4, .col-lg-3, [class*="col-"] {
        padding-left: 4px !important;
        padding-right: 4px !important;
        max-width: 100% !important;
    }

    /* 3. Les en-têtes de section (Titres + Bouton "Tout voir") */
    .d-flex.justify-content-between {
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important; /* Interdit de passer à la ligne */
        gap: 8px !important;
    }
    
    .d-flex.justify-content-between h4, 
    .d-flex.justify-content-between h5 {
        font-size: 1.1rem !important;
        margin: 0 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .d-flex.justify-content-between .btn {
        padding: 6px 10px !important;
        font-size: 12px !important;
        flex-shrink: 0 !important; /* Le bouton ne rétrécit pas */
        white-space: nowrap;
    }

    /* 4. Le conteneur principal de la page d'accueil */
    main > .container, main > .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: hidden !important;
    }
}

/* ============================================================
   🚑 FORCE FULL WIDTH — Zéro marge, plein écran total
   ============================================================ */
@media (max-width: 991px) {
    

    /* 2. On remet un petit espace UNIQUEMENT aux colonnes (pour ne pas coller le texte) */
    .row > [class*="col-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* 3. On gère les en-têtes (Titres + Boutons "Tout voir") */
    .d-flex.justify-content-between {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        box-sizing: border-box !important;
    }

    /* 4. On force les éléments à ne pas déborder */
    .card, .btn, .alert, .badge {
        max-width: 100% !important;
    }

    /* 5. On s'assure que le body lui-même ne crée pas de scroll */
    body {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ============================================================
   🚑 FORCE 2 — Réduire les espaces (gaps) et marges internes
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On réduit l'espacement (gutter) par défaut de Bootstrap */
    .row {
        --bs-gutter-x: 10px !important; /* 10px d'espace entre les cartes (au lieu de 24px) */
        --bs-gutter-y: 10px !important;
        margin-left: -5px !important; /* On compense pour coller aux bords */
        margin-right: -5px !important;
    }
    
    /* 2. On s'assure que chaque colonne a la même largeur */
    .row > [class*="col-"] {
        padding-left: 5px !important;
        padding-right: 5px !important;
        max-width: 100% !important;
    }

    /* 3. Les cartes de catégories (Électronique, Mode) */
    .category-card, .card-body, .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 4. Si tes catégories sont dans un flex (d-flex), on force le wrap */
    .d-flex.flex-row {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    
    /* 5. On s'assure que le conteneur principal de la page est bien calé */
    main, .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ============================================================
   🎯 FIX CENTRAGE — Centrer les grilles et les cartes
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On centre le conteneur principal */
    main, 
    .container, 
    .container-fluid {
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. On centre les rangées et on compense l'espace (gutter) */
    .row {
        justify-content: center !important; /* Centre les colonnes */
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 10px !important; /* Espace entre les cartes */
    }

    /* 3. On s'assure que les colonnes prennent bien 50% chacune */
    .row > [class*="col-"] {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    /* 4. On empêche les cartes de déborder */
    .card, .card-produit {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 5. On force le conteneur des catégories (Tous, Mode, etc.) à prendre toute la place */
    .d-flex.flex-nowrap {
        padding-right: 10px !important;
    }
}

/* ============================================================
   🎯 FIX CENTRAGE — Centrer les grilles et les cartes
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On centre le conteneur principal */
    main, 
    .container, 
    .container-fluid {
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 2. On centre les rangées et on compense l'espace (gutter) */
    .row {
        justify-content: center !important; /* Centre les colonnes */
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 10px !important; /* Espace entre les cartes */
    }

    /* 3. On s'assure que les colonnes prennent bien 50% chacune */
    .row > [class*="col-"] {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    /* 4. On empêche les cartes de déborder */
    .card, .card-produit {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* 5. On force le conteneur des catégories (Tous, Mode, etc.) à prendre toute la place */
    .d-flex.flex-nowrap {
        padding-right: 10px !important;
    }
}

/* ============================================================
   🎯 FIX STYLE OZON — Cartes collées aux bords, 2 par ligne
   ============================================================ */
@media (max-width: 991px) {
    
    /* 1. On force le conteneur principal à ne pas avoir de marges */
    .container, .container-fluid, main, main > .container {
        padding-left: 4px !important; /* Juste 4px de sécurité */
        padding-right: 4px !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* 2. On supprime toutes les marges de la grille */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* 3. On force les colonnes à prendre exactement 50% et on gère l'espace interne */
    .row > [class*="col-"] {
        padding-left: 4px !important;  /* Espace entre les cartes */
        padding-right: 4px !important;
        width: 50% !important;
        max-width: 50% !important;
        flex: 0 0 50% !important;
    }

    /* 4. On s'assure que les cartes remplissent bien la colonne */
    .card, .card-produit {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* 5. On enlève les marges des titres (Nouveautés, Populaires) pour qu'ils s'alignent */
    .d-flex.justify-content-between {
        padding-left: 4px !important;
        padding-right: 4px !important;
        margin-bottom: 8px !important;
    }
}

/* ============================================================
   🚑 FIX BANNIÈRE ACCUEIL — Boutons empilés sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* On cible la zone des boutons de la bannière bleue */
    .hero-section .d-flex, 
    .hero .d-flex, 
    [class*="hero"] .d-flex {
        flex-direction: column !important; /* Force l'empilement */
        gap: 10px !important;
        width: 100% !important;
    }
    
    /* On s'assure que les boutons prennent toute la largeur pour être faciles à cliquer */
    .hero-section .d-flex .btn,
    .hero .d-flex .btn,
    [class*="hero"] .d-flex .btn {
        width: 100% !important;
        margin: 0 !important;
        justify-content: center !important;
    }

    /* La bannière noire (argent) prend toute la largeur */
    .alert[style*="background: #1a1a1a"], 
    .alert[style*="background: black"],
    .alert[style*="linear-gradient(135deg, #1a1a1a"] {
        width: 100vw !important;
        max-width: 100vw !important;
        margin-left: -12px !important; /* Compense le padding du container */
        border-radius: 0 !important;
    }
}

/* ============================================================
   📱 GRILLE D'ICÔNES TYPE APP (Dashboard)
   ============================================================ */
@media (max-width: 991px) {
    .app-icon-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        padding: 8px 4px;
        transition: transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .app-icon-card:active {
        transform: scale(0.92);
    }
    .app-icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin-bottom: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .app-icon-wrapper i {
        font-size: 26px;
    }
    .app-icon-label {
        font-size: 11px;
        font-weight: 600;
        color: #333;
        text-align: center;
        line-height: 1.2;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .app-icon-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #dc3545;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
    }

    /* Dark mode */
    body.dark-mode .app-icon-label {
        color: #e0e0e0 !important;
    }
    body.dark-mode .app-icon-wrapper {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    body.dark-mode .app-icon-badge {
        border-color: #1e1e1e;
    }
}

/* ============================================================
   📱 GRILLE D'ICÔNES (Profil)
   ============================================================ */
@media (max-width: 991px) {
    .app-icon-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        padding: 8px 4px;
        transition: transform 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .app-icon-card:active {
        transform: scale(0.92);
    }
    .app-icon-wrapper {
        width: 56px;
        height: 56px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        margin-bottom: 6px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .app-icon-wrapper i {
        font-size: 26px;
    }
    .app-icon-label {
        font-size: 11px;
        font-weight: 600;
        color: #333;
        text-align: center;
        line-height: 1.2;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    body.dark-mode .app-icon-label {
        color: #e0e0e0 !important;
    }
    body.dark-mode .app-icon-wrapper {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
}

/* ============================================================
   📱 MES COMMANDES — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {
    .order-card {
        border-radius: 16px !important;
        overflow: hidden;
    }
    .order-card .card-header {
        background: #f8f9fa !important;
        border-bottom: 1px solid #eee !important;
        padding: 10px 14px !important;
    }
    .order-card .card-body {
        padding: 14px !important;
    }
    .order-card .prix-fcfa {
        font-size: 1.1rem !important;
    }
    .order-card .alert {
        border-radius: 8px !important;
        font-size: 11px !important;
    }
    .order-card .btn {
        border-radius: 10px !important;
        font-weight: 600;
        min-height: 40px;
    }

    /* Filtres horizontaux scrollables */
    .mes-commandes-filtres {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mes-commandes-filtres::-webkit-scrollbar {
        display: none;
    }
    .mes-commandes-filtres .btn {
        flex-shrink: 0;
        border-radius: 20px !important;
        font-size: 12px !important;
        padding: 6px 14px !important;
        white-space: nowrap;
    }

    /* Dark mode */
    body.dark-mode .order-card .card-header {
        background: #2c2c2c !important;
        border-bottom-color: #444 !important;
    }
    body.dark-mode .order-card {
        background-color: #1e1e1e !important;
    }
    body.dark-mode .order-card .text-muted {
        color: #a0a0a0 !important;
    }
}

/* ============================================================
   📱 ESPACE VENDEUR — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {
    .stat-card-vendeur {
        border-radius: 14px !important;
        padding: 12px 8px !important;
    }
    .stat-icon-vendeur {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
    }
    .stat-card-vendeur .fs-5 {
        font-size: 1.1rem !important;
    }
    .stat-card-vendeur small {
        font-size: 10px !important;
    }

    /* Tableaux : cacher les colonnes inutiles sur mobile */
    .table-vendeur-mobile th,
    .table-vendeur-mobile td {
        padding: 8px 6px !important;
        font-size: 12px !important;
    }
    .table-vendeur-mobile .col-hide-mobile {
        display: none !important;
    }

    /* Cartes produits/ventes */
    .card .table-responsive {
        border-radius: 0 0 12px 12px;
    }

    /* En-tête vendeur */
    .vendeur-header-mobile {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        margin-bottom: 12px;
    }
    .vendeur-header-mobile img,
    .vendeur-header-mobile .avatar-vendeur {
        width: 56px;
        height: 56px;
        border-radius: 14px;
        object-fit: cover;
        flex-shrink: 0;
    }
    .vendeur-header-mobile h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0;
    }
    .vendeur-header-mobile .badge {
        font-size: 10px;
    }

    /* Dark mode */
    body.dark-mode .stat-card-vendeur,
    body.dark-mode .vendeur-header-mobile {
        background-color: #1e1e1e !important;
    }
    body.dark-mode .stat-card-vendeur .text-dark {
        color: #fff !important;
    }
}

/* ============================================================
   📱 ESPACE VENDEUR — Empiler les cartes sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* On force les colonnes contenant les cartes produits/ventes à prendre 100% */
    .row > .col-12.col-lg-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 16px;
    }

    /* On s'assure que les textes longs ne débordent pas */
    .card .d-flex.align-items-center .flex-grow-1 {
        min-width: 0; /* Permet au texte de rétrécir */
    }
    
    /* On force la troncature du texte (les "..." à la fin) */
    .card .text-truncate {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
}

/* ============================================================
   📱 FICHE PRODUIT — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {

    /* 1. L'image du carrousel prend la bonne taille */
    .carousel-item img {
        height: 280px !important;
        object-fit: contain !important;
        background: #f8f9fa !important;
    }
    #carouselProduit {
        border-radius: 16px !important;
        overflow: hidden;
    }

    /* 2. Les miniatures en dessous */
    .miniature-img {
        width: 50px !important;
        height: 50px !important;
        border-radius: 8px !important;
        border: 2px solid transparent;
    }
    .miniature-img.active {
        border-color: #0d6efd;
    }

    /* 3. La barre d'achat fixe en bas, AU-DESSUS de la bottom nav */
    .mobile-buy-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 60px !important; /* au-dessus de la bottom nav */
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        padding: 8px 12px !important;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.1) !important;
        z-index: 1029 !important;
        gap: 8px !important;
        align-items: center !important;
        border-top: 1px solid #eee !important;
    }

    /* 4. Les boutons dans la barre mobile */
    .mobile-buy-bar .btn {
        border-radius: 12px !important;
        font-weight: 600 !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 5. Le prix dans la barre mobile */
    .mobile-buy-bar > div:first-child {
        background: #f8f9fa;
        padding: 6px 10px;
        border-radius: 10px;
        min-width: 90px;
        text-align: center;
    }
    .mobile-buy-bar > div:first-child div:last-child {
        font-size: 1rem !important;
    }

    /* 6. On cache la version desktop des boutons */
    .d-none.d-md-block {
        display: none !important;
    }

    /* 7. Espacement pour que la page ne soit pas cachée par la barre */
    .container.has-sticky-cta {
        padding-bottom: 120px !important;
    }

    /* 8. Titre et prix */
    .prix-fcfa.fs-2 {
        font-size: 1.6rem !important;
    }

    /* 9. Les cartes description et caractéristiques */
    .card.bg-light {
        border-radius: 12px !important;
        background: #f8f9fa !important;
    }

    /* 10. Dark mode */
    body.dark-mode .mobile-buy-bar {
        background: #1e1e1e !important;
        border-top-color: #333 !important;
    }
    body.dark-mode .mobile-buy-bar > div:first-child {
        background: #2c2c2c !important;
    }
    body.dark-mode .card.bg-light {
        background: #2c2c2c !important;
    }
    body.dark-mode .carousel-item img {
        background: #2c2c2c !important;
    }
}

/* ============================================================
   🚑 FIX FICHE PRODUIT — Reset et correction du layout
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On annule la règle d'empilement globale qui a causé le bug */
    .row > .col-12.col-lg-6 {
        width: auto !important;
        max-width: none !important;
        flex: initial !important;
        margin-bottom: 0 !important;
    }

    /* 2. Sur la page produit, on force le carrousel et les infos à prendre 100% */
    .row.g-4 > .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 3. On corrige le carrousel */
    #carouselProduit {
        border-radius: 16px !important;
        overflow: hidden;
        margin-bottom: 12px;
    }
    .carousel-item img {
        height: 280px !important;
        object-fit: contain !important;
        background: #f8f9fa !important;
    }

    /* 4. On corrige les titres et textes pour qu'ils prennent toute la largeur */
    .col-md-6 > h1, 
    .col-md-6 > .vendor-badge, 
    .col-md-6 > .d-flex,
    .col-md-6 > .prix-box {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 5. On s'assure que les cartes internes (description, caractéristiques) sont bien */
    .col-md-6 .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 6. La barre d'achat fixe en bas reste correcte */
    .mobile-buy-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        background: #fff !important;
        padding: 8px 12px !important;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.1) !important;
        z-index: 1029 !important;
        gap: 8px !important;
        align-items: center !important;
        border-top: 1px solid #eee !important;
    }
}

/* ============================================================
   📱 BOUTIQUE VENDEUR — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {
    .bg-gradient-vendeur {
        background: linear-gradient(135deg, #f0fff4 0%, #d4edda 100%) !important;
        border-radius: 16px !important;
    }
    .bg-gradient-vendeur .card {
        background: #fff !important;
    }

    /* Grille de produits : on force 2 colonnes bien alignées à gauche */
    .row.g-3 > .col-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* Titre "Tous ses produits" */
    .d-flex.justify-content-between h2.h4 {
        font-size: 1.1rem !important;
    }
    .d-flex.justify-content-between .text-muted {
        font-size: 11px !important;
    }

    /* Dark mode */
    body.dark-mode .bg-gradient-vendeur {
        background: #1e1e1e !important;
    }
    body.dark-mode .bg-gradient-vendeur h1 {
        color: #fff !important;
    }
    body.dark-mode .bg-gradient-vendeur .card {
        background: #2c2c2c !important;
    }
    body.dark-mode .bg-gradient-vendeur .text-dark {
        color: #fff !important;
    }
}

/* ============================================================
   📱 MESSAGERIE — Style App Native (WhatsApp)
   ============================================================ */

/* 1. Sur les pages messages/chat, on cache la navbar et la bottom nav */
body.messages-page .navbar,
body.chat-page .navbar,
body.messages-page .mobile-bottom-nav,
body.chat-page .mobile-bottom-nav,
body.messages-page #uniplace-install-btn,
body.chat-page #uniplace-install-btn {
    display: none !important;
}

/* 2. Le contenu prend toute la hauteur, pas de padding parasite */
body.messages-page main,
body.chat-page main {
    padding: 0 !important;
    margin: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: #efeae2;
}

/* 3. Le wrapper de messages prend tout */
.messages-wrapper,
.chat-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 4. Les headers (messages et chat) */
.messages-header,
.chat-header {
    padding-top: max(15px, env(safe-area-inset-top)) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

/* 5. Les items de conversation */
.conv-item {
    padding: 12px 16px !important;
    gap: 12px !important;
}
.conv-avatar {
    width: 50px !important;
    height: 50px !important;
    font-size: 18px !important;
}
.conv-name {
    font-size: 15px !important;
}
.conv-preview {
    font-size: 13px !important;
}

/* 6. Les bulles de chat */
.msg-bubble {
    max-width: 80% !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
}
.msg-bubble.has-media {
    max-width: 90% !important;
}

/* 7. Le champ de saisie (chat_detail) — collé en bas */
.chat-input-area {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) 12px !important;
    border-top: 1px solid #e0e0e0 !important;
    z-index: 10 !important;
}

/* 8. Dark mode pour la messagerie */
body.dark-mode.messages-page main,
body.dark-mode.chat-page main {
    background: #0f1419 !important;
}
body.dark-mode .messages-wrapper,
body.dark-mode .chat-wrapper {
    background: #0f1419 !important;
}
body.dark-mode .conv-list {
    background: #1e1e1e !important;
}
body.dark-mode .conv-item {
    border-bottom-color: #2c2c2c !important;
    background: #1e1e1e !important;
}
body.dark-mode .conv-item.unread {
    background: #1a2e24 !important;
    border-left-color: #198754 !important;
}
body.dark-mode .conv-name {
    color: #fff !important;
}
body.dark-mode .conv-preview {
    color: #a0a0a0 !important;
}
body.dark-mode .chat-messages-area {
    background-color: #0b141a !important;
    background-image: none !important;
}
body.dark-mode .msg-theirs {
    background: #202c33 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .msg-mine {
    background: #005c4b !important;
    color: #e0e0e0 !important;
}
body.dark-mode .msg-time {
    color: #8696a0 !important;
}
body.dark-mode .chat-input-area {
    background: #1f2c34 !important;
    border-top-color: #2a3942 !important;
}
body.dark-mode .chat-input-area input,
body.dark-mode .chat-input-area textarea {
    background: #2a3942 !important;
    color: #fff !important;
    border-color: #3a4a54 !important;
}

@media (max-width: 991px) {

    /* 1. Le stepper compact */
    .checkout-stepper {
        padding: 10px 5px !important;
        margin-bottom: 15px !important;
    }
    .stepper-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    .stepper-label {
        font-size: 11px !important;
    }

    /* 2. Articles : cartes compactes */
    .cart-item {
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }
    .cart-item .card-body {
        padding: 12px !important;
    }
    .cart-item img {
        height: 80px !important;
        border-radius: 10px !important;
    }
    .cart-item h6 {
        font-size: 14px !important;
    }
    .cart-item .prix-fcfa {
        font-size: 14px !important;
    }
    .cart-item .badge {
        font-size: 10px !important;
    }

    /* 3. Le récapitulatif est caché sur mobile (remplacé par la barre sticky) */
    .col-lg-4 .card.sticky-top {
        display: none !important;
    }
    .col-lg-4 .card.bg-light {
        display: none !important;
    }
    
    /* 4. La colonne des articles prend toute la largeur */
    .col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 5. La barre sticky en bas */
    .panier-sticky-mobile {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1029 !important;
        padding: 8px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .panier-sticky-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        color: #fff !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35) !important;
        pointer-events: auto;
    }
    .panier-sticky-info strong {
        font-weight: 800 !important;
    }

    /* 6. Espace en bas pour ne pas cacher le dernier article */
    .container.py-4 {
        padding-bottom: 140px !important;
    }

    /* 7. Dark mode */
    body.dark-mode .panier-sticky-mobile {
        background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,0.95) 20%, #121212 100%) !important;
    }
    body.dark-mode .panier-sticky-inner {
        background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
    }
    body.dark-mode .cart-item {
        background-color: #1e1e1e !important;
    }
    body.dark-mode .cart-item h6,
    body.dark-mode .cart-item .text-dark {
        color: #fff !important;
    }
    body.dark-mode .quantity-selector-cart {
        background: #2c2c2c !important;
        border-color: #444 !important;
    }
    body.dark-mode .quantity-selector-cart button {
        background: #2c2c2c !important;
        color: #fff !important;
    }
    body.dark-mode .quantity-selector-cart input {
        background: #2c2c2c !important;
        color: #fff !important;
    }
}

@media (max-width: 991px) {
    /* 1. Le sélecteur de quantité prend toute la place nécessaire */
    .quantity-selector-cart {
        display: inline-flex !important;
        align-items: center !important;
        width: auto !important;
        max-width: 100% !important;
    }
    
    /* 2. Les boutons + et - sont bien visibles et tactiles */
    .quantity-selector-cart button {
        width: 44px !important;
        height: 44px !important;
        font-size: 20px !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .quantity-selector-cart input {
        width: 50px !important;
        height: 44px !important;
        font-size: 16px !important;
        flex-shrink: 0 !important;
    }

    /* 3. La ligne de l'article ne doit pas déborder */
    .cart-item .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .cart-item .row > [class*="col-"] {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 4. Le bouton supprimer bien visible */
    .cart-item .btn-outline-danger {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}


@media (max-width: 991px) {
    /* 1. Cacher le récapitulatif de droite sur mobile */
    .col-lg-4 .card.sticky-top,
    .col-lg-4 .card.bg-light {
        display: none !important;
    }

    /* 2. La colonne articles prend toute la largeur */
    .col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 3. La barre sticky en bas */
    .panier-sticky-mobile {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1029 !important;
        padding: 8px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .panier-sticky-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        color: #fff !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35) !important;
        pointer-events: auto;
    }

    /* 4. Espace en bas pour ne pas cacher le dernier article */
    .container.py-4 {
        padding-bottom: 140px !important;
    }

    /* 5. Dark mode */
    body.dark-mode .panier-sticky-mobile {
        background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,0.95) 20%, #121212 100%) !important;
    }
    body.dark-mode .panier-sticky-inner {
        background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
    }
}

/* ============================================================
   📱 PANIER — Sélecteur de quantité (version finale)
   ============================================================ */
@media (max-width: 991px) {
    /* 1. Le conteneur du sélecteur */
    .quantity-selector-cart {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: 2px solid #dee2e6 !important;
        border-radius: 10px !important;
        background: #fff !important;
        overflow: hidden !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* 2. Les boutons + et - */
    .quantity-selector-cart button {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        font-size: 20px !important;
        font-weight: bold !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        border: none !important;
        background: #fff !important;
        color: #333 !important;
        cursor: pointer !important;
    }
    .quantity-selector-cart button:active {
        background: #0d6efd !important;
        color: #fff !important;
    }
    .quantity-selector-cart button:disabled {
        opacity: 0.3 !important;
        cursor: not-allowed !important;
    }

    /* 3. Le champ de quantité */
    .quantity-selector-cart input {
        width: 40px !important;
        height: 40px !important;
        text-align: center !important;
        font-size: 15px !important;
        font-weight: bold !important;
        border: none !important;
        outline: none !important;
        background: #fff !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
    }

    /* 4. On s'assure que le formulaire ne casse pas la mise en page */
    .cart-item form {
        display: flex !important;
        justify-content: center !important;
        margin: 0 !important;
    }

    /* 5. La colonne de la quantité prend bien sa place */
    .cart-item .col-6.col-md-3 {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* ============================================================
   📱 PANIER — Réorganisation de la carte article sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* 1. La carte de l'article devient une colonne flexible */
    .cart-item .card-body > .row {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        margin: 0 !important;
    }

    

    /* 3. On remet l'image et le titre côte à côte en haut */
    .cart-item .card-body > .row {
        display: grid !important;
        grid-template-columns: 80px 1fr !important;
        grid-template-areas:
            "image infos"
            "qty qty"
            "total total" !important;
        gap: 10px !important;
        align-items: start !important;
    }

    /* 4. L'image */
    .cart-item .card-body > .row > [class*="col-"]:nth-child(1) {
        grid-area: image !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(1) img {
        width: 80px !important;
        height: 80px !important;
        object-fit: cover !important;
        border-radius: 10px !important;
    }

    /* 5. Les infos (titre, vendeur, prix unitaire) */
    .cart-item .card-body > .row > [class*="col-"]:nth-child(2) {
        grid-area: infos !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(2) h6 {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    /* 6. La quantité */
    .cart-item .card-body > .row > [class*="col-"]:nth-child(3) {
        grid-area: qty !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        margin-top: 4px !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(3) form {
        margin: 0 !important;
    }

    /* 7. Le prix total + bouton supprimer */
    .cart-item .card-body > .row > [class*="col-"]:nth-child(4) {
        grid-area: total !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: left !important;
        border-top: 1px solid #f1f1f1 !important;
        padding-top: 8px !important;
        margin-top: 4px !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(4) .fw-bold {
        font-size: 15px !important;
        margin: 0 !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(4) form {
        margin: 0 !important;
    }
    .cart-item .card-body > .row > [class*="col-"]:nth-child(4) .btn-outline-danger {
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 8. Le sélecteur de quantité */
    .quantity-selector-cart {
        display: inline-flex !important;
        align-items: center !important;
        border: 2px solid #dee2e6 !important;
        border-radius: 10px !important;
        background: #fff !important;
        overflow: hidden !important;
    }
    .quantity-selector-cart button {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fff !important;
        color: #333 !important;
        border: none !important;
    }
    .quantity-selector-cart button:active {
        background: #0d6efd !important;
        color: #fff !important;
    }
    .quantity-selector-cart input {
        width: 40px !important;
        height: 40px !important;
        text-align: center !important;
        font-size: 15px !important;
        font-weight: bold !important;
        border: none !important;
        background: #fff !important;
    }
}

/* ============================================================
   📱 PANIER — Carte article mobile (design final)
   ============================================================ */
@media (max-width: 991px) {
    /* Carte article */
    .cart-item-mobile {
        border-radius: 14px !important;
        margin-bottom: 12px !important;
    }

    /* Sélecteur de quantité */
    .quantity-selector-mobile {
        display: inline-flex !important;
        align-items: center !important;
        border: 2px solid #dee2e6 !important;
        border-radius: 10px !important;
        background: #fff !important;
        overflow: hidden !important;
    }
    .quantity-selector-mobile button {
        width: 40px !important;
        height: 40px !important;
        font-size: 20px !important;
        font-weight: bold !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #fff !important;
        color: #333 !important;
        border: none !important;
        padding: 0 !important;
    }
    .quantity-selector-mobile button:active {
        background: #0d6efd !important;
        color: #fff !important;
    }
    .quantity-selector-mobile button:disabled {
        opacity: 0.3 !important;
    }
    .quantity-selector-mobile input {
        width: 40px !important;
        height: 40px !important;
        text-align: center !important;
        font-size: 15px !important;
        font-weight: bold !important;
        border: none !important;
        background: #fff !important;
        padding: 0 !important;
    }

    /* Dark mode */
    body.dark-mode .cart-item-mobile {
        background-color: #1e1e1e !important;
    }
    body.dark-mode .cart-item-mobile h6 {
        color: #fff !important;
    }
    body.dark-mode .quantity-selector-mobile {
        background: #2c2c2c !important;
        border-color: #444 !important;
    }
    body.dark-mode .quantity-selector-mobile button,
    body.dark-mode .quantity-selector-mobile input {
        background: #2c2c2c !important;
        color: #fff !important;
    }
}

/* ============================================================
   📱 PANIER — Carte article (design final mobile-first)
   ============================================================ */
@media (max-width: 991px) {

    .cart-item-mobile {
        background: #fff;
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    }

    /* Bloc du haut : image + infos + supprimer */
    .cart-item-top {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }

    .cart-item-img {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        border-radius: 12px;
        overflow: hidden;
        display: block;
    }
    .cart-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .cart-item-infos {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .cart-item-title {
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.3;
    }

    .cart-item-vendor {
        font-size: 10px;
        align-self: flex-start;
        padding: 2px 8px;
        border-radius: 6px;
    }

    .cart-item-price-unit {
        font-size: 13px;
        font-weight: 700;
        color: #198754;
    }

    .cart-item-delete {
        flex-shrink: 0;
        margin: 0;
    }
    .cart-item-delete button {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #f1c0c8;
        background: #fff5f6;
        color: #dc3545;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        padding: 0;
        cursor: pointer;
        transition: all 0.15s;
    }
    .cart-item-delete button:active {
        background: #dc3545;
        color: #fff;
    }

    /* Bloc du bas : quantité + total */
    .cart-item-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f1f1f1;
        gap: 12px;
    }

    .cart-qty-form {
        margin: 0;
        flex-shrink: 0;
    }

    .cart-qty {
        display: inline-flex;
        align-items: center;
        border: 1.5px solid #dee2e6;
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }
    .cart-qty button {
        width: 38px;
        height: 38px;
        border: none;
        background: #fff;
        color: #333;
        font-size: 18px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        cursor: pointer;
    }
    .cart-qty button:active:not(:disabled) {
        background: #0d6efd;
        color: #fff;
    }
    .cart-qty button:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
    .cart-qty input {
        width: 38px;
        height: 38px;
        border: none;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        background: #fff;
        padding: 0;
        outline: none;
        -moz-appearance: textfield;
    }
    .cart-qty input::-webkit-outer-spin-button,
    .cart-qty input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .cart-item-total {
        font-size: 15px;
        font-weight: 800;
        color: #0d6efd;
        text-align: right;
        white-space: nowrap;
    }

    /* Dark mode */
    body.dark-mode .cart-item-mobile {
        background: #1e1e1e !important;
    }
    body.dark-mode .cart-item-title {
        color: #fff !important;
    }
    body.dark-mode .cart-item-bottom {
        border-top-color: #333 !important;
    }
    body.dark-mode .cart-qty {
        background: #2c2c2c !important;
        border-color: #444 !important;
    }
    body.dark-mode .cart-qty button,
    body.dark-mode .cart-qty input {
        background: #2c2c2c !important;
        color: #fff !important;
    }
    body.dark-mode .cart-item-delete button {
        background: #2c2c2c !important;
        border-color: #4a2a2f !important;
    }
}

@media (max-width: 991px) {
    /* On cache tout élément qui ressemble à un vieux sélecteur */
    .cart-item-mobile .quantity-selector-cart,
    .cart-item-mobile .row > .col-6.col-md-3,
    .cart-item-mobile .border-start,
    .cart-item-mobile .border-end {
        display: none !important;
        border: none !important;
    }

    /* On s'assure que le nouveau sélecteur est seul */
    .cart-qty {
        display: inline-flex !important;
        border: 1.5px solid #dee2e6 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
        background: #fff !important;
    }
    .cart-qty button {
        width: 38px !important;
        height: 38px !important;
        border: none !important;
        background: #fff !important;
        color: #333 !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
    }
    .cart-qty button:active:not(:disabled) {
        background: #0d6efd !important;
        color: #fff !important;
    }
    .cart-qty button:disabled {
        opacity: 0.3 !important;
    }
    .cart-qty input {
        width: 38px !important;
        height: 38px !important;
        border: none !important;
        text-align: center !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        background: #fff !important;
        padding: 0 !important;
        outline: none !important;
    }
}

/* ============================================================
   📱 PANIER — CSS FINAL (aucun autre CSS panier ne doit exister)
   ============================================================ */
@media (max-width: 991px) {

    /* Carte article */
    .cart-item-mobile {
        background: #fff;
        border-radius: 16px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    }

    /* Haut : image + infos + poubelle */
    .cart-item-top {
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }
    .cart-item-img {
        flex-shrink: 0;
        width: 80px;
        height: 80px;
        border-radius: 12px;
        overflow: hidden;
        display: block;
    }
    .cart-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .cart-item-infos {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .cart-item-title {
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.3;
    }
    .cart-item-vendor {
        font-size: 10px;
        align-self: flex-start;
        padding: 2px 8px;
        border-radius: 6px;
    }
    .cart-item-delete {
        flex-shrink: 0;
        margin: 0;
    }
    .cart-item-delete button {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #f1c0c8;
        background: #fff5f6;
        color: #dc3545;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
        padding: 0;
    }
    .cart-item-delete button:active {
        background: #dc3545;
        color: #fff;
    }

    /* Bas : quantité + total */
    .cart-item-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f1f1f1;
        gap: 12px;
    }
    .cart-qty-form {
        margin: 0;
        flex-shrink: 0;
    }
    .cart-qty {
        display: inline-flex;
        align-items: center;
        border: 1.5px solid #dee2e6;
        border-radius: 10px;
        overflow: hidden;
        background: #fff;
    }
    .cart-qty button {
        width: 38px;
        height: 38px;
        border: none;
        background: #fff;
        color: #333;
        font-size: 18px;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
    .cart-qty button:active:not(:disabled) {
        background: #0d6efd;
        color: #fff;
    }
    .cart-qty button:disabled {
        opacity: 0.3;
    }
    .cart-qty input {
        width: 38px;
        height: 38px;
        border: none;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        background: #fff;
        padding: 0;
        outline: none;
    }
    .cart-item-total {
        font-size: 15px;
        font-weight: 800;
        color: #0d6efd;
        text-align: right;
        white-space: nowrap;
    }

    /* Barre sticky mobile */
    .panier-sticky-mobile {
        position: fixed;
        bottom: 60px;
        left: 0;
        right: 0;
        z-index: 1029;
        padding: 8px 12px;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .panier-sticky-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%);
        color: #fff;
        border-radius: 14px;
        padding: 10px 14px;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35);
        pointer-events: auto;
    }

    /* Espace en bas pour ne pas cacher le dernier article */
    .container.py-4 {
        padding-bottom: 140px !important;
    }

    /* Dark mode */
    body.dark-mode .cart-item-mobile {
        background: #1e1e1e !important;
    }
    body.dark-mode .cart-item-title {
        color: #fff !important;
    }
    body.dark-mode .cart-item-bottom {
        border-top-color: #333 !important;
    }
    body.dark-mode .cart-qty {
        background: #2c2c2c !important;
        border-color: #444 !important;
    }
    body.dark-mode .cart-qty button,
    body.dark-mode .cart-qty input {
        background: #2c2c2c !important;
        color: #fff !important;
    }
    body.dark-mode .panier-sticky-mobile {
        background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,0.95) 20%, #121212 100%) !important;
    }
}

/* ============================================================
   🎯 FIX FINAL — Carte panier pleine largeur
   ============================================================ */
@media (max-width: 991px) {
    
    .col-12.col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 2. La carte article prend toute la largeur disponible */
    .cart-item-mobile {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 3. On enlève les marges résiduelles sur la row */
    .row.g-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================================
   📱 PANIER — Espace pour la barre sticky + barre plus fine
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On ajoute un grand espace en bas du container pour que le contenu ne soit pas caché */
    .container.py-4 {
        padding-bottom: 180px !important; /* Assez d'espace pour la barre + le bouton */
    }

    /* 2. On rend la barre sticky plus fine et moins envahissante */
    .panier-sticky-mobile {
        padding: 6px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 15%, #fff 100%) !important;
    }
    .panier-sticky-inner {
        padding: 8px 14px !important;
        border-radius: 12px !important;
    }
    .panier-sticky-info strong {
        font-size: 14px !important;
    }
    .panier-sticky-inner .btn {
        min-height: 40px !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
    }

    /* 3. On s'assure que le bouton "Continuer mes achats" est bien au-dessus de la barre */
    .d-flex.justify-content-between.align-items-center.mt-3 {
        margin-bottom: 20px !important;
    }
}

/* ============================================================
   📱 PANIER — Bouton croix pour fermer la barre sticky
   ============================================================ */
@media (max-width: 991px) {
    .btn-close-sticky {
        background: rgba(255,255,255,0.2);
        border: none;
        color: #fff;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        padding: 0;
        margin-left: 4px;
        cursor: pointer;
        transition: background 0.2s;
        flex-shrink: 0;
    }
    .btn-close-sticky:active {
        background: rgba(255,255,255,0.4);
    }
    .btn-close-sticky i {
        font-size: 16px;
    }
}

/* ============================================================
   📱 CHECKOUT — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {

    /* 1. Le stepper compact */
    .checkout-stepper {
        padding: 12px 5px !important;
        margin-bottom: 15px !important;
    }
    .stepper-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    .stepper-label {
        font-size: 11px !important;
    }

    /* 2. Le titre plus petit */
    .container.py-4 h1.h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }

    /* 3. Les cartes prennent toute la largeur */
    .col-lg-7, .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 4. Le formulaire d'adresse plus compact */
    .card .card-body {
        padding: 14px !important;
    }
    .card .card-body h5 {
        font-size: 15px !important;
    }
    .form-control, .form-select, textarea {
        font-size: 16px !important;
        min-height: 44px !important;
    }
    textarea.form-control {
        min-height: 80px !important;
    }

    /* 5. Les cartes d'adresse : plus compactes */
    .address-card {
        padding: 12px !important;
        font-size: 14px !important;
    }

    /* 6. Le récapitulatif (colonne de droite) est caché sur mobile */
    .col-lg-5 .card.sticky-top {
        display: none !important;
    }

    /* 7. La barre sticky en bas */
    .checkout-sticky-mobile {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1029 !important;
        padding: 8px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .checkout-sticky-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        color: #fff !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35) !important;
        pointer-events: auto;
    }
    .checkout-btn-pay {
        background: #fff !important;
        color: #198754 !important;
        border: none !important;
        border-radius: 10px !important;
        padding: 10px 18px !important;
        font-weight: 700 !important;
        font-size: 14px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    /* 8. Espace en bas pour ne pas cacher le contenu */
    .container.py-4 {
        padding-bottom: 140px !important;
    }

    /* 9. Dark mode */
    body.dark-mode .checkout-sticky-mobile {
        background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,0.95) 20%, #121212 100%) !important;
    }
    body.dark-mode .checkout-sticky-inner {
        background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
    }
    body.dark-mode .address-card {
        background: #2c2c2c !important;
        color: #fff !important;
    }
}

/* ============================================================
   🚑 FIX CHECKOUT — Colonnes empilées et lisibles
   ============================================================ */
@media (max-width: 991px) {

    

    /* 2. On enlève les marges de la grille */
    .row.g-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 3. Le formulaire d'adresse prend toute la largeur */
    .card .card-body {
        padding: 14px !important;
    }

    /* 4. Les textes sont bien lisibles */
    .card .card-body h5 {
        font-size: 15px !important;
        margin-bottom: 12px !important;
    }
    .form-control, .form-select, textarea {
        font-size: 16px !important;
        min-height: 44px !important;
        width: 100% !important;
    }
    textarea.form-control {
        min-height: 80px !important;
    }

    /* 5. Le récapitulatif de droite est caché sur mobile */
    .col-lg-5 {
        display: none !important;
    }

    /* 6. Le bouton payer dans le formulaire est caché (remplacé par la barre sticky) */
    form > .btn-success.btn-lg {
        display: none !important;
    }

    /* 7. La barre sticky reste bien en bas */
    .checkout-sticky-mobile {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1029 !important;
        padding: 8px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .checkout-sticky-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        color: #fff !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35) !important;
        pointer-events: auto;
    }
    .checkout-btn-pay {
        background: #fff !important;
        color: #198754 !important;
        border: none !important;
        border-radius: 10px !important;
        padding: 10px 18px !important;
        font-weight: 700 !important;
        font-size: 14px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    /* 8. Espace en bas pour ne pas cacher le contenu */
    .container.py-4 {
        padding-bottom: 140px !important;
    }

    /* 9. Dark mode */
    body.dark-mode .checkout-sticky-mobile {
        background: linear-gradient(180deg, rgba(18,18,18,0) 0%, rgba(18,18,18,0.95) 20%, #121212 100%) !important;
    }
    body.dark-mode .checkout-sticky-inner {
        background: linear-gradient(135deg, #0f5132 0%, #146c43 100%) !important;
    }
}


/* ============================================================
   📱 CARTES PRODUITS — Titre sur 2 lignes complètes
   ============================================================ */
@media (max-width: 768px) {
    .card-produit .card-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
        height: auto !important;
        min-height: 34px !important;
        max-height: 34px !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        white-space: normal !important;
        text-overflow: ellipsis !important;
    }
}

/* ============================================================
   📱 CARTES PRODUITS — Titre sur 2 lignes complètes
   ============================================================ */
@media (max-width: 768px) {
    .card-produit .title-2-lines {
        font-size: 13px !important;
        line-height: 1.3 !important;
        height: auto !important;
        min-height: 34px !important;
        max-height: 34px !important;
        margin-bottom: 4px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        white-space: normal !important;
        text-overflow: ellipsis !important;
    }
}

/* ============================================================
   📱 CHECKOUT — Formulaire pleine largeur (ciblé)
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On cible UNIQUEMENT les colonnes de la page checkout */
    .checkout-stepper ~ form .row > [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 2. On enlève les marges de la grille */
    .checkout-stepper ~ form .row.g-4 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 3. Le récapitulatif de droite est caché sur mobile */
    .checkout-stepper ~ form .col-lg-5 {
        display: none !important;
    }

    /* 4. Le formulaire prend toute la largeur */
    .checkout-stepper ~ form .col-lg-7 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 5. Les cartes internes prennent toute la largeur */
    .checkout-stepper ~ form .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 6. Les champs de formulaire sont bien lisibles */
    .checkout-stepper ~ form .form-control,
    .checkout-stepper ~ form .form-select,
    .checkout-stepper ~ form textarea {
        width: 100% !important;
        font-size: 16px !important;
        min-height: 44px !important;
    }

    /* 7. Le bouton "Payer" dans le formulaire est caché (remplacé par la barre sticky) */
    .checkout-stepper ~ form > button[type="submit"] {
        display: none !important;
    }

    /* 8. La barre sticky reste bien en bas */
    .checkout-sticky-mobile {
        position: fixed !important;
        bottom: 60px !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1029 !important;
        padding: 8px 12px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 20%, #fff 100%);
        pointer-events: none;
    }
    .checkout-sticky-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        background: linear-gradient(135deg, #198754 0%, #20c997 100%) !important;
        color: #fff !important;
        border-radius: 14px !important;
        padding: 10px 14px !important;
        box-shadow: 0 6px 24px rgba(25, 135, 84, 0.35) !important;
        pointer-events: auto;
    }
    .checkout-btn-pay {
        background: #fff !important;
        color: #198754 !important;
        border: none !important;
        border-radius: 10px !important;
        padding: 10px 18px !important;
        font-weight: 700 !important;
        font-size: 14px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        white-space: nowrap !important;
    }

    /* 9. Espace en bas pour ne pas cacher le contenu */
    .checkout-stepper ~ form {
        padding-bottom: 120px !important;
    }
}

/* ============================================================
   📱 SUIVI DE COMMANDE — Style App Mobile
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On empile les colonnes */
    .col-lg-7, .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 2. Le header de commande plus compact */
    .bg-gradient-order-customer .card-body {
        padding: 14px !important;
    }
    .bg-gradient-order-customer h1 {
        font-size: 1.1rem !important;
    }
    .bg-gradient-order-customer .badge {
        font-size: 10px !important;
    }
    .bg-gradient-order-customer .fs-3 {
        font-size: 1.2rem !important;
    }

    /* 3. La timeline compacte */
    .timeline-customer {
        padding-left: 0 !important;
        list-style: none !important;
    }
    .timeline-customer li {
        display: flex !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        border-left: 3px solid #e9ecef !important;
        margin-left: 14px !important;
        padding-left: 20px !important;
        position: relative !important;
    }
    .timeline-customer li.fait {
        border-left-color: #198754 !important;
    }
    .timeline-customer li.actif {
        border-left-color: #0d6efd !important;
    }
    .timeline-customer .timeline-icon {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        background: #e9ecef !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
        position: absolute !important;
        left: -16px !important;
        top: 8px !important;
        z-index: 2 !important;
    }
    .timeline-customer li.fait .timeline-icon {
        background: #198754 !important;
        color: #fff !important;
    }
    .timeline-customer li.actif .timeline-icon {
        background: #0d6efd !important;
        color: #fff !important;
    }
    .timeline-customer .timeline-content {
        font-size: 14px !important;
    }
    .timeline-customer .timeline-content strong {
        font-size: 14px !important;
    }

    /* 4. Les articles plus compacts */
    .card .d-flex.align-items-center.mb-3 {
        gap: 8px !important;
    }
    .card .d-flex.align-items-center.mb-3 img {
        width: 50px !important;
        height: 50px !important;
    }
    .card .d-flex.align-items-center.mb-3 .fw-semibold {
        font-size: 13px !important;
    }

    /* 5. Le récapitulatif et l'adresse prennent toute la largeur */
    .col-lg-5 .card {
        width: 100% !important;
    }

    /* 6. Le bouton "Retour à mes commandes" plus discret */
    .btn-outline-secondary.btn-sm {
        font-size: 12px !important;
        padding: 4px 10px !important;
    }

    /* 7. Dark mode */
    body.dark-mode .bg-gradient-order-customer {
        background: #1e1e1e !important;
    }
    body.dark-mode .timeline-customer li {
        border-left-color: #333 !important;
    }
    body.dark-mode .timeline-customer .timeline-icon {
        background: #2c2c2c !important;
    }
    body.dark-mode .timeline-customer li.fait .timeline-icon {
        background: #198754 !important;
    }
    body.dark-mode .timeline-customer li.actif .timeline-icon {
        background: #0d6efd !important;
    }
}

/* ============================================================
   🚑 FIX SUIVI DE COMMANDE — Pleine largeur et lisible
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On force le container et les colonnes à prendre 100% */
    .container.py-4 {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
    }
    .col-lg-7, .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 2. Les cartes prennent toute la largeur */
    .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 3. Les articles : image + infos + prix bien alignés */
    .card .d-flex.align-items-center.mb-3 {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f1f1 !important;
    }
    .card .d-flex.align-items-center.mb-3 img {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }
    .card .d-flex.align-items-center.mb-3 .flex-grow-1 {
        flex: 1 !important;
        min-width: 0 !important;
    }
    .card .d-flex.align-items-center.mb-3 .fw-semibold {
        font-size: 13px !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        max-height: none !important;
    }
    .card .d-flex.align-items-center.mb-3 .text-end {
        flex-shrink: 0 !important;
        text-align: right !important;
        min-width: 80px !important;
    }
    .card .d-flex.align-items-center.mb-3 .text-end .fw-bold {
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    .card .d-flex.align-items-center.mb-3 .text-end small {
        font-size: 10px !important;
    }

    /* 4. La timeline prend toute la largeur */
    .timeline-customer {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 5. Le header de commande prend toute la largeur */
    .bg-gradient-order-customer {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   📱 SUIVI DE COMMANDE — Correctif ciblé
   ============================================================ */
@media (max-width: 991px) {

    /* 1. On force le container à prendre 100% de la largeur */
    body .container.py-4 {
        width: 100vw !important;
        max-width: 100vw !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 2. On force les colonnes à prendre 100% */
    body .container.py-4 .row.g-4 > .col-lg-7,
    body .container.py-4 .row.g-4 > .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* 3. Les cartes internes prennent 100% */
    body .container.py-4 .card {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 4. La timeline prend toute la largeur */
    body .timeline-customer {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 5. Les articles : image + titre + prix bien alignés */
    body .container.py-4 .card .d-flex.align-items-center.mb-3 {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f1f1f1 !important;
    }
    body .container.py-4 .card .d-flex.align-items-center.mb-3 img {
        width: 50px !important;
        height: 50px !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
        object-fit: cover !important;
    }
    body .container.py-4 .card .d-flex.align-items-center.mb-3 .flex-grow-1 {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: visible !important;
    }
    body .container.py-4 .card .d-flex.align-items-center.mb-3 .flex-grow-1 .fw-semibold {
        font-size: 13px !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        display: block !important;
        max-height: none !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
    }
    body .container.py-4 .card .d-flex.align-items-center.mb-3 .text-end {
        flex-shrink: 0 !important;
        text-align: right !important;
        min-width: 70px !important;
    }
    body .container.py-4 .card .d-flex.align-items-center.mb-3 .text-end .fw-bold {
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* 6. Le header de commande prend toute la largeur */
    body .bg-gradient-order-customer {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================================
   🔔 TOAST DE CONFIRMATION (app native)
   ============================================================ */
.app-toast {
    background: #1e1e1e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUpToast 0.3s ease-out;
    pointer-events: auto;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-toast-success {
    background: #198754;
}
.app-toast-error {
    background: #dc3545;
}
.app-toast-info {
    background: #0d6efd;
}

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


/* ============================================================
   🖥️ HEADER PC — Barre de recherche et panier visible
   ============================================================ */
@media (min-width: 992px) {
    /* Le header PC est plus aéré */
    .navbar.navbar-expand-lg {
        padding: 10px 0 !important;
    }

    /* La barre de recherche prend toute la place au centre */
    .navbar .d-none.d-lg-flex.flex-grow-1 {
        max-width: 600px !important;
    }

    /* Le champ de recherche est plus grand */
    .navbar .input-group .form-control {
        font-size: 15px !important;
    }

    /* Le bouton "Rechercher" est plus visible */
    .navbar .input-group .btn-primary {
        font-weight: 600;
        font-size: 14px;
    }

    /* Le panier est plus visible */
    .navbar .btn-outline-primary {
        border-width: 2px;
    }

    /* Le header prend toute la largeur */
    .navbar .container {
        max-width: 1400px !important;
    }
}

/* Sur mobile, on cache la barre de recherche et le panier visible (on garde les icônes) */
@media (max-width: 991px) {
    .navbar .d-none.d-lg-flex {
        display: none !important;
    }
}

/* ============================================================
   🖥️ HEADER PC — Réorganisation et aération
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le header est plus haut et plus aéré */
    .navbar.navbar-expand-lg {
        padding: 12px 0 !important;
    }

    /* 2. La barre de recherche prend plus de place */
    .navbar .d-none.d-lg-flex.flex-grow-1 {
        max-width: 500px !important;
        margin: 0 auto !important;
    }
    .navbar .input-group .form-control {
        font-size: 14px !important;
        min-height: 42px !important;
    }
    .navbar .input-group .btn-primary {
        font-weight: 600 !important;
        font-size: 13px !important;
        padding: 0 16px !important;
        white-space: nowrap !important;
    }

    /* 3. Le panier est plus compact */
    .navbar .d-none.d-lg-flex.align-items-center.me-3 .btn {
        padding: 8px 14px !important;
        font-size: 14px !important;
        min-height: 42px !important;
    }

    /* 4. Les liens de navigation sont plus aérés */
    .navbar .navbar-nav .nav-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    /* 5. Le bouton "Devenir vendeur" est plus discret */
    .navbar .btn-success {
        padding: 8px 16px !important;
        font-size: 13px !important;
        min-height: 42px !important;
    }

    /* 6. Les boutons Connexion / S'inscrire sont plus petits */
    .navbar .btn-outline-primary,
    .navbar .btn-primary {
        padding: 8px 16px !important;
        font-size: 13px !important;
        min-height: 42px !important;
    }

    /* 7. On espace les éléments de droite */
    .navbar .navbar-nav:last-child {
        gap: 8px !important;
    }

    /* 8. Le logo garde sa taille */
    .navbar .navbar-brand {
        font-size: 1.3rem !important;
        font-weight: 800 !important;
    }
}

/* ============================================================
   🎨 HERO PREMIUM — Bannière d'accueil
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%) !important;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
}
.hero-section::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

/* Sur PC, le hero est plus grand */
@media (min-width: 992px) {
    .hero-section .container {
        padding-top: 60px !important;
        padding-bottom: 60px !important;
    }
    .hero-section .display-4 {
        font-size: 3.5rem !important;
    }
    .hero-section .lead {
        font-size: 1.35rem !important;
    }
    .hero-illustration i {
        font-size: 14rem !important;
    }
}

/* Sur mobile, on réduit un peu */
@media (max-width: 991px) {
    .hero-section .container {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }
    .hero-section .display-4 {
        font-size: 2rem !important;
    }
    .hero-section .lead {
        font-size: 1rem !important;
    }
    .hero-section .btn-lg {
        font-size: 14px !important;
        padding: 10px 18px !important;
    }
}

/* ============================================================
   🎨 CATÉGORIES PREMIUM (PC)
   ============================================================ */
@media (min-width: 992px) {
    /* 1. Les cartes catégories sont plus grandes et plus aérées */
    .card-cat {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        border-radius: 16px !important;
    }
    .card-cat:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.1) !important;
    }

    /* 2. L'icône est plus grande */
    .card-cat .cat-icon {
        width: 50px;
        height: 50px;
        border-radius: 14px;
        background: linear-gradient(135deg, #e7f1ff 0%, #d0e7ff 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #0d6efd;
        flex-shrink: 0;
        transition: background 0.2s;
    }
    .card-cat:hover .cat-icon {
        background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
        color: #fff;
    }

    /* 3. Le texte est plus lisible */
    .card-cat .fw-semibold {
        font-size: 15px !important;
        margin-bottom: 2px;
    }
    .card-cat .text-muted {
        font-size: 12px !important;
    }

    /* 4. Les cartes prennent plus de place */
    .card-cat .card-body {
        padding: 16px !important;
    }
}

/* Sur mobile, on garde le design compact */
@media (max-width: 991px) {
    .card-cat .cat-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: #e7f1ff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #0d6efd;
        flex-shrink: 0;
    }
    .card-cat .fw-semibold {
        font-size: 13px !important;
    }
    .card-cat .text-muted {
        font-size: 10px !important;
    }
}

/* ============================================================
   🛍️ CARTES PRODUITS PREMIUM (PC)
   ============================================================ */
@media (min-width: 992px) {

    /* 1. La carte elle-même */
    .card-produit {
        border-radius: 16px !important;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        overflow: hidden;
        border: 1px solid #f0f0f0 !important;
    }
    .card-produit:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 32px rgba(0,0,0,0.12) !important;
    }

    /* 2. L'image zoome légèrement au survol */
    .card-produit .card-img-top {
        transition: transform 0.4s ease;
        height: 220px !important;
        object-fit: cover;
    }
    .card-produit:hover .card-img-top {
        transform: scale(1.05);
    }

    /* 3. Le corps de la carte est plus aéré */
    .card-produit .card-body {
        padding: 14px !important;
    }

    /* 4. Le titre sur 2 lignes */
    .card-produit .card-title {
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        height: 36px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        margin-bottom: 6px !important;
        color: #222 !important;
    }

    /* 5. Le prix est plus visible */
    .card-produit .prix-fcfa {
        font-size: 16px !important;
        font-weight: 800 !important;
        color: #198754 !important;
    }

    /* 6. Le badge "En stock" est plus discret */
    .card-produit .badge {
        font-size: 10px !important;
        font-weight: 600 !important;
        padding: 4px 8px !important;
        border-radius: 6px !important;
    }

    /* 7. Effet de survol sur le bouton "Voir" (s'il existe) */
    .card-produit .btn-success {
        transition: all 0.2s ease;
    }
    .card-produit:hover .btn-success {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
    }

    /* 8. Les étoiles de notation */
    .card-produit .rating-stars {
        font-size: 12px !important;
    }
}

/* Sur mobile, on garde le design actuel */
@media (max-width: 991px) {
    .card-produit .card-img-top {
        height: 200px !important;
    }
}

/* ============================================================
   🦶 FOOTER PREMIUM
   ============================================================ */
.footer-premium {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #fff;
    border-top: 3px solid #0d6efd;
}
.footer-premium h6 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}
.footer-links a:hover {
    color: #0d6efd;
}
.footer-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: all 0.2s;
}
.footer-social:hover {
    background: #0d6efd;
    color: #fff;
    transform: translateY(-2px);
}
.payment-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sur mobile, le footer est plus compact */
@media (max-width: 991px) {
    .footer-premium .container {
        padding-top: 30px !important;
        padding-bottom: 30px !important;
    }
    .footer-premium h6 {
        font-size: 13px;
        margin-top: 15px;
    }
    .footer-links a {
        font-size: 13px;
    }
    .footer-social {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .payment-badge {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ============================================================
   🖥️ PAGE PRODUITS PC — Sidebar + Grille 4/ligne
   ============================================================ */
@media (min-width: 992px) {
    /* 1. On cache la barre de filtres horizontale sur PC (remplacée par la sidebar) */
    .d-none.d-md-block.mb-4 {
        display: none !important;
    }

    /* 2. On cache le bouton "Filtres et tri" sur PC */
    .d-md-none.sticky-top {
        display: none !important;
    }

    /* 3. La grille de produits passe à 4 par ligne */
    .row.g-3 > .col-6.col-md-4.col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    /* 4. Le titre "Tous les produits" et le compteur sont alignés */
    .d-flex.justify-content-between.align-items-center.mb-3 h1 {
        font-size: 1.5rem !important;
    }

    /* 5. La sidebar a un fond blanc et des ombres */
    .card.sticky-top {
        border-radius: 16px !important;
    }

    /* 6. Les filtres de la sidebar sont aérés */
    .card-body.p-3 .form-label {
        font-size: 11px !important;
        letter-spacing: 0.5px;
    }
    .card-body.p-3 .form-control,
    .card-body.p-3 .form-select {
        font-size: 13px !important;
        border-radius: 8px !important;
    }
    .card-body.p-3 .btn {
        font-size: 13px !important;
    }

    /* 7. Les cartes produits prennent plus de place */
    .row.g-3 > .col-6.col-md-4.col-lg-3 .card-produit {
        border-radius: 14px !important;
    }
}

/* ============================================================
   🖥️ FICHE PRODUIT PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le carrousel est plus grand */
    .carousel-item img {
        height: 500px !important;
        object-fit: contain !important;
        background: #f8f9fa !important;
        border-radius: 16px !important;
    }
    #carouselProduit {
        border-radius: 16px !important;
        overflow: hidden;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
    }

    /* 2. Les miniatures sont plus grandes */
    .miniature-img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 10px !important;
        border: 2px solid transparent !important;
        transition: border-color 0.2s, transform 0.2s !important;
    }
    .miniature-img:hover {
        transform: scale(1.05);
    }
    .miniature-img.active {
        border-color: #0d6efd !important;
    }

    /* 3. Le titre est plus grand */
    .col-md-6 h1.h3 {
        font-size: 1.75rem !important;
        font-weight: 700 !important;
        margin-bottom: 12px !important;
    }

    /* 4. Le prix dans un encadré premium */
    .prix-box {
        background: #f8f9fa !important;
        border-radius: 16px !important;
        padding: 16px 20px !important;
        border: 1px solid #e9ecef !important;
    }
    .prix-box .prix-fcfa {
        font-size: 2rem !important;
        color: #198754 !important;
    }

    /* 5. Le badge vendeur est plus visible */
    .vendor-badge {
        background: #fff !important;
        border: 1px solid #e9ecef !important;
        border-radius: 12px !important;
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* 6. Les boutons d'action sont plus gros */
    .col-md-6 .btn-lg {
        min-height: 52px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
    }

    /* 7. La description dans une carte premium */
    .card.bg-light {
        background: #f8f9fa !important;
        border-radius: 16px !important;
        border: 1px solid #e9ecef !important;
    }
    .card.bg-light .card-body {
        padding: 20px !important;
    }

    /* 8. Les caractéristiques dans une carte */
    .card.bg-light table {
        font-size: 14px !important;
    }
    .card.bg-light table td {
        padding: 8px 4px !important;
    }

    /* 9. Les produits similaires en grille */
    .row.g-3 > .col-6.col-md-4.col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    /* 10. La barre d'achat sticky reste en bas mais plus discrète */
    .mobile-buy-bar {
        display: none !important;
    }

    /* 11. Le stepper n'est pas sur cette page */
    .checkout-stepper {
        display: none !important;
    }
}

/* ============================================================
   🖥️ PANIER PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le fond de la page est gris clair */
    body {
        background-color: #f4f6f8 !important;
    }

    /* 2. Les cartes articles sont plus grandes */
    .cart-item-mobile {
        background: #fff !important;
        border-radius: 16px !important;
        padding: 20px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
        border: 1px solid #f0f0f0 !important;
    }

    /* 3. L'image est plus grande */
    .cart-item-img {
        width: 100px !important;
        height: 100px !important;
        border-radius: 12px !important;
    }

    /* 4. Le titre est plus grand */
    .cart-item-title {
        font-size: 16px !important;
        font-weight: 600 !important;
    }

    /* 5. Le vendeur est plus visible */
    .cart-item-vendor {
        font-size: 11px !important;
        padding: 3px 10px !important;
    }

    /* 6. Le sélecteur de quantité est plus grand */
    .cart-qty button {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    .cart-qty input {
        width: 50px !important;
        height: 40px !important;
        font-size: 16px !important;
    }

    /* 7. Le prix total est plus visible */
    .cart-item-total {
        font-size: 18px !important;
        font-weight: 800 !important;
        color: #0d6efd !important;
    }

    /* 8. Le bouton supprimer est plus discret */
    .cart-item-delete button {
        width: 36px !important;
        height: 36px !important;
    }

    /* 9. Le récapitulatif sticky */
    .col-lg-4 .card.sticky-top {
        background: #fff !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
        border: 1px solid #f0f0f0 !important;
    }
    .col-lg-4 .card-body {
        padding: 24px !important;
    }
    .col-lg-4 .card-body h5 {
        font-size: 1.1rem !important;
    }
    .col-lg-4 .card-body .fs-5 {
        font-size: 1.2rem !important;
    }
    .col-lg-4 .card-body .prix-fcfa {
        font-size: 1.4rem !important;
    }

    /* 10. Le bouton "Passer commande" est plus gros */
    .col-lg-4 .btn-success.btn-lg {
        min-height: 52px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        border-radius: 12px !important;
    }

    /* 11. On cache la barre sticky mobile sur PC (déjà cachée) */
    .panier-sticky-mobile {
        display: none !important;
    }

    /* 12. Le bouton "Continuer mes achats" est plus discret */
    .d-flex.justify-content-between.align-items-center.mt-3 .btn {
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
}

/* ============================================================
   🖥️ PANIER PC — Carte article horizontale
   ============================================================ */
@media (min-width: 992px) {

    /* 1. La carte article est une ligne horizontale */
    .cart-item-mobile {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 16px 20px !important;
        background: #fff !important;
        border-radius: 16px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
        border: 1px solid #f0f0f0 !important;
    }

    /* 2. On annule la structure mobile (top/bottom) sur PC */
    .cart-item-top,
    .cart-item-bottom {
        display: contents !important;
    }

    /* 3. L'image à gauche (100x100) */
    .cart-item-img {
        width: 100px !important;
        height: 100px !important;
        flex-shrink: 0 !important;
        border-radius: 12px !important;
        overflow: hidden !important;
    }
    .cart-item-img img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    /* 4. Les infos au milieu (flex-grow) */
    .cart-item-infos {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
    }
    .cart-item-title {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #222 !important;
        text-decoration: none !important;
        white-space: normal !important;
        overflow: visible !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        -webkit-box-orient: unset !important;
        max-height: none !important;
    }
    .cart-item-vendor {
        font-size: 11px !important;
        padding: 3px 10px !important;
        align-self: flex-start !important;
    }

    /* 5. La quantité à droite */
    .cart-qty-form {
        margin: 0 !important;
        flex-shrink: 0 !important;
    }
    .cart-qty {
        display: flex !important;
        align-items: center !important;
        border: 1.5px solid #dee2e6 !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }
    .cart-qty button {
        width: 36px !important;
        height: 36px !important;
        font-size: 18px !important;
    }
    .cart-qty input {
        width: 40px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    /* 6. Le prix total à droite */
    .cart-item-total {
        font-size: 18px !important;
        font-weight: 800 !important;
        color: #0d6efd !important;
        white-space: nowrap !important;
        min-width: 120px !important;
        text-align: right !important;
    }

    /* 7. Le bouton supprimer à droite */
    .cart-item-delete {
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    .cart-item-delete button {
        width: 36px !important;
        height: 36px !important;
    }
}

/* ============================================================
   🖥️ DASHBOARD VENDEUR PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. L'en-tête vendeur est plus grand */
    .card.border-0.shadow-sm.mb-3[style*="linear-gradient(135deg, #198754"] .card-body {
        padding: 24px !important;
    }
    .card.border-0.shadow-sm.mb-3[style*="linear-gradient(135deg, #198754"] h2 {
        font-size: 1.5rem !important;
    }
    .card.border-0.shadow-sm.mb-3[style*="linear-gradient(135deg, #198754"] img,
    .card.border-0.shadow-sm.mb-3[style*="linear-gradient(135deg, #198754"] .avatar-vendeur {
        width: 80px !important;
        height: 80px !important;
    }
    .card.border-0.shadow-sm.mb-3[style*="linear-gradient(135deg, #198754"] .btn-light {
        width: auto !important;
        padding: 10px 24px !important;
        font-size: 14px !important;
    }

    /* 2. Les stats passent en 4 colonnes */
    .row.g-2.mb-3 > .col-6 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    .stat-card-vendeur {
        padding: 20px !important;
        border-radius: 16px !important;
    }
    .stat-card-vendeur .stat-icon-vendeur {
        width: 56px !important;
        height: 56px !important;
        font-size: 24px !important;
    }
    .stat-card-vendeur .fs-5 {
        font-size: 1.5rem !important;
    }

    /* 3. Les actions rapides passent en ligne (4 boutons) */
    .row.g-2 > .col-4 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    .app-icon-card {
        padding: 16px !important;
        border-radius: 16px !important;
        background: #f8f9fa !important;
        transition: background 0.2s, transform 0.2s;
    }
    .app-icon-card:hover {
        background: #e9ecef !important;
        transform: translateY(-2px);
    }
    .app-icon-card .app-icon-wrapper {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
    }
    .app-icon-card .app-icon-label {
        font-size: 13px !important;
        font-weight: 600 !important;
    }

    /* 4. Les cartes produits/ventes sont plus larges */
    .row.g-3 > .col-12.col-lg-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }

    /* 5. Les tableaux sont plus lisibles */
    .table td, .table th {
        padding: 12px 8px !important;
        font-size: 13px !important;
    }
}

/* ============================================================
   🖥️ MES COMMANDES PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. La carte commande est plus grande et aérée */
    .order-card {
        border-radius: 16px !important;
        border-left-width: 6px !important;
        margin-bottom: 20px !important;
    }
    .order-card .card-body {
        padding: 20px !important;
    }

    /* 2. Le header est plus lisible */
    .order-card .card-header {
        padding: 12px 20px !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    .order-card .card-header .badge {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    .order-card .card-header small {
        font-size: 13px !important;
    }

    /* 3. Les articles sont en grille (pas de scroll horizontal) */
    .order-card .d-flex.gap-2.overflow-auto {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
        gap: 10px !important;
        overflow: visible !important;
        margin-bottom: 16px !important;
    }
    .order-card .d-flex.gap-2.overflow-auto > div {
        width: 100% !important;
        max-width: 80px !important;
    }
    .order-card .d-flex.gap-2.overflow-auto img {
        width: 80px !important;
        height: 80px !important;
        border-radius: 10px !important;
        border: 1px solid #f0f0f0 !important;
    }

    /* 4. Le résumé (nombre d'articles + total) */
    .order-card .d-flex.justify-content-between.align-items-center.mb-2 {
        padding: 12px 0 !important;
        border-top: 1px solid #f0f0f0 !important;
        margin-top: 8px !important;
    }
    .order-card .fw-bold.text-primary.fs-6 {
        font-size: 18px !important;
    }
    .order-card .small.text-muted {
        font-size: 13px !important;
    }

    /* 5. Les boutons d'action en ligne */
    .order-card .d-grid.gap-2.mt-3 {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .order-card .d-grid.gap-2.mt-3 .btn {
        flex: 1 1 auto !important;
        min-width: 150px !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
        border-radius: 10px !important;
    }

    /* 6. Le message d'état */
    .order-card .alert {
        font-size: 13px !important;
        border-radius: 10px !important;
        padding: 10px 14px !important;
    }

    /* 7. Le badge statut dans le header est plus visible */
    .order-card .card-header .badge.bg-primary,
    .order-card .card-header .badge.bg-success,
    .order-card .card-header .badge.bg-warning,
    .order-card .card-header .badge.bg-danger,
    .order-card .card-header .badge.bg-info,
    .order-card .card-header .badge.bg-secondary {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }
}

/* ============================================================
   🖥️ SUIVI DE COMMANDE PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le header de commande est plus grand */
    .bg-gradient-order-customer {
        border-radius: 20px !important;
    }
    .bg-gradient-order-customer .card-body {
        padding: 32px !important;
    }
    .bg-gradient-order-customer h1 {
        font-size: 1.8rem !important;
    }
    .bg-gradient-order-customer .badge {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }
    .bg-gradient-order-customer .fs-3 {
        font-size: 2rem !important;
    }

    /* 2. La timeline est plus grande et lisible */
    .timeline-customer li {
        padding: 16px 0 16px 70px !important;
    }
    .timeline-customer .timeline-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 20px !important;
    }
    .timeline-customer .timeline-content strong {
        font-size: 16px !important;
    }
    .timeline-customer::before {
        left: 24px !important;
    }

    /* 3. Les articles sont en grille (2 colonnes) */
    .col-lg-7 .card .d-flex.align-items-center.mb-3 {
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    .col-lg-7 .card .d-flex.align-items-center.mb-3 img {
        width: 70px !important;
        height: 70px !important;
        border-radius: 12px !important;
    }
    .col-lg-7 .card .d-flex.align-items-center.mb-3 .fw-semibold {
        font-size: 15px !important;
    }
    .col-lg-7 .card .d-flex.align-items-center.mb-3 .fw-bold {
        font-size: 15px !important;
    }

    /* 4. L'adresse et le récap dans des cartes premium */
    .col-lg-5 .card {
        border-radius: 16px !important;
        border: 1px solid #f0f0f0 !important;
    }
    .col-lg-5 .card .card-body {
        padding: 20px !important;
    }
    .col-lg-5 .card h6 {
        font-size: 14px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    /* 5. Le bouton "Retour à mes commandes" plus discret */
    .btn-outline-secondary.btn-sm {
        font-size: 13px !important;
        padding: 8px 16px !important;
        border-radius: 10px !important;
    }

    /* 6. Les alertes (frais à valider, annulation) */
    .alert {
        border-radius: 12px !important;
        font-size: 14px !important;
    }
}

/* ============================================================
   🖥️ BOUTIQUE VENDEUR PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le fond de la page est gris clair */
    body {
        background-color: #f4f6f8 !important;
    }

    /* 2. L'en-tête vendeur est plus grand */
    .bg-gradient-vendeur {
        border-radius: 20px !important;
    }
    .bg-gradient-vendeur .card-body {
        padding: 28px !important;
    }
    .bg-gradient-vendeur img,
    .bg-gradient-vendeur .avatar-vendeur {
        width: 100px !important;
        height: 100px !important;
        border-radius: 20px !important;
    }
    .bg-gradient-vendeur h1 {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }
    .bg-gradient-vendeur .badge {
        font-size: 12px !important;
        padding: 6px 14px !important;
    }
    .bg-gradient-vendeur .text-muted {
        font-size: 13px !important;
    }

    /* 3. Le bouton "Contacter" est plus discret */
    .bg-gradient-vendeur .btn-success {
        width: auto !important;
        padding: 10px 24px !important;
        font-size: 14px !important;
        min-height: 44px !important;
    }

    /* 4. Les stats sont en ligne */
    .bg-gradient-vendeur .row.g-2 > .col-4 {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 140px !important;
    }
    .bg-gradient-vendeur .card {
        background: #fff !important;
        border-radius: 14px !important;
        padding: 12px 16px !important;
    }
    .bg-gradient-vendeur .card i {
        font-size: 20px !important;
    }
    .bg-gradient-vendeur .card .fw-bold {
        font-size: 16px !important;
    }

    /* 5. La grille de produits est à 4 par ligne */
    .row.g-3 > .col-6.col-md-4.col-lg-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }

    /* 6. Les cartes produits ont un effet de survol */
    .card-produit {
        border-radius: 16px !important;
        transition: transform 0.25s ease, box-shadow 0.25s ease;
        border: 1px solid #f0f0f0 !important;
    }
    .card-produit:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 32px rgba(0,0,0,0.12) !important;
    }
    .card-produit .card-img-top {
        height: 220px !important;
        transition: transform 0.4s ease;
    }
    .card-produit:hover .card-img-top {
        transform: scale(1.05);
    }

    /* 7. Le titre "Tous ses produits" */
    .d-flex.justify-content-between.align-items-center.mb-3 h2 {
        font-size: 1.5rem !important;
    }
}

/* ============================================================
   🖥️ PROFIL PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le fond de la page est gris clair */
    body {
        background-color: #f4f6f8 !important;
    }

    /* 2. Le header profil est plus grand */
    .bg-gradient-profil {
        border-radius: 20px !important;
    }
    .bg-gradient-profil .card-body {
        padding: 32px !important;
    }
    .bg-gradient-profil .avatar-profil {
        width: 90px !important;
        height: 90px !important;
        font-size: 36px !important;
    }
    .bg-gradient-profil h1 {
        font-size: 1.8rem !important;
    }

    /* 3. Les stats en 3 colonnes */
    .d-none.d-md-flex.row.g-3 > .col-md-4 {
        flex: 0 0 33.33% !important;
        max-width: 33.33% !important;
    }
    .stat-card-profile {
        border-radius: 16px !important;
    }
    .stat-card-profile .card-body {
        padding: 20px !important;
    }
    .stat-card-profile .stat-icon-profile {
        width: 60px !important;
        height: 60px !important;
        font-size: 26px !important;
    }
    .stat-card-profile .fs-3,
    .stat-card-profile .fs-4 {
        font-size: 1.8rem !important;
    }

    /* 4. Les formulaires (infos + Telegram) côte à côte */
    .row.g-4 > .col-lg-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .col-lg-6 .card {
        border-radius: 16px !important;
    }
    .col-lg-6 .card-body {
        padding: 24px !important;
    }

    /* 5. Les champs de formulaire sont plus grands */
    .col-lg-6 .form-control {
        min-height: 44px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }
    .col-lg-6 .form-label {
        font-size: 13px !important;
    }

    /* 6. Le bouton "Enregistrer" plus visible */
    .col-lg-6 .btn-primary {
        min-height: 48px !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }

    /* 7. Les étapes Telegram plus lisibles */
    .telegram-steps .step-item {
        font-size: 14px !important;
    }
    .telegram-steps .step-num {
        width: 28px !important;
        height: 28px !important;
        font-size: 13px !important;
    }

    /* 8. La grille d'icônes sur PC (cachée sur mobile, visible sur PC) */
    .d-none.d-md-flex.row.g-3 {
        display: flex !important;
    }
}

/* ============================================================
   🖥️ DASHBOARD CLIENT PC — Design premium
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le fond de la page est gris clair */
    body {
        background-color: #f4f6f8 !important;
    }

    /* 2. Le header dashboard est plus grand */
    .bg-gradient-dashboard {
        border-radius: 20px !important;
    }
    .bg-gradient-dashboard .card-body {
        padding: 28px !important;
    }
    .bg-gradient-dashboard .avatar-dashboard {
        width: 70px !important;
        height: 70px !important;
        font-size: 28px !important;
    }
    .bg-gradient-dashboard h5 {
        font-size: 1.5rem !important;
    }

    /* 3. Les stats passent en 4 colonnes */
    .row.g-2.mb-3 > .col-6 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    .row.g-2.mb-3 > .col-6 .card {
        border-radius: 16px !important;
        padding: 20px !important;
    }
    .row.g-2.mb-3 > .col-6 .stat-icon {
        width: 56px !important;
        height: 56px !important;
        font-size: 24px !important;
    }
    .row.g-2.mb-3 > .col-6 .fs-5 {
        font-size: 1.5rem !important;
    }

    /* 4. Les actions rapides passent en ligne (8 boutons) */
    .row.g-2.mb-4 > .col-3 {
        flex: 0 0 12.5% !important;
        max-width: 12.5% !important;
    }
    .app-icon-card {
        padding: 16px !important;
        border-radius: 16px !important;
        background: #f8f9fa !important;
        transition: background 0.2s, transform 0.2s;
    }
    .app-icon-card:hover {
        background: #e9ecef !important;
        transform: translateY(-2px);
    }
    .app-icon-card .app-icon-wrapper {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
    }
    .app-icon-card .app-icon-label {
        font-size: 12px !important;
        font-weight: 600 !important;
    }

    /* 5. Les cartes "Dernières commandes" sont plus grandes */
    .row.g-3 > .col-12.col-lg-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    .card.border-0.shadow-sm {
        border-radius: 16px !important;
    }
    .card.border-0.shadow-sm .card-body {
        padding: 20px !important;
    }

    /* 6. Le bouton "Mon espace" (profil) est plus discret */
    .bg-gradient-dashboard .btn-light {
        width: 50px !important;
        height: 50px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ============================================================
   🖥️ DASHBOARD CLIENT PC — Correctif
   ============================================================ */
@media (min-width: 992px) {

    /* 1. Le bouton "Mon profil" est plus grand */
    .bg-gradient-dashboard .btn-light {
        width: auto !important;
        height: auto !important;
        padding: 10px 20px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
    }
    .bg-gradient-dashboard .btn-light i {
        font-size: 18px !important;
    }

    /* 2. Les actions rapides passent en grille 4 par ligne */
    .row.g-2.mb-4 {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
    .row.g-2.mb-4 > .col-3 {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    .app-icon-card {
        padding: 16px !important;
        border-radius: 16px !important;
        background: #f8f9fa !important;
        text-align: center !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        transition: background 0.2s, transform 0.2s;
    }
    .app-icon-card:hover {
        background: #e9ecef !important;
        transform: translateY(-2px);
    }
    .app-icon-card .app-icon-wrapper {
        width: 48px !important;
        height: 48px !important;
        font-size: 22px !important;
    }
    .app-icon-card .app-icon-label {
        font-size: 13px !important;
        font-weight: 600 !important;
        margin-top: 8px !important;
    }

    /* 3. Les 2 colonnes (commandes + actions) */
    .row.g-3 > .col-12.col-lg-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* ============================================================
   🚑 FIX PAGE PRODUITS MOBILE — Grille visible
   ============================================================ */
@media (max-width: 991px) {
    /* 1. La colonne de la grille prend 100% sur mobile */
    .col-lg-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 2. La row parente ne doit pas cacher la grille */
    .row.g-4 > .col-lg-9 {
        display: block !important;
    }

    /* 3. On s'assure que la grille est visible */
    .row.g-3 {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* 4. On s'assure que les colonnes produits sont visibles */
    .row.g-3 > .col-6 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 5. La sidebar PC est bien cachée sur mobile */
    .d-none.d-lg-block {
        display: none !important;
    }
}

/* ============================================================
   🚑 FIX PAGE PRODUITS MOBILE — Grille visible
   ============================================================ */
@media (max-width: 991px) {
    /* 1. La colonne de la grille prend 100% sur mobile */
    .col-lg-9 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        display: block !important;
    }

    /* 2. La row parente doit être un block */
    .row.g-4 {
        display: block !important;
    }

    /* 3. La grille de produits doit être visible */
    .row.g-3 {
        display: flex !important;
        flex-wrap: wrap !important;
    }

    /* 4. Les colonnes produits doivent être visibles */
    .row.g-3 > .col-6 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 5. On cache bien la sidebar PC */
    .d-none.d-lg-block {
        display: none !important;
    }
}

/* ============================================================
   🚑 FIX NOUVEAU PRODUIT VENDEUR — Haute spécificité
   ============================================================ */
@media (max-width: 991px) {
    /* On cible le formulaire d'ajout de produit par son enctype */
    form[enctype="multipart/form-data"] .col-lg-8,
    form[enctype="multipart/form-data"] .col-lg-4,
    form[enctype="multipart/form-data"] .col-md-8,
    form[enctype="multipart/form-data"] .col-md-4,
    form[enctype="multipart/form-data"] .col-md-6,
    form[enctype="multipart/form-data"] .col-md-3,
    form[enctype="multipart/form-data"] .col-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    /* Cartes */
    form[enctype="multipart/form-data"] .card {
        border-radius: 16px !important;
        margin-bottom: 12px !important;
    }
    form[enctype="multipart/form-data"] .card-body {
        padding: 16px !important;
    }

    /* Champs de formulaire */
    form[enctype="multipart/form-data"] .form-control,
    form[enctype="multipart/form-data"] .form-select,
    form[enctype="multipart/form-data"] textarea {
        min-height: 44px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
        width: 100% !important;
    }

    /* Labels */
    form[enctype="multipart/form-data"] .form-label {
        font-size: 14px !important;
        font-weight: 600 !important;
    }

    /* Boutons */
    form[enctype="multipart/form-data"] .btn.btn-success.btn-lg,
    form[enctype="multipart/form-data"] .btn.btn-primary.btn-lg {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 15px !important;
    }

    /* Le header vendeur */
    .bg-gradient-seller-form .card-body {
        padding: 16px !important;
    }
    .bg-gradient-seller-form h1 {
        font-size: 1.2rem !important;
    }

    /* La zone d'upload d'images */
    form[enctype="multipart/form-data"] input[type="file"] {
        width: 100% !important;
        min-height: 44px !important;
        padding: 10px !important;
    }
}

/* ============================================================
   🚑 FIX CARTE IMAGES — Retirer sticky-top sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* On retire le sticky-top de la carte Images sur mobile */
    .card.sticky-top {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }

    /* On s'assure que la carte Images est visible */
    .col-lg-4 .card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* On force l'affichage de l'input file */
    input[type="file"]#imagesInput {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 44px !important;
    }
}

/* ============================================================
   🚑 FIX CARTE IMAGES — Mobile (retirer sticky-top)
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On retire le sticky-top de la carte Images sur mobile */
    .col-lg-4 .card.sticky-top {
        position: static !important;
        top: auto !important;
        z-index: auto !important;
    }

    /* 2. On s'assure que la colonne Images est visible */
    .col-lg-4 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* 3. On s'assure que la carte Images est visible */
    .col-lg-4 .card {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-bottom: 12px !important;
    }

    /* 4. On force l'affichage de l'input file */
    input[type="file"]#imagesInput {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 44px !important;
    }
}

/* ============================================================
   🚑 FIX CARTE IMAGES — Visible sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* On cible la carte qui contient "Images du produit" */
    .card:has(h6 .bi-images) {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        margin-bottom: 12px !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* On cible l'input file */
    input[type="file"]#imagesInput {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 44px !important;
        position: static !important;
    }

    /* On retire le sticky-top sur mobile */
    .sticky-top {
        position: static !important;
        top: auto !important;
    }
}

/* ============================================================
   🚑 FIX DÉFINITIF — Carte Images visible sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* 1. On cible la colonne de droite (Images + Commission) */
    .col-lg-4 {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-top: 20px !important;
    }

    /* 2. On cible la carte Images spécifiquement */
    .col-lg-4 > .card.sticky-top {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        top: auto !important;
        z-index: auto !important;
        margin-bottom: 16px !important;
        border: 2px solid #198754 !important; /* Bordure verte pour la repérer */
    }

    /* 3. On force l'affichage de l'input file */
    #imagesInput {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 44px !important;
        padding: 10px !important;
        border: 2px dashed #198754 !important;
        border-radius: 10px !important;
        background: #f0fff4 !important;
    }

    /* 4. On s'assure que le parent ne cache rien */
    .col-lg-4 * {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ============================================================
   🚑 FIX RADICAL — Forcer le container à 100% sur mobile
   ============================================================ */
@media (max-width: 991px) {
    /* On force TOUS les containers (peu importe la page) à 100% */
    .container,
    .container-sm,
    .container-md,
    .container-lg,
    .container-xl,
    .container-fluid {
        width: 100vw !important;
        max-width: 100vw !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* On force le body et le main à 100% */
    body, main {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* On force les colonnes à 100% */
    .col-12, .col-md-5, .col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* ============================================================
   🛍️ MES PRODUITS VENDEUR — Boutons d'action
   ============================================================ */
@media (max-width: 991px) {
    .card-body .d-flex.gap-1 {
        flex-wrap: wrap;
    }
    .card-body .d-flex.gap-1 form:first-child {
        flex: 1 1 100% !important;
        margin-bottom: 4px;
    }
    .card-body .d-flex.gap-1 form:last-child {
        flex: 0 0 auto !important;
    }
}

/* ============================================================
   🚑 FIX RÉCAPITULATIF COMMANDE MOBILE — Affichage du détail
   ============================================================ */
@media (max-width: 991px) {
    /* On cible la row du récapitulatif (celle qui contient le formulaire et "Ma commande") */
    .row.g-4 {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: stretch !important;
    }

    /* On force les colonnes à s'empiler */
    .row.g-4 > .col-lg-7,
    .row.g-4 > .col-lg-5 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        display: block !important;
    }

    /* On force la carte "Ma commande" à s'afficher */
    .row.g-4 > .col-lg-5 .card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px !important;
    }

    /* On force le bouton à prendre 100% */
    .row.g-4 > .col-lg-5 .card .btn {
        width: 100% !important;
    }
}
