.elementor-kit-10{--e-global-color-primary:#FFFFFF;--e-global-color-secondary:#54595F;--e-global-color-text:#33261D;--e-global-color-accent:#61CE70;--e-global-typography-primary-font-family:"Roboto";--e-global-typography-primary-font-weight:600;--e-global-typography-secondary-font-family:"Roboto Slab";--e-global-typography-secondary-font-weight:400;--e-global-typography-text-font-family:"Roboto";--e-global-typography-text-font-weight:400;--e-global-typography-accent-font-family:"Roboto";--e-global-typography-accent-font-weight:500;}.elementor-kit-10 e-page-transition{background-color:#FFBC7D;}.elementor-section.elementor-section-boxed > .elementor-container{max-width:1140px;}.e-con{--container-max-width:1140px;}.elementor-widget:not(:last-child){--kit-widget-spacing:20px;}.elementor-element{--widgets-spacing:20px 20px;--widgets-spacing-row:20px;--widgets-spacing-column:20px;}{}h1.entry-title{display:var(--page-title-display);}.site-header .site-branding{flex-direction:column;align-items:stretch;}.site-header{padding-inline-end:0px;padding-inline-start:0px;}.site-footer .site-branding{flex-direction:column;align-items:stretch;}@media(max-width:1024px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:1024px;}.e-con{--container-max-width:1024px;}}@media(max-width:767px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:767px;}.e-con{--container-max-width:767px;}}
/* Start custom CSS */<script>
/* KERWINE — Fiche produit : Format en PASTILLES + quantité −/+ + achat direct.
   Version robuste : réessaie et observe le DOM jusqu'à ce que le formulaire existe.
   À coller dans : Elementor → Réglages du site → Custom Code → Ajouter
   Emplacement : </body> – Fin   (et vérifie qu'il est PUBLIÉ + condition sur tout le site) */
jQuery(function ($) {
 
  function buildPills($form) {
    $form.find('.variations select').each(function () {
      var $sel = $(this);
      if ($sel.data('kwPills')) return;
      $sel.data('kwPills', true);
 
      var $wrap = $('<div class="kw-pills"></div>');
      $sel.find('option').each(function () {
        var val = $(this).val();
        if (!val) return; // ignore « Choisir une option »
        var $pill = $('<button type="button" class="kw-pill"></button>')
          .text($(this).text())
          .attr('data-value', val);
        $pill.on('click', function () {
          $sel.val(val).trigger('change');
          $wrap.find('.kw-pill').removeClass('is-active');
          $(this).addClass('is-active');
        });
        $wrap.append($pill);
      });
 
      $sel.after($wrap).hide();
 
      var def = $sel.find('option[selected]').val() ||
                $sel.find('option').filter(function () { return !!$(this).val(); }).first().val();
      if (def) $wrap.find('.kw-pill[data-value="' + def + '"]').trigger('click');
    });
    $form.find('.reset_variations').hide();
  }
 
  function buildQty($scope) {
    $scope.find('.quantity').each(function () {
      var $q = $(this);
      if ($q.data('kwQty')) return;
      var $input = $q.find('input.qty');
      if (!$input.length) return;
      $q.data('kwQty', true);
 
      var $m = $('<button type="button" class="kw-qtybtn">\u2212</button>');
      var $p = $('<button type="button" class="kw-qtybtn">+</button>');
      $input.before($m);
      $input.after($p);
      $m.on('click', function () { var v = parseInt($input.val(), 10) || 1; if (v > 1) $input.val(v - 1).trigger('change'); });
      $p.on('click', function () { var v = parseInt($input.val(), 10) || 1; $input.val(v + 1).trigger('change'); });
    });
  }
 
  function run() {
    $('form.variations_form').each(function () { buildPills($(this)); });
    buildQty($('.elementor-widget-woocommerce-product-add-to-cart, form.cart'));
  }
 
  run();
 
  // Réessais (Elementor/Woo peut rendre le formulaire un peu après)
  var tries = 0;
  var iv = setInterval(function () { run(); if (++tries > 12) clearInterval(iv); }, 400);
 
  // Observe le DOM au cas où le bloc est injecté tardivement
  if (window.MutationObserver) {
    var mo = new MutationObserver(function () { run(); });
    mo.observe(document.body, { childList: true, subtree: true });
    setTimeout(function () { mo.disconnect(); }, 7000);
  }
 
  // Achat direct -> ajoute au panier puis redirige vers la commande (filtre PHP)
  $(document).on('click', '.kw-buynow', function (e) {
    e.preventDefault();
    var $form = $('form.variations_form').first();
    if (!$form.length) return;
    if (!$form.find('input[name="buy_now"]').length) {
      $form.append('<input type="hidden" name="buy_now" value="1">');
    }
    $form.find('.single_add_to_cart_button').trigger('click');
  });
});
</script>/* End custom CSS */