/* =====================================================================
   AFFICHAGE MOBILE ADAPTATIF - telephones (ecrans de 640 px et moins)
   Feuille ADDITIONNELLE : elle ne modifie aucun de vos CSS. Pour la desactiver :
   MJ_MOBILE_ADAPTATIF a false dans popup.php, ou supprimer ce fichier.
   Les selecteurs commencent par « html body » : ils passent devant les regles de
   meme force declarees plus loin dans la page (CSS integre du menu mobile...).
   Cause d'origine : #conteneur, .header et #centre avaient min-width: 640px (sans
   media query) et la grille des listes etait faite de cartes fixes de 250 px.
   ===================================================================== */
@media (max-width: 640px) {

    /* 1. La page ne peut plus etre plus large que l'ecran */
    html body #conteneur,
    html body .header,
    html body #centre { min-width: 0 !important; max-width: 100% !important; }
    html body img,
    html body video,
    html body iframe { max-width: 100%; }

    /* 2. Bandeau du haut : le texte long est coupe proprement au lieu de pousser la page */
    html body #barre_haut,
    html body #top-bar-dynamic-link { min-width: 0 !important; max-width: 100% !important; }
    html body #top-bar-dynamic-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; font-size: clamp(8.5px, 2.8vw, 11.5px) !important; letter-spacing: 0 !important; }

    /* 3. Pied de page : les liens passent a la ligne */
    html body .footer-links-row ul { flex-wrap: wrap !important; justify-content: center !important; gap: 8px 16px !important; }
    html body .footer-links-row li { white-space: normal !important; }

    /* 4. En-tete mobile : menu, logo et 3 icones tiennent dans l'ecran des petits telephones (320 a 360 px) */
    html body header.nav-top { padding-left: 10px !important; padding-right: 10px !important; }
    html body header.nav-top #header_left,
    html body header.nav-top #header_right { width: auto !important; min-width: 0 !important; flex: 0 0 auto !important; }
    html body header.nav-top #header_center { width: auto !important; min-width: 0 !important; flex: 1 1 auto !important; }
    html body header.nav-top #header_right { gap: 6px !important; }

    /* 5. Filtres : les deux menus deroulants se partagent la largeur de l'ecran (largeur minimale fixe de 185 px avant) */
    html body .filter-container,
    html body #filtre { max-width: 100% !important; }
    html body .filter-form,
    html body .custom-dropdown,
    html body .dropdown-trigger { min-width: 0 !important; }

    /* 6. LISTES D'ARTICLES : 2 colonnes qui se partagent la largeur de l'ecran (au lieu de cartes fixes de 250 px) */
    html body .liste_articles > table,
    html body #main_table { width: 100% !important; max-width: 100% !important; border-spacing: 8px 12px !important; table-layout: auto !important; margin: 0 auto !important; }
    html body #main_table td { width: 50% !important; }
    html body .vignetteArticle_v_150 { width: 100% !important; max-width: 100% !important; height: auto !important; min-height: 0 !important; padding: 8px !important; }
    html body .vignetteImage { width: 100% !important; height: auto !important; aspect-ratio: 1 / 1; }
    html body .vignetteImage img { max-width: 100% !important; max-height: 100% !important; }
    html body .vignette300_indisponible { top: 8px !important; left: 8px !important; width: calc(100% - 16px) !important; height: auto !important; aspect-ratio: 1 / 1; font-size: 13px !important; }
    html body .titre_vignette { font-size: 12px !important; height: 32px !important; }
    html body .vignettePrix { min-height: 0 !important; }
    html body .vignettePrix > div:not(.taille_select):not(.grc-category-stars):not(.prixPromo),
    html body .vignettePrix form.front_add_to_cart > div:not(.taille_select),
    html body .vignettePrix .prixGeneral { gap: 6px !important; flex-wrap: wrap !important; }
    html body .vignette_prix { font-size: 1.05em !important; }
    html body .vignettePrixPromo { font-size: 10px !important; margin-right: 3px !important; }
    html body .vignettePrix .taille_select select { font-size: 13px !important; height: 30px !important; }
}