/*
 * BAXARA Platform V5 — Sprint 3.3M.1 Mobile Polish & Conversion
 * Version 5.9.1
 * Finalisation mobile: débordements, catalogue, cartes, drawer et conversion.
 */

@media (max-width: 780px){
  :root{--bxv5-mobile-bar:64px}

  /* 1. Trust strip : aucune carte partiellement coincée hors viewport */
  .bxv586-trust{background:#fff!important;border-bottom:1px solid #e4ecf3!important}
  .bxv586-trust__grid{
    padding:0 12px!important;
    gap:10px!important;
    scroll-padding-inline:12px!important;
    overscroll-behavior-inline:contain!important;
  }
  .bxv586-trust__grid article{
    min-width:calc(100vw - 52px)!important;
    max-width:calc(100vw - 52px)!important;
    padding:14px 10px!important;
    border-right:0!important;
  }

  /* 2. Univers : titre/CTA restent lisibles, cartes moins hautes */
  .bxv586-section-heading,.bxv587-section-heading{align-items:flex-end!important;gap:12px!important}
  .bxv586-section-heading>a,.bxv587-section-heading>a{font-size:12px!important;line-height:1.25!important;max-width:120px!important;text-align:right!important;flex:0 0 auto!important}
  .bxv586-universes__grid article{min-height:205px!important;padding:20px!important}

  /* 3. Catalogue : navigation catégories propre et entièrement scrollable */
  .bxv56r-category-navigation{top:64px!important;padding:0!important;overflow:hidden!important}
  .bxv56r-category-navigation .bxv5-container{width:100%!important;padding:28px 14px 18px!important}
  .bxv56r-category-navigation .bxv56r-section-heading{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:12px!important;align-items:end!important;margin-bottom:18px!important}
  .bxv56r-category-navigation .bxv56r-section-heading h2{font-size:32px!important;line-height:1.05!important;margin:5px 0 0!important}
  .bxv56r-category-navigation .bxv56r-section-heading>a{font-size:11px!important;line-height:1.2!important;max-width:90px!important;text-align:left!important;padding-bottom:3px!important}
  .bxv56r-category-navigation__track{
    margin:0 -14px!important;
    padding:0 14px 12px!important;
    gap:8px!important;
    scroll-padding-inline:14px!important;
    overscroll-behavior-inline:contain!important;
  }
  .bxv56r-category-navigation__track a{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:185px!important;
    max-width:230px!important;
    min-height:76px!important;
    padding:12px 14px!important;
    border-radius:13px!important;
  }

  /* 4. Barre catalogue : count + filtre + tri ne se chevauchent plus */
  .bxv56r-catalog-main{padding-top:18px!important}
  .bxv56r-catalog-toolbar{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:12px!important;
    border-radius:16px!important;
    overflow:visible!important;
  }
  .bxv56r-catalog-toolbar__count{font-size:12px!important;line-height:1.35!important;width:100%!important}
  .bxv56r-catalog-toolbar__search{display:none!important}
  .bxv56r-catalog-toolbar__actions{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    gap:8px!important;
    width:100%!important;
    align-items:center!important;
  }
  .bxv56r-filter-toggle{min-height:44px!important;padding:0 18px!important;border-radius:11px!important;white-space:nowrap!important}
  .bxv56r-catalog-toolbar__actions .woocommerce-ordering{margin:0!important;min-width:0!important;width:100%!important}
  .bxv56r-catalog-toolbar__actions .woocommerce-ordering select{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:44px!important;
    border-radius:11px!important;
    padding:0 34px 0 11px!important;
    font-size:13px!important;
    text-overflow:ellipsis!important;
  }

  /* 5. Cartes catalogue : moins de scroll, infos/CTA plus vite visibles */
  .bxv56r-catalog-results .products,.woocommerce ul.products{gap:12px!important}
  .bxv57a-product-card{border-radius:16px!important}
  .bxv57a-product-card__image{
    aspect-ratio:auto!important;
    height:250px!important;
    padding:12px!important;
  }
  .bxv57a-product-card__image img{width:100%!important;height:100%!important;object-fit:contain!important}
  .bxv57a-product-card__content{padding:13px 14px 14px!important}
  .bxv57a-product-card__content h2,.bxv57a-product-card__title{font-size:17px!important;line-height:1.25!important;margin:7px 0 8px!important}
  .bxv57a-product-card__badges{gap:5px!important;margin-bottom:7px!important}
  .bxv57a-product-card__badges>*{font-size:9px!important;padding:5px 7px!important}
  .bxv57a-product-card__specs{display:none!important}
  .bxv57a-product-card__compatible{display:none!important}
  .bxv57a-product-card__actions{gap:7px!important;margin-top:9px!important}
  .bxv57a-product-card__actions>a:not(.bxv5-button){font-size:12px!important}
  .bxv57a-product-card .bxv5-button{min-height:45px!important;font-size:14px!important;border-radius:9px!important}

  /* 6. Homepage produits : même compacité sans casser le carrousel */
  .bxv586-products .bxv57a-product-card__image,.bxv587-products .bxv57a-product-card__image{height:245px!important}

  /* 7. Parcours commercial : cartes plus compactes */
  .bxv586-commercial-path__steps article{min-width:82vw!important;padding:20px!important;min-height:158px!important}

  /* 8. Drawer : deux CTA explicites, conversion immédiate */
  .bxv5-mobile-drawer__actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important;margin-top:14px!important}
  .bxv5-mobile-drawer__actions .bxv5-button{min-height:50px!important;padding:10px 8px!important;justify-content:center!important;text-align:center!important;font-size:13px!important;font-weight:900!important}
  .bxv5-mobile-drawer__actions .is-whatsapp{background:#fff!important;color:#149c2d!important;border:1px solid #24bd3d!important}
  .bxv5-mobile-drawer__actions .is-quote{background:#31c92f!important;color:#03264b!important;border:1px solid #31c92f!important}

  /* 9. Bottom bar : compacte et sûre avec safe-area */
  .bxv590-mobile-bottom{height:calc(64px + env(safe-area-inset-bottom))!important;padding:4px 4px env(safe-area-inset-bottom)!important}
  .bxv590-mobile-bottom a,.bxv590-mobile-bottom button{font-size:8.5px!important;gap:1px!important}
  .bxv590-mobile-bottom .bxv590-icon{font-size:17px!important}
}

@media (max-width: 390px){
  .bxv586-trust__grid article{min-width:calc(100vw - 42px)!important;max-width:calc(100vw - 42px)!important}
  .bxv56r-category-navigation__track a{min-width:170px!important;max-width:205px!important}
  .bxv57a-product-card__image{height:225px!important}
  .bxv5-mobile-drawer__actions{grid-template-columns:1fr!important}
}

@media (min-width: 781px){
  .bxv5-mobile-drawer__actions{display:none!important}
}
