/* =====================================================================
   Responsive mobile / tablette — chargé en dernier, uniquement < 861 px.
   Aucun effet sur l'affichage ordinateur.
   ===================================================================== */
@media (max-width:860px){
  /* --- En-tête : une ligne (menu, logo, compte, panier, devis) + recherche --- */
  .a4r-header .a4r-container.a4r-header-grid{display:grid!important;grid-template-columns:auto auto 1fr auto;grid-template-areas:"burger logo . actions" "search search search search";align-items:center!important;gap:8px 8px!important;padding:8px 16px 10px!important;height:auto!important}
  .a4r-header-stack,.a4r-header-inner{display:contents!important}
  .a4r-burger{grid-area:burger;display:flex!important;align-items:center;justify-content:center;width:40px;height:40px;padding:0!important;margin:0 -4px 0 -6px}
  .a4r-logo{grid-area:logo;margin:0!important;padding:0!important;max-width:none!important;border:0!important;box-shadow:none!important;background:transparent!important;align-self:center!important}
  .a4r-logo::before,.a4r-logo::after{display:none!important}
  .a4r-logo a,.a4r-logo .custom-logo-link{border:0!important;box-shadow:none!important}
  .a4r-logo img,.a4r-logo .custom-logo{height:46px!important;max-height:46px!important;width:auto!important;max-width:110px!important;border:0!important}
  .a4r-header-actions{grid-area:actions;display:flex!important;align-items:center;gap:4px!important;margin:0!important}
  .a4r-header-actions .a4r-action{padding:6px!important;min-width:0}
  .a4r-header-actions .a4r-action span{display:none!important}
  .a4r-header-actions .a4r-action i{font-size:22px}
  .a4r-header-actions .a4r-btn{padding:8px 12px!important;font-size:14px!important;min-height:0!important}
  .a4r-header-actions .a4r-pilotage-btn{display:none!important}
  .a4r-search{grid-area:search;width:100%!important;max-width:none!important;margin:0!important}
  .a4r-mainnav{display:none!important}
  .a4r-header::after{display:none!important}

  /* --- Accueil : hero plus compact, sans le visuel écrasé à droite --- */
  .a4r-hero{padding-top:28px!important;padding-bottom:36px!important;min-height:0!important}
  .a4r-hero-inner{grid-template-columns:1fr!important;padding-top:0!important;padding-bottom:0!important;gap:0!important}
  .a4r-hero-visual{display:none!important}

  /* --- Bouton « Une question ? » : pastille compacte --- */
  .a4r-logo img,.a4r-logo .custom-logo{height:52px!important;max-height:52px!important}

  /* --- Bouton « Une question ? » : onglet vertical sur le bord droit (ne masque plus les boutons du bas) --- */
  #a4r-chat{right:0!important;left:auto!important;bottom:auto!important;top:58%!important}
  .a4r-chat-launch{writing-mode:vertical-rl;transform:rotate(180deg);border-radius:0 12px 12px 0!important;padding:12px 7px!important;font-size:12px!important;gap:6px!important;box-shadow:0 4px 14px rgba(0,0,0,.15)!important;border-right:0!important}
  .a4r-chat-panel{position:fixed!important;left:3vw!important;right:3vw!important;width:auto!important;bottom:14px!important;top:auto!important;max-height:72vh!important}

  /* --- Contenu : jamais plus large que l'écran --- */
  .a4r-container{padding-left:16px!important;padding-right:16px!important}
  .a4r-steps-main,.a4r-shop-table-wrap,.a4r-cmp,.a4r-shop-bar{max-width:100%!important;box-sizing:border-box}
  img,video{max-width:100%;height:auto}

  /* --- Fil d'ariane + étapes --- */
  .a4r-steps-layout{display:block!important}
  .a4r-steps-main{min-width:0;width:100%}
  .a4r-lprev{display:none!important}

  /* --- Liste produits : tableau -> cartes --- */
  .a4r-shop-table-wrap{overflow:visible!important;border:0!important;background:transparent!important}
  .a4r-shop-table,.a4r-shop-table tbody{display:block!important;width:100%!important}
  .a4r-shop-table thead{display:none!important}
  .a4r-shop-table tr.a4r-strow{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name name" "meta meta" "price cta";width:100%;box-sizing:border-box;gap:8px 12px;align-items:center;background:#fff;border:1px solid #ebebe6;border-radius:14px;padding:12px 14px;margin:0 0 10px}
  .a4r-shop-table tr.a4r-strow td{display:block!important;padding:0!important;border:0!important;background:none!important}
  .a4r-shop-table td.a4r-st-name{grid-area:name}
  .a4r-shop-table td.a4r-st-name a{display:flex;gap:12px;align-items:flex-start}
  .a4r-shop-table td.a4r-st-name img{width:64px!important;height:64px!important;flex:none;object-fit:contain;border-radius:8px;background:#fff;border:1px solid #f0f0ea}
  .a4r-st-text{min-width:0}
  .a4r-st-title{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
  .a4r-shop-table tr.a4r-strow td{min-width:0}
  .a4r-shop-table td.a4r-st-fmts{grid-area:meta;justify-self:start;font-size:12.5px;color:#5b6684}
  .a4r-shop-table td.a4r-st-fins{grid-area:meta;justify-self:end;font-size:12.5px;color:#5b6684;text-align:right}
  .a4r-st-login,.a4r-st-quote{white-space:normal!important;font-size:12.5px!important;line-height:1.3}
  .a4r-shop-table td.a4r-st-cta .a4r-btn{white-space:nowrap}
  .a4r-shop-table td.a4r-th-price{grid-area:price;text-align:left!important}
  .a4r-shop-table td.a4r-st-cta{grid-area:cta;text-align:right}
  .a4r-st-units{text-align:left!important;align-items:flex-start!important}
  .a4r-shop-bar{flex-wrap:wrap;gap:8px}
  .a4r-chosen-fmt{flex-wrap:wrap}

  /* --- Bloc Gamme professionnelle --- */
  .a4r-b2b{grid-template-columns:1fr!important;padding:22px 18px!important;gap:18px!important}
  .a4r-b2b--fam .a4r-b2b-visual{margin:0 auto!important;max-width:240px!important}

  /* --- Fiche produit --- */
  .a4r-product--compact{display:block!important}
  .a4r-product-media .woocommerce-product-gallery{position:static!important}
  .a4r-product-media .a4r-sheet-photo .woocommerce-product-gallery__image{aspect-ratio:auto!important;padding:10px!important}
  .a4r-product-media .a4r-sheet-photo .woocommerce-product-gallery__image img{max-width:min(100%,320px)!important}
  .a4r-qty-cards{grid-template-columns:1fr 1fr!important;gap:8px!important}
  .a4r-qty-card{padding:10px 12px!important}
  .a4r-qty-price,.a4r-price-login{font-size:13px!important;line-height:1.3!important}
  .a4r-qty-num{font-size:17px!important}

  /* --- Commande (fiche) : étapes --- */
  .a4r-ov-grid{grid-template-columns:minmax(0,1fr)!important}

  /* --- Tableaux du compte : défilement horizontal propre --- */
  .a4r-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media (max-width:420px){
  .a4r-header-actions .a4r-btn{padding:7px 10px!important;font-size:13px!important}
  .a4r-qty-cards{grid-template-columns:1fr 1fr!important}
  .a4r-shop-table td.a4r-st-name img{width:54px!important;height:54px!important}
}

.a4r-chat-badge[hidden]{display:none!important}
