{
  "version": "0.4",
  "title": "SmartPOS Terminal Caisse Tactile NF525",
  "type": "page",
  "content": [
    {
      "id": "sp_main_sec",
      "elType": "section",
      "settings": {
        "stretch_section": "section-stretched",
        "layout": "full_width",
        "background_background": "classic",
        "background_color": "#020617",
        "padding": {
          "unit": "px",
          "top": "20",
          "right": "24",
          "bottom": "20",
          "left": "24",
          "isLinked": false
        }
      },
      "elements": [
        {
          "id": "sp_col_1",
          "elType": "column",
          "settings": {
            "_column_size": 100
          },
          "elements": [
            {
              "id": "sp_widget_html",
              "elType": "widget",
              "widgetType": "html",
              "settings": {
                "html": "<div id=\"smartpos-standalone-app\" style=\"font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #f8fafc; background: #020617; border-radius: 16px; border: 1px solid #1e293b; padding: 24px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); width: 100%; box-sizing: border-box;\">\n  <style>\n    #smartpos-standalone-app p:empty { display: none !important; margin: 0 !important; padding: 0 !important; }\n    #smartpos-standalone-app > p { display: none !important; margin: 0 !important; padding: 0 !important; }\n    #smartpos-standalone-app br { display: none !important; }\n    #smartpos-standalone-app * { box-sizing: border-box; }\n    .sp-pos-layout {\n      display: flex !important;\n      flex-direction: row !important;\n      gap: 24px !important;\n      width: 100% !important;\n      align-items: flex-start !important;\n    }\n    @media (max-width: 991px) {\n      .sp-pos-layout { flex-direction: column !important; }\n      .sp-pos-cart-col { width: 100% !important; min-width: 100% !important; }\n    }\n    .sp-pos-catalog {\n      flex: 1 1 0% !important;\n      min-width: 0 !important;\n      width: 100% !important;\n    }\n    .sp-pos-cart-col {\n      width: 380px !important;\n      min-width: 320px !important;\n      flex-shrink: 0 !important;\n    }\n    .sp-products-grid {\n      display: grid !important;\n      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;\n      gap: 14px !important;\n      width: 100% !important;\n    }\n  </style>\n\n  <!-- Header Bar -->\n  <div style=\"display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1e293b; padding-bottom: 18px; margin-bottom: 24px; flex-wrap: wrap; gap: 14px;\">\n    <div style=\"display: flex; align-items: center; gap: 14px;\">\n      <div style=\"background: linear-gradient(135deg, #10b981, #059669); color: white; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; box-shadow: 0 4px 12px rgba(16,185,129,0.3);\">⚡</div>\n      <div>\n        <h2 style=\"margin: 0; font-size: 20px; font-weight: 700; color: #f8fafc; letter-spacing: -0.02em;\">SmartPOS AI Pro</h2>\n        <div style=\"margin: 2px 0 0 0; font-size: 12px; color: #94a3b8;\">Caisse Enregistreuse Tactile &bull; WooCommerce Sync &bull; NF525</div>\n      </div>\n    </div>\n    <div style=\"display: flex; align-items: center; gap: 12px; flex-wrap: wrap;\">\n      <span style=\"display: inline-flex; align-items: center; gap: 6px; background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); padding: 6px 12px; border-radius: 9999px; font-size: 12px; font-weight: 600;\">\n        <span style=\"width: 8px; height: 8px; background: #10b981; border-radius: 50%; display: inline-block;\"></span> Connecté WooCommerce\n      </span>\n      <span style=\"background: #0f172a; color: #cbd5e1; border: 1px solid #334155; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500;\">Caisse #01 &bull; Vendeur Principal</span>\n    </div>\n  </div>\n\n  <!-- Main POS Split: Products Grid (Left) + Live Cart / Ticket (Right) -->\n  <div class=\"sp-pos-layout\">\n    <!-- Products Column -->\n    <div class=\"sp-pos-catalog\">\n      <!-- Categories Bar -->\n      <div style=\"display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 6px;\">\n        <button onclick=\"smartposFilter('all')\" class=\"sp-cat-btn active\" style=\"background: #10b981; color: #020617; font-weight: 700; border: none; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;\">Tous les articles</button>\n        <button onclick=\"smartposFilter('boissons')\" class=\"sp-cat-btn\" style=\"background: #0f172a; color: #cbd5e1; border: 1px solid #1e293b; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;\">Boissons</button>\n        <button onclick=\"smartposFilter('boulangerie')\" class=\"sp-cat-btn\" style=\"background: #0f172a; color: #cbd5e1; border: 1px solid #1e293b; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;\">Boulangerie</button>\n        <button onclick=\"smartposFilter('plats')\" class=\"sp-cat-btn\" style=\"background: #0f172a; color: #cbd5e1; border: 1px solid #1e293b; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;\">Plats cuisinés</button>\n        <button onclick=\"smartposFilter('desserts')\" class=\"sp-cat-btn\" style=\"background: #0f172a; color: #cbd5e1; border: 1px solid #1e293b; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;\">Desserts</button>\n      </div>\n\n      <!-- Products Grid -->\n      <div id=\"smartpos-items-grid\" class=\"sp-products-grid\">\n        <!-- Item 1 -->\n        <div onclick=\"smartposAddToCart('Expresso Grand Cru', 2.20, '5.5%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">☕</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Expresso Grand Cru</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 5.5% &bull; Réf #101</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">2,20 €</div>\n        </div>\n\n        <!-- Item 2 -->\n        <div onclick=\"smartposAddToCart('Croissant au Beurre', 1.60, '5.5%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">🥐</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Croissant au Beurre</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 5.5% &bull; Réf #102</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">1,60 €</div>\n        </div>\n\n        <!-- Item 3 -->\n        <div onclick=\"smartposAddToCart('Sandwich Club Poulet', 6.50, '10%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">🥪</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Club Poulet Avocat</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 10% &bull; Réf #103</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">6,50 €</div>\n        </div>\n\n        <!-- Item 4 -->\n        <div onclick=\"smartposAddToCart('Tartelette Framboise', 4.50, '5.5%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">🥧</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Tartelette Framboise</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 5.5% &bull; Réf #104</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">4,50 €</div>\n        </div>\n\n        <!-- Item 5 -->\n        <div onclick=\"smartposAddToCart('Jus d\\'Orange Pressé', 3.80, '10%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">🍊</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Jus d'Orange Frais</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 10% &bull; Réf #105</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">3,80 €</div>\n        </div>\n\n        <!-- Item 6 -->\n        <div onclick=\"smartposAddToCart('Salade César Gourmande', 8.90, '10%')\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; cursor: pointer; transition: all 0.2s; user-select: none;\" onmouseover=\"this.style.borderColor='#10b981'; this.style.transform='translateY(-2px)';\" onmouseout=\"this.style.borderColor='#1e293b'; this.style.transform='translateY(0)';\">\n          <div style=\"font-size: 28px; margin-bottom: 8px;\">🥗</div>\n          <div style=\"font-size: 14px; font-weight: 600; color: #f8fafc;\">Salade César Bio</div>\n          <div style=\"font-size: 11px; color: #64748b; margin-bottom: 8px;\">TVA 10% &bull; Réf #106</div>\n          <div style=\"font-size: 16px; font-weight: 700; color: #10b981;\">8,90 €</div>\n        </div>\n      </div>\n    </div>\n\n    <!-- Live Ticket & Payment Column -->\n    <div class=\"sp-pos-cart-col\" style=\"background: #0f172a; border: 1px solid #1e293b; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between;\">\n      <div>\n        <div style=\"display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1e293b; padding-bottom: 12px; margin-bottom: 12px;\">\n          <span style=\"font-size: 14px; font-weight: 700; color: #f8fafc; text-transform: uppercase; letter-spacing: 0.05em;\">Ticket En Cours</span>\n          <button onclick=\"smartposClearCart()\" style=\"background: transparent; color: #ef4444; border: none; font-size: 11px; cursor: pointer; text-decoration: underline;\">Vider</button>\n        </div>\n\n        <div id=\"smartpos-cart-items\" style=\"min-height: 180px; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;\">\n          <div id=\"smartpos-empty-msg\" style=\"color: #64748b; font-size: 13px; text-align: center; margin-top: 60px;\">\n            Le panier est vide.<br>Touchez un article pour l'ajouter.\n          </div>\n        </div>\n      </div>\n\n      <div>\n        <!-- Totals breakdown -->\n        <div style=\"border-top: 1px dashed #334155; padding-top: 12px; margin-bottom: 14px;\">\n          <div style=\"display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; margin-bottom: 4px;\">\n            <span>Total Hors Taxe (HT)</span>\n            <span id=\"sp-total-ht\">0,00 €</span>\n          </div>\n          <div style=\"display: flex; justify-content: space-between; font-size: 12px; color: #94a3b8; margin-bottom: 8px;\">\n            <span>TVA Collectée (5.5% / 10%)</span>\n            <span id=\"sp-total-tva\">0,00 €</span>\n          </div>\n          <div style=\"display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; color: #10b981; border-top: 1px solid #1e293b; padding-top: 8px;\">\n            <span>TOTAL TTC</span>\n            <span id=\"sp-total-ttc\">0,00 €</span>\n          </div>\n        </div>\n\n        <!-- Payment buttons -->\n        <div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;\">\n          <button onclick=\"smartposPay('Carte Bancaire')\" style=\"background: #1e293b; color: #f8fafc; border: 1px solid #334155; padding: 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;\">💳 CB / TPE</button>\n          <button onclick=\"smartposPay('Espèces')\" style=\"background: #1e293b; color: #f8fafc; border: 1px solid #334155; padding: 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;\">💵 Espèces</button>\n        </div>\n        <button onclick=\"smartposPay('Ticket Restaurant')\" style=\"width: 100%; background: #10b981; color: #020617; border: none; padding: 14px; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; margin-bottom: 8px;\">⚡ Encaisser la commande</button>\n        \n        <div style=\"text-align: center; font-size: 10px; color: #64748b;\">\n          Conformité Loi Anti-Fraude TVA NF525 &bull; Signature Numérique\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n\n<script>\nwindow.smartposCart = [];\n\nfunction smartposAddToCart(title, price, tva) {\n  var item = window.smartposCart.find(function(i) { return i.title === title; });\n  if (item) {\n    item.qty++;\n  } else {\n    window.smartposCart.push({ title: title, price: price, tva: tva, qty: 1 });\n  }\n  smartposRenderCart();\n}\n\nfunction smartposRemoveOne(title) {\n  var item = window.smartposCart.find(function(i) { return i.title === title; });\n  if (item) {\n    item.qty--;\n    if (item.qty <= 0) {\n      window.smartposCart = window.smartposCart.filter(function(i) { return i.title !== title; });\n    }\n  }\n  smartposRenderCart();\n}\n\nfunction smartposClearCart() {\n  window.smartposCart = [];\n  smartposRenderCart();\n}\n\nfunction smartposRenderCart() {\n  var container = document.getElementById('smartpos-cart-items');\n  if (!container) return;\n  if (window.smartposCart.length === 0) {\n    container.innerHTML = '<div id=\"smartpos-empty-msg\" style=\"color: #64748b; font-size: 13px; text-align: center; margin-top: 60px;\">Le panier est vide.<br>Touchez un article pour l\\'ajouter.</div>';\n    document.getElementById('sp-total-ht').innerText = '0,00 €';\n    document.getElementById('sp-total-tva').innerText = '0,00 €';\n    document.getElementById('sp-total-ttc').innerText = '0,00 €';\n    return;\n  }\n\n  var html = '';\n  var totalTTC = 0;\n  var totalHT = 0;\n\n  window.smartposCart.forEach(function(item) {\n    var lineTotal = item.price * item.qty;\n    totalTTC += lineTotal;\n    var tvaRate = parseFloat(item.tva) / 100;\n    var lineHT = lineTotal / (1 + tvaRate);\n    totalHT += lineHT;\n\n    html += '<div style=\"display: flex; justify-content: space-between; align-items: center; background: #020617; padding: 8px 12px; border-radius: 8px; border: 1px solid #1e293b;\">';\n    html += '<div><div style=\"font-size: 13px; font-weight: 600; color: #f8fafc;\">' + item.title + '</div><div style=\"font-size: 11px; color: #64748b;\">' + item.qty + ' × ' + item.price.toFixed(2) + ' €</div></div>';\n    html += '<div style=\"display: flex; align-items: center; gap: 8px;\">';\n    html += '<span style=\"font-weight: 700; color: #10b981; font-size: 13px;\">' + lineTotal.toFixed(2) + ' €</span>';\n    html += '<button onclick=\"smartposRemoveOne(\\'' + item.title.replace(/'/g, \"\\'\") + '\\')\" style=\"background: #1e293b; color: #94a3b8; border: none; width: 22px; height: 22px; border-radius: 4px; cursor: pointer;\">-</button>';\n    html += '</div></div>';\n  });\n\n  container.innerHTML = html;\n  var totalTVA = totalTTC - totalHT;\n  document.getElementById('sp-total-ht').innerText = totalHT.toFixed(2).replace('.', ',') + ' €';\n  document.getElementById('sp-total-tva').innerText = totalTVA.toFixed(2).replace('.', ',') + ' €';\n  document.getElementById('sp-total-ttc').innerText = totalTTC.toFixed(2).replace('.', ',') + ' €';\n}\n\nfunction smartposPay(method) {\n  if (window.smartposCart.length === 0) {\n    alert('Veuillez ajouter des articles au panier avant d\\'encaisser.');\n    return;\n  }\n  var total = document.getElementById('sp-total-ttc').innerText;\n  alert('✅ Paiement validé par ' + method + ' pour un montant de ' + total + ' !\\nTicket conforme NF525 généré avec succès.');\n  smartposClearCart();\n}\n\nfunction smartposFilter(cat) {\n  var buttons = document.querySelectorAll('.sp-cat-btn');\n  buttons.forEach(function(b) {\n    b.style.background = '#0f172a';\n    b.style.color = '#cbd5e1';\n  });\n  if (window.event && window.event.target) {\n    window.event.target.style.background = '#10b981';\n    window.event.target.style.color = '#020617';\n  }\n}\n</script>"
              }
            }
          ]
        }
      ]
    }
  ]
}