/* Weby 2.8.5-RC5 — cartes Theme X compactes sur mobile.
   Aucune modification des formulaires, prix, paniers ou tailles desktop. */
@media (max-width: 720px) {
 body.weby-visual-x .woocommerce ul.products li.product {
   background:#fff; border-radius:14px; overflow:hidden;
   display:flex; flex-direction:column; min-width:0;
 }
 /* Le rail horizontal conserve son défilement et ses largeurs définies. */
 body.weby-visual-x .woocommerce ul.products li.product > a.woocommerce-LoopProduct-link {
   display:flex; flex:1 1 auto; flex-direction:column; min-width:0;
 }
 body.weby-visual-x .woocommerce ul.products li.product a img:not(.emoji){
   width:100%!important;aspect-ratio:1/1!important;object-fit:contain!important;
   padding:7px!important;margin:0!important;box-sizing:border-box!important;
 }
 body.weby-visual-x .woocommerce ul.products li.product .woocommerce-loop-product__title {
   font-size:var(--sw-product-title-mobile-size,13px)!important;
   line-height:1.3!important; padding:8px 10px 0!important;
   margin:0!important; min-height:calc(2 * 1.3em);
   display:-webkit-box!important;-webkit-box-orient:vertical!important;
   -webkit-line-clamp:2!important;overflow:hidden!important;
   white-space:normal!important;overflow-wrap:anywhere!important;
 }
 body.weby-visual-x .woocommerce ul.products li.product .price {
   font-size:var(--sw-product-price-mobile-size,15px)!important;
   line-height:1.3!important;padding:7px 10px 10px!important;
   margin-top:auto!important;margin-bottom:0!important;
   min-height:42px;align-content:center;
 }
 body.weby-visual-x .woocommerce ul.products li.product .price del{font-size:0.76em!important}
 body.weby-visual-x .woocommerce ul.products li.product :is(.button,.shopini-quick-buy,.shopini-btn--secondary){
   box-sizing:border-box!important;width:calc(100% - 20px)!important;
   max-width:calc(100% - 20px)!important;min-height:36px!important;
   margin:0 10px 7px!important;padding:7px 5px!important;
   font-size:12px!important;line-height:1.15!important;
   text-align:center!important;justify-content:center!important;
   align-items:center!important;white-space:normal!important;
   border-radius:8px!important;overflow-wrap:normal!important;
 }
 body.weby-visual-x .woocommerce ul.products li.product > :is(.shopini-quick-buy,.shopini-btn--secondary):last-child,
 body.weby-visual-x .woocommerce ul.products li.product > .button:last-child {
   margin-bottom:10px!important;
 }
 body.weby-visual-x .woocommerce ul.products li.product .onsale {
   top:8px!important;left:8px!important;padding:3px 7px!important;
   font-size:11px!important;line-height:1.2!important;
 }
 /* Même respiration pour l'accueil et les archives, sans toucher aux colonnes choisies. */
 body.weby-visual-x .woocommerce ul.products {row-gap:10px;column-gap:10px}
}

/* RC8 — Theme X : les deux curseurs pilotent les grilles et rails réels. */
@media (max-width:720px) {
  /* Catalogue WooCommerce : largeur réellement disponible ajustée par les marges. */
  body.weby-visual-x .woocommerce ul.products:not(.slick-slider):not(.swiper-wrapper):not(.swiper),
  body.weby-visual-x .shopini-post-grid {
    column-gap:var(--weby-mobile-card-gap,8px)!important;
    margin-left:var(--weby-mobile-card-side-padding,8px)!important;
    margin-right:var(--weby-mobile-card-side-padding,8px)!important;
    width:calc(100% - (2 * var(--weby-mobile-card-side-padding,8px)))!important;
    padding-left:0!important;
    padding-right:0!important;
    box-sizing:border-box!important;
    min-width:0;
  }
  body.weby-visual-x .woocommerce ul.products li.product {min-width:0;max-width:100%;}

  /* L'accueil Theme X utilise des rails flex à largeur imposée (pas une grid).
     Adapter leurs tailles à la place du calcul fixe de main.css. */
  body.weby-visual-x .shopini-category-rail__scroller ul.products,
  body.weby-visual-x .shopini-category-rail__scroller .woocommerce ul.products {
    display:flex!important;
    flex-wrap:nowrap!important;
    width:calc(100% - (2 * var(--weby-mobile-card-side-padding,8px)))!important;
    gap:var(--weby-mobile-card-gap,8px)!important;
    column-gap:var(--weby-mobile-card-gap,8px)!important;
  }
  body.weby-visual-x .shopini-category-rail__scroller ul.products li.product,
  body.weby-visual-x .shopini-category-rail__scroller .woocommerce ul.products li.product {
    flex:0 0 calc((100% - ((var(--sw-rail-mobile-visible,2.5) - 1) * var(--weby-mobile-card-gap,8px))) / var(--sw-rail-mobile-visible,2.5))!important;
    width:auto!important;
    max-width:none!important;
  }
}
