{"id":4258,"date":"2026-07-07T14:35:02","date_gmt":"2026-07-07T12:35:02","guid":{"rendered":"https:\/\/www.camping-etang-philippe.fr\/bread\/"},"modified":"2026-11-13T15:48:23","modified_gmt":"2026-11-13T14:48:23","slug":"bread","status":"publish","type":"page","link":"https:\/\/www.camping-etang-philippe.fr\/en\/bread\/","title":{"rendered":"Bread order"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"4258\" class=\"elementor elementor-4258 elementor-3130\">\n\t\t\t\t<div class=\"elementor-element elementor-element-149becc e-con-full e-flex e-con e-parent\" data-id=\"149becc\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8a2ba16 elementor-widget elementor-widget-html\" data-id=\"8a2ba16\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!-- ==========================================================\n  COMMANDE PAIN \u2014 BLOC UNIQUE WPCODE \/ WORDPRESS\n  Version regroup\u00e9e depuis :\n  - index.html\n  - main-page.html\n  - styles.css\n  - verification.js\n  - main.js\n\n  IMPORTANT :\n  - Coller ce fichier complet dans UN extrait HTML WPCode ou via un shortcode WPCode sur une seule page.\n  - Ne pas activer ce m\u00eame extrait en auto-insert sur tout le site : utiliser le shortcode uniquement sur la page de commande.\n  - Ne pas ajouter styles.css, verification.js ou main.js en plus.\n========================================================== -->\n\n\n<!-- ==========================================================\n  PARTIE 1 \/ 5 \u2014 CSS COMPLET\n  Source : styles.css\n========================================================== -->\n<style>\n#commande-pain-site {\n  --bg: #f5f1e8;\n  --card: #ffffff;\n  --ink: #1f2a22;\n  --muted: #6b7280;\n  --green: #1f3a2d;\n  --green-2: #2f6b4f;\n  --line: #d9e2da;\n  --cream: #fff8e8;\n  --danger: #b42318;\n  --ok: #14532d;\n  --warning: #8a4b00;\n  --shadow: 0 16px 40px rgba(31, 58, 45, .14);\n\n  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n  color: var(--ink);\n  min-height: 100vh;\n  padding: 18px 14px 130px;\n  box-sizing: border-box;\n}\n\n#commande-pain-site * {\n  box-sizing: border-box;\n}\n\n#commande-pain-site .app,\n#commande-pain-site .geo-gate {\n  max-width: 620px;\n  margin: 0 auto;\n  width: 100%;\n}\n\n#commande-pain-site .hidden {\n  display: none !important;\n}\n\n#commande-pain-site .geo-gate {\n  background: var(--card);\n  border-radius: 28px;\n  padding: 24px 20px;\n  box-shadow: var(--shadow);\n  border: 1px solid rgba(31, 58, 45, .08);\n}\n\n#commande-pain-site .geo-icon {\n  width: 56px;\n  height: 56px;\n  border-radius: 20px;\n  background: var(--green);\n  color: #ffffff;\n  display: grid;\n  place-items: center;\n  font-size: 28px;\n  margin-bottom: 16px;\n}\n\n#commande-pain-site .geo-gate h2 {\n  margin: 0 0 10px;\n  font-size: 26px;\n  line-height: 1.1;\n  color: var(--ink);\n  font-weight: 900;\n}\n\n#commande-pain-site .geo-gate p {\n  margin: 0 0 14px;\n  color: var(--muted);\n  font-size: 15px;\n  line-height: 1.45;\n}\n\n#commande-pain-site .geo-button,\n#commande-pain-site .submit,\n#commande-pain-site .secondary-button {\n  width: 100%;\n  border: 0;\n  border-radius: 18px;\n  padding: 16px 18px;\n  background: var(--green);\n  color: white;\n  font-size: 16px;\n  font-weight: 900;\n  box-shadow: 0 10px 26px rgba(31, 58, 45, .25);\n  cursor: pointer;\n  font-family: inherit;\n}\n\n#commande-pain-site .secondary-button {\n  background: #ffffff;\n  color: var(--green);\n  border: 1px solid var(--line);\n  box-shadow: none;\n  padding: 12px 14px;\n  font-size: 14px;\n}\n\n#commande-pain-site button:disabled {\n  opacity: .55;\n  cursor: not-allowed;\n  box-shadow: none;\n}\n\n#commande-pain-site .geo-status,\n#commande-pain-site .status {\n  display: none;\n  margin-top: 14px;\n  padding: 14px;\n  border-radius: 16px;\n  font-weight: 800;\n  line-height: 1.4;\n  font-size: 14px;\n}\n\n#commande-pain-site .geo-status.ok,\n#commande-pain-site .status.ok {\n  display: block;\n  background: #e8f6ef;\n  color: var(--ok);\n}\n\n#commande-pain-site .geo-status.err,\n#commande-pain-site .status.err {\n  display: block;\n  background: #fee4e2;\n  color: var(--danger);\n}\n\n#commande-pain-site .geo-status.info,\n#commande-pain-site .status.info {\n  display: block;\n  background: #fff8e8;\n  color: #5a3b1c;\n}\n\n#commande-pain-site .hero {\n  background: var(--green);\n  color: white;\n  border-radius: 28px;\n  padding: 24px 20px;\n  box-shadow: var(--shadow);\n  position: relative;\n  overflow: hidden;\n}\n\n#commande-pain-site .hero::after {\n  content: \"\";\n  position: absolute;\n  width: 190px;\n  height: 190px;\n  border-radius: 50%;\n  right: -70px;\n  top: -85px;\n  background: rgba(255, 255, 255, .10);\n}\n\n#commande-pain-site .eyebrow {\n  font-size: 13px;\n  letter-spacing: .08em;\n  text-transform: uppercase;\n  opacity: .82;\n  margin: 0 0 10px;\n  font-weight: 700;\n}\n\n#commande-pain-site h1 {\n  font-size: 28px;\n  line-height: 1.05;\n  margin: 0 0 10px;\n  max-width: 460px;\n  color: white;\n  font-weight: 900;\n}\n\n#commande-pain-site .hero p {\n  margin: 0;\n  color: rgba(255, 255, 255, .84);\n  font-size: 15px;\n  line-height: 1.45;\n}\n\n#commande-pain-site .notice {\n  margin-top: 14px;\n  background: var(--cream);\n  border: 1px solid rgba(122, 74, 33, .18);\n  border-radius: 18px;\n  padding: 13px 14px;\n  color: #5a3b1c;\n  font-weight: 800;\n  line-height: 1.35;\n}\n\n#commande-pain-site .closed-notice {\n  background: #fee4e2;\n  color: var(--danger);\n  border-color: rgba(180, 35, 24, .25);\n}\n\n#commande-pain-site .card {\n  background: var(--card);\n  border: 1px solid rgba(31, 58, 45, .08);\n  border-radius: 24px;\n  padding: 18px;\n  margin-top: 14px;\n  box-shadow: 0 8px 28px rgba(31, 58, 45, .08);\n  width: 100%;\n  max-width: 100%;\n  overflow: hidden;\n}\n\n#commande-pain-site label {\n  display: block;\n  font-size: 13px;\n  font-weight: 800;\n  margin: 0 0 8px;\n  color: var(--ink);\n}\n\n#commande-pain-site input,\n#commande-pain-site textarea {\n  width: 100%;\n  max-width: 100%;\n  min-width: 0;\n  border: 1px solid var(--line);\n  border-radius: 16px;\n  padding: 14px 14px;\n  font-size: 16px;\n  background: #f7faf7;\n  color: var(--ink);\n  outline: none;\n  font-family: inherit;\n  display: block;\n}\n\n#commande-pain-site input[type=\"date\"] {\n  appearance: none;\n  -webkit-appearance: none;\n}\n\n#commande-pain-site input:focus,\n#commande-pain-site textarea:focus {\n  border-color: var(--green-2);\n  box-shadow: 0 0 0 4px rgba(47, 107, 79, .12);\n}\n\n#commande-pain-site textarea {\n  min-height: 86px;\n  resize: vertical;\n}\n\n#commande-pain-site .grid {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr);\n  gap: 14px;\n  width: 100%;\n}\n\n#commande-pain-site .grid>div {\n  min-width: 0;\n}\n\n@media (min-width: 620px) {\n  #commande-pain-site .grid.two {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n  }\n}\n\n#commande-pain-site .section-title {\n  display: flex;\n  align-items: end;\n  justify-content: space-between;\n  gap: 10px;\n  margin-bottom: 12px;\n}\n\n#commande-pain-site .section-title h2 {\n  margin: 0;\n  font-size: 19px;\n  color: var(--ink);\n  font-weight: 900;\n}\n\n#commande-pain-site .section-title small {\n  color: var(--muted);\n  font-weight: 700;\n  white-space: nowrap;\n}\n\n#commande-pain-site .product {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) auto;\n  gap: 12px;\n  align-items: center;\n  padding: 14px 0;\n  border-bottom: 1px solid #edf1ed;\n}\n\n#commande-pain-site .product:last-child {\n  border-bottom: 0;\n  padding-bottom: 0;\n}\n\n#commande-pain-site .product-name {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  font-weight: 900;\n  font-size: 17px;\n}\n\n#commande-pain-site .emoji {\n  width: 38px;\n  height: 38px;\n  border-radius: 14px;\n  display: grid;\n  place-items: center;\n  background: var(--cream);\n  font-size: 21px;\n  flex: 0 0 auto;\n}\n\n#commande-pain-site .desc,\n#commande-pain-site .price {\n  margin: 4px 0 0 48px;\n  color: var(--muted);\n  font-size: 13px;\n  line-height: 1.3;\n}\n\n#commande-pain-site .price {\n  color: var(--green-2);\n  font-weight: 800;\n}\n\n#commande-pain-site .qty {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  background: #f7faf7;\n  border-radius: 999px;\n  padding: 6px;\n}\n\n#commande-pain-site .qty button {\n  width: 38px;\n  height: 38px;\n  border: 0;\n  border-radius: 999px;\n  background: white;\n  color: var(--green);\n  box-shadow: 0 2px 10px rgba(31, 58, 45, .10);\n  font-size: 24px;\n  line-height: 1;\n  font-weight: 800;\n  cursor: pointer;\n  font-family: inherit;\n}\n\n#commande-pain-site .qty button:active {\n  transform: scale(.96);\n}\n\n#commande-pain-site .qty span {\n  min-width: 28px;\n  text-align: center;\n  font-size: 18px;\n  font-weight: 900;\n}\n\n#commande-pain-site .orders-table {\n  display: grid;\n  gap: 10px;\n}\n\n#commande-pain-site .order-row {\n  background: #ffffff;\n  border: 1px solid #e5ece6;\n  border-radius: 18px;\n  padding: 14px;\n}\n\n#commande-pain-site .order-head {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 10px;\n  margin-bottom: 8px;\n}\n\n#commande-pain-site .order-title {\n  font-weight: 900;\n  color: var(--ink);\n  font-size: 15px;\n}\n\n#commande-pain-site .badge {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  border-radius: 999px;\n  padding: 7px 10px;\n  font-weight: 900;\n  font-size: 12px;\n  white-space: nowrap;\n}\n\n#commande-pain-site .badge.warning {\n  background: #fff8e8;\n  color: var(--warning);\n}\n\n#commande-pain-site .badge.ok {\n  background: #e8f6ef;\n  color: var(--ok);\n}\n\n#commande-pain-site .order-details {\n  display: grid;\n  gap: 5px;\n  color: #4b5563;\n  font-size: 13px;\n  line-height: 1.35;\n}\n\n#commande-pain-site .order-total-line {\n  margin-top: 4px;\n  font-size: 15px;\n  font-weight: 900;\n  color: #1f3a2d;\n}\n\n#commande-pain-site .order-total-line strong,\n#commande-pain-site .order-total-amount {\n  font-size: 16px;\n  font-weight: 950;\n  color: #1f3a2d;\n}\n\n#commande-pain-site #refreshOrdersBtnPain {\n  background-color: #1f3a2d;\n  color: #ffffff;\n  border: 0;\n  box-shadow: 0 10px 26px rgba(31, 58, 45, .25);\n}\n\n#commande-pain-site .footer {\n  position: fixed;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 9999;\n  padding: 12px 14px max(12px, env(safe-area-inset-bottom));\n  background: rgba(245, 241, 232, .88);\n  backdrop-filter: blur(14px);\n  border-top: 1px solid rgba(31, 58, 45, .10);\n}\n\n#commande-pain-site .footer-inner {\n  max-width: 620px;\n  margin: 0 auto;\n  display: grid;\n  grid-template-columns: auto minmax(0, 1fr);\n  gap: 12px;\n  align-items: center;\n}\n\n#commande-pain-site .total {\n  background: white;\n  border-radius: 18px;\n  padding: 10px 12px;\n  min-width: 104px;\n  text-align: center;\n  box-shadow: 0 8px 22px rgba(31, 58, 45, .08);\n}\n\n#commande-pain-site .total strong {\n  display: block;\n  font-size: 22px;\n  line-height: 1;\n}\n\n#commande-pain-site .total small {\n  color: var(--muted);\n  font-weight: 700;\n}\n\n@media (max-width: 420px) {\n  #commande-pain-site {\n    padding-left: 10px;\n    padding-right: 10px;\n  }\n\n  #commande-pain-site .card {\n    padding: 15px;\n  }\n\n  #commande-pain-site .product {\n    grid-template-columns: 1fr;\n    gap: 10px;\n  }\n\n  #commande-pain-site .qty {\n    justify-content: space-between;\n    width: 100%;\n  }\n\n  #commande-pain-site .qty button {\n    width: 42px;\n    height: 42px;\n  }\n\n  #commande-pain-site .order-head {\n    display: grid;\n  }\n}\n\n\/* ==========================================================\n       FIX WORDPRESS \/ ELEMENTOR \/ TH\u00c8ME\n       Emp\u00eache les styles globaux du site de rendre des \u00e9l\u00e9ments invisibles\n       ========================================================== *\/\n\n#commande-pain-site,\n#commande-pain-site * {\n  box-sizing: border-box !important;\n}\n\n#commande-pain-site {\n  !important;\n  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif !important;\n}\n\n#commande-pain-site h1,\n#commande-pain-site h2,\n#commande-pain-site h3,\n#commande-pain-site p,\n#commande-pain-site span,\n#commande-pain-site small,\n#commande-pain-site strong,\n#commande-pain-site label,\n#commande-pain-site div {\n  font-family: inherit !important;\n}\n\n#commande-pain-site .hero,\n#commande-pain-site .hero *,\n#commande-pain-site .geo-button,\n#commande-pain-site .submit {\n  color: #ffffff !important;\n}\n\n#commande-pain-site .hero {\n  background-color: #1f3a2d !important;\n}\n\n#commande-pain-site .geo-gate,\n#commande-pain-site .card,\n#commande-pain-site .order-row,\n#commande-pain-site .total {\n  background-color: #ffffff !important;\n  color: #1f2a22 !important;\n}\n\n#commande-pain-site .geo-gate *,\n#commande-pain-site .card *,\n#commande-pain-site .order-row *,\n#commande-pain-site .total * {\n  color: inherit;\n}\n\n#commande-pain-site input,\n#commande-pain-site textarea {\n  background-color: #f7faf7 !important;\n  color: #1f2a22 !important;\n  border-color: #d9e2da !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  opacity: 1 !important;\n}\n\n#commande-pain-site input::placeholder,\n#commande-pain-site textarea::placeholder {\n  color: #8a8f98 !important;\n  opacity: 1 !important;\n}\n\n#commande-pain-site button,\n#commande-pain-site input,\n#commande-pain-site textarea {\n  font-family: inherit !important;\n}\n\n#commande-pain-site .geo-button,\n#commande-pain-site .submit {\n  background-color: #1f3a2d !important;\n  color: #ffffff !important;\n  border: 0 !important;\n}\n\n#commande-pain-site .secondary-button {\n  background-color: #ffffff !important;\n  color: #1f3a2d !important;\n  border: 1px solid #d9e2da !important;\n}\n\n#commande-pain-site #refreshOrdersBtnPain {\n  background-color: #1f3a2d !important;\n  color: #ffffff !important;\n  border: 0 !important;\n  box-shadow: 0 10px 26px rgba(31, 58, 45, .25) !important;\n}\n\n#commande-pain-site .eyebrow,\n#commande-pain-site .hero p {\n  color: rgba(255, 255, 255, .84) !important;\n}\n\n#commande-pain-site .section-title h2,\n#commande-pain-site .product-name,\n#commande-pain-site .order-title,\n#commande-pain-site label,\n#commande-pain-site .total strong {\n  color: #1f2a22 !important;\n}\n\n#commande-pain-site .desc,\n#commande-pain-site .order-details,\n#commande-pain-site .total small,\n#commande-pain-site .section-title small {\n  color: #6b7280 !important;\n}\n\n#commande-pain-site .price {\n  color: #2f6b4f !important;\n}\n\n#commande-pain-site .notice {\n  background-color: #fff8e8 !important;\n  color: #5a3b1c !important;\n  border-color: rgba(122, 74, 33, .18) !important;\n}\n\n#commande-pain-site .closed-notice,\n#commande-pain-site .status.err,\n#commande-pain-site .geo-status.err {\n  background-color: #fee4e2 !important;\n  color: #b42318 !important;\n}\n\n#commande-pain-site .status.info,\n#commande-pain-site .geo-status.info {\n  background-color: #fff8e8 !important;\n  color: #5a3b1c !important;\n}\n\n#commande-pain-site .status.ok,\n#commande-pain-site .geo-status.ok,\n#commande-pain-site .badge.ok {\n  background-color: #e8f6ef !important;\n  color: #14532d !important;\n}\n\n#commande-pain-site .badge.warning {\n  background-color: #fff8e8 !important;\n  color: #8a4b00 !important;\n}\n\n#commande-pain-site .emoji {\n  background-color: #fff8e8 !important;\n  color: #1f2a22 !important;\n}\n\n#commande-pain-site .qty {\n  background-color: #f7faf7 !important;\n}\n\n#commande-pain-site .qty button {\n  background-color: #ffffff !important;\n  color: #1f3a2d !important;\n}\n\n#commande-pain-site .footer {\n  background: rgba(245, 241, 232, .88) !important;\n  border-top-color: rgba(31, 58, 45, .10) !important;\n}\n\n#commande-pain-site .hidden {\n  display: none !important;\n}\n\n#commande-pain-site a,\n#commande-pain-site a:visited,\n#commande-pain-site a:hover {\n  color: inherit !important;\n}\n\n\n\n\/* ==========================================================\n       Date de retrait : bouton complet + calendrier moderne\n       ========================================================== *\/\n\n#commande-pain-site .date-picker-modern {\n  position: relative !important;\n  width: 100% !important;\n  max-width: 100% !important;\n}\n\n#commande-pain-site .date-modern-button,\n#commande-pain-site #phonePain {\n  width: 100% !important;\n  min-width: 0 !important;\n  height: 56px !important;\n  min-height: 56px !important;\n  max-height: 56px !important;\n  border-radius: 16px !important;\n  font-size: 16px !important;\n  line-height: 1.25 !important;\n}\n\n#commande-pain-site .date-modern-button {\n  display: flex !important;\n  align-items: center !important;\n  justify-content: space-between !important;\n  gap: 12px !important;\n  padding: 0 14px !important;\n  border: 1px solid #d9e2da !important;\n  background: #f7faf7 !important;\n  color: #1f2a22 !important;\n  box-shadow: none !important;\n  cursor: pointer !important;\n  text-align: left !important;\n  font-family: inherit !important;\n  font-weight: 800 !important;\n  appearance: none !important;\n  -webkit-appearance: none !important;\n}\n\n#commande-pain-site .date-modern-button:hover {\n  background: #ffffff !important;\n  border-color: #b9cabd !important;\n}\n\n#commande-pain-site .date-modern-button:focus,\n#commande-pain-site .date-modern-button[aria-expanded=\"true\"] {\n  border-color: #2f6b4f !important;\n  box-shadow: 0 0 0 4px rgba(47, 107, 79, .12) !important;\n  background: #ffffff !important;\n  outline: none !important;\n}\n\n#commande-pain-site .date-modern-text {\n  display: block !important;\n  min-width: 0 !important;\n  overflow: hidden !important;\n  text-overflow: ellipsis !important;\n  white-space: nowrap !important;\n  color: #1f2a22 !important;\n}\n\n#commande-pain-site .date-modern-icon {\n  display: inline-flex !important;\n  align-items: center !important;\n  justify-content: center !important;\n  width: auto !important;\n  height: auto !important;\n  min-width: 24px !important;\n  border-radius: 0 !important;\n  background: transparent !important;\n  color: #1f3a2d !important;\n  flex: 0 0 auto !important;\n  font-size: 21px !important;\n  line-height: 1 !important;\n}\n\n#commande-pain-site #phonePain {\n  padding-top: 0 !important;\n  padding-bottom: 0 !important;\n  display: block !important;\n}\n\n#commande-pain-site .date-calendar-popover {\n  position: absolute !important;\n  top: calc(100% + 10px) !important;\n  left: 0 !important;\n  right: 0 !important;\n  z-index: 100000 !important;\n  background: #ffffff !important;\n  border: 1px solid rgba(31, 58, 45, .12) !important;\n  border-radius: 22px !important;\n  padding: 14px !important;\n  box-shadow: 0 20px 45px rgba(31, 58, 45, .20) !important;\n  color: #1f2a22 !important;\n}\n\n#commande-pain-site .date-calendar-head {\n  display: grid !important;\n  grid-template-columns: 40px minmax(0, 1fr) 40px !important;\n  align-items: center !important;\n  gap: 8px !important;\n  margin-bottom: 12px !important;\n}\n\n#commande-pain-site .date-calendar-head strong {\n  text-align: center !important;\n  font-size: 15px !important;\n  font-weight: 950 !important;\n  color: #1f2a22 !important;\n  text-transform: capitalize !important;\n}\n\n#commande-pain-site .calendar-nav {\n  width: 40px !important;\n  height: 40px !important;\n  padding: 0 !important;\n  border: 1px solid #d9e2da !important;\n  border-radius: 14px !important;\n  background: #f7faf7 !important;\n  color: #1f3a2d !important;\n  box-shadow: none !important;\n  font-size: 24px !important;\n  line-height: 1 !important;\n  cursor: pointer !important;\n  font-family: inherit !important;\n}\n\n#commande-pain-site .date-calendar-weekdays,\n#commande-pain-site .date-calendar-days {\n  display: grid !important;\n  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n  gap: 6px !important;\n}\n\n#commande-pain-site .date-calendar-weekdays {\n  margin-bottom: 6px !important;\n}\n\n#commande-pain-site .date-calendar-weekdays span {\n  text-align: center !important;\n  font-size: 11px !important;\n  font-weight: 900 !important;\n  color: #6b7280 !important;\n}\n\n#commande-pain-site .date-day {\n  width: 100% !important;\n  aspect-ratio: 1 \/ 1 !important;\n  min-height: 36px !important;\n  border: 0 !important;\n  border-radius: 13px !important;\n  background: #f7faf7 !important;\n  color: #1f2a22 !important;\n  box-shadow: none !important;\n  padding: 0 !important;\n  font-size: 14px !important;\n  font-weight: 900 !important;\n  cursor: pointer !important;\n  font-family: inherit !important;\n}\n\n#commande-pain-site .date-day:hover {\n  background: #e8f6ef !important;\n  color: #14532d !important;\n}\n\n#commande-pain-site .date-day.is-selected {\n  background: #1f3a2d !important;\n  color: #ffffff !important;\n}\n\n#commande-pain-site .date-day.is-today:not(.is-selected) {\n  outline: 2px solid rgba(47, 107, 79, .25) !important;\n  outline-offset: -2px !important;\n}\n\n#commande-pain-site .date-day.is-disabled {\n  background: #f1f3f1 !important;\n  color: #a0a7a0 !important;\n  cursor: not-allowed !important;\n  opacity: .7 !important;\n}\n\n#commande-pain-site .date-day-spacer {\n  min-height: 36px !important;\n}\n\n#commande-pain-site .date-calendar-help {\n  margin: 12px 0 0 !important;\n  color: #6b7280 !important;\n  font-size: 12px !important;\n  line-height: 1.35 !important;\n  font-weight: 700 !important;\n  text-align: center !important;\n}\n\n@media (max-width: 420px) {\n  #commande-pain-site .date-calendar-popover {\n    position: fixed !important;\n    left: 12px !important;\n    right: 12px !important;\n    top: auto !important;\n    bottom: 92px !important;\n  }\n}\n\n\n\n\/* Correctif calendrier : visible en surcouche, non coup\u00e9 par le bloc parent *\/\n#commande-pain-site .card,\n#commande-pain-site .grid,\n#commande-pain-site .grid>div,\n#commande-pain-site .date-picker-modern {\n  overflow: visible !important;\n}\n\n#commande-pain-site .date-picker-modern {\n  position: relative !important;\n  z-index: 70 !important;\n}\n\n#commande-pain-site .date-calendar-popover,\nbody #pickupCalendarPain.date-calendar-popover {\n  position: fixed !important;\n  left: 50% !important;\n  right: auto !important;\n  top: auto !important;\n  bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;\n  transform: translateX(-50%) !important;\n  width: min(420px, calc(100vw - 28px)) !important;\n  max-width: calc(100vw - 28px) !important;\n  max-height: calc(100vh - 170px - env(safe-area-inset-bottom, 0px)) !important;\n  overflow-y: auto !important;\n  z-index: 80 !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover {\n  background: #ffffff !important;\n  border: 1px solid rgba(31, 58, 45, .12) !important;\n  border-radius: 22px !important;\n  padding: 14px !important;\n  box-shadow: 0 24px 70px rgba(31, 58, 45, .28) !important;\n  color: #1f2a22 !important;\n  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif !important;\n  box-sizing: border-box !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover *,\nbody #pickupCalendarPain.date-calendar-popover *::before,\nbody #pickupCalendarPain.date-calendar-popover *::after {\n  box-sizing: border-box !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover.hidden {\n  display: none !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-head {\n  display: grid !important;\n  grid-template-columns: 40px minmax(0, 1fr) 40px !important;\n  align-items: center !important;\n  gap: 8px !important;\n  margin-bottom: 12px !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-head strong {\n  text-align: center !important;\n  font-size: 15px !important;\n  font-weight: 950 !important;\n  color: #1f2a22 !important;\n  text-transform: capitalize !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .calendar-nav {\n  width: 40px !important;\n  height: 40px !important;\n  padding: 0 !important;\n  border: 1px solid #d9e2da !important;\n  border-radius: 14px !important;\n  background: #f7faf7 !important;\n  color: #1f3a2d !important;\n  box-shadow: none !important;\n  font-size: 24px !important;\n  line-height: 1 !important;\n  cursor: pointer !important;\n  font-family: inherit !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-weekdays,\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-days {\n  display: grid !important;\n  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;\n  gap: 6px !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-weekdays {\n  margin-bottom: 6px !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-weekdays span {\n  text-align: center !important;\n  font-size: 11px !important;\n  font-weight: 900 !important;\n  color: #6b7280 !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day {\n  width: 100% !important;\n  aspect-ratio: 1 \/ 1 !important;\n  min-height: 36px !important;\n  border: 0 !important;\n  border-radius: 13px !important;\n  background: #f7faf7 !important;\n  color: #1f2a22 !important;\n  box-shadow: none !important;\n  padding: 0 !important;\n  font-size: 14px !important;\n  font-weight: 900 !important;\n  cursor: pointer !important;\n  font-family: inherit !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day:hover {\n  background: #e8f6ef !important;\n  color: #14532d !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day.is-selected {\n  background: #1f3a2d !important;\n  color: #ffffff !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day.is-today:not(.is-selected) {\n  outline: 2px solid rgba(47, 107, 79, .25) !important;\n  outline-offset: -2px !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day.is-disabled {\n  background: #f1f3f1 !important;\n  color: #a0a7a0 !important;\n  cursor: not-allowed !important;\n  opacity: .7 !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-day-spacer {\n  min-height: 36px !important;\n}\n\nbody #pickupCalendarPain.date-calendar-popover .date-calendar-help {\n  margin: 12px 0 0 !important;\n  color: #6b7280 !important;\n  font-size: 12px !important;\n  line-height: 1.35 !important;\n  font-weight: 700 !important;\n  text-align: center !important;\n}\n\n@media (max-width: 420px) {\n\n  #commande-pain-site .date-calendar-popover,\n  body #pickupCalendarPain.date-calendar-popover {\n    width: calc(100vw - 24px) !important;\n    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;\n    max-height: calc(100vh - 150px - env(safe-area-inset-bottom, 0px)) !important;\n  }\n}\n\n\n\/* ==========================================================\n       Priorit\u00e9 site : le module reste sous les \u00e9l\u00e9ments importants\n       Menus, cookies, popups, extensions et overlays du site\n       doivent pouvoir passer au-dessus du calendrier et du footer.\n       ========================================================== *\/\n\n#commande-pain-site {\n  z-index: 70 !important;\n}\n\n#commande-pain-site .date-picker-modern,\n#commande-pain-site .date-calendar-popover,\nbody #pickupCalendarPain.date-calendar-popover {\n  z-index: 80 !important;\n}\n\n#commande-pain-site .footer {\n  z-index: 90 !important;\n}\n\n\/* ==========================================================\n  AJOUT \u2014 Quantit\u00e9s \u00e9ditables + feedback actualisation\n========================================================== *\/\n\n#commande-pain-site .qty-input {\n  width: 42px !important;\n  min-width: 42px !important;\n  max-width: 48px !important;\n  height: 38px !important;\n  padding: 0 2px !important;\n  border: 0 !important;\n  border-radius: 999px !important;\n  background: transparent !important;\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  text-align: center !important;\n  font-size: 18px !important;\n  font-weight: 950 !important;\n  line-height: 38px !important;\n  box-shadow: none !important;\n  outline: none !important;\n  appearance: textfield !important;\n  -moz-appearance: textfield !important;\n  cursor: text !important;\n}\n\n#commande-pain-site .qty-input:focus {\n  background: #ffffff !important;\n  color: #1f3a2d !important;\n  -webkit-text-fill-color: #1f3a2d !important;\n  box-shadow: 0 0 0 3px rgba(47, 107, 79, .14) !important;\n}\n\n#commande-pain-site .qty-input::-webkit-outer-spin-button,\n#commande-pain-site .qty-input::-webkit-inner-spin-button {\n  -webkit-appearance: none !important;\n  margin: 0 !important;\n}\n\n#commande-pain-site #refreshOrdersBtnPain.is-loading {\n  opacity: .82 !important;\n  cursor: wait !important;\n  position: relative !important;\n}\n\n#commande-pain-site #refreshOrdersBtnPain.is-loading::after {\n  content: \"\" !important;\n  display: inline-block !important;\n  width: 13px !important;\n  height: 13px !important;\n  margin-left: 8px !important;\n  border: 2px solid rgba(255,255,255,.45) !important;\n  border-top-color: #ffffff !important;\n  border-radius: 50% !important;\n  vertical-align: -2px !important;\n  animation: commandePainSpin .75s linear infinite !important;\n}\n\n@keyframes commandePainSpin {\n  to {\n    transform: rotate(360deg);\n  }\n}\n\n\n\n\n\/* ==========================================================\n  MODULE PRODUITS ADMINISTRABLES \u2014 CSS ISOL\u00c9\n========================================================== *\/\n#commande-pain-site .products-admin-status {\n  margin: -4px 0 10px !important;\n  color: #6b7280 !important;\n  font-size: 12px !important;\n  line-height: 1.35 !important;\n  font-weight: 750 !important;\n}\n\n#commande-pain-site .products-admin-status.ok {\n  color: #14532d !important;\n}\n\n#commande-pain-site .products-admin-status.err {\n  color: #b42318 !important;\n}\n\n#commande-pain-site .products-empty {\n  padding: 14px !important;\n  border: 1px dashed #d9e2da !important;\n  border-radius: 16px !important;\n  background: #f7faf7 !important;\n  color: #6b7280 !important;\n  font-weight: 800 !important;\n  line-height: 1.35 !important;\n}\n\n#commande-pain-site .stock-info {\n  margin: 5px 0 0 48px !important;\n  color: #14532d !important;\n  font-size: 12px !important;\n  line-height: 1.3 !important;\n  font-weight: 900 !important;\n}\n\n#commande-pain-site .stock-info.is-low {\n  color: #8a4b00 !important;\n}\n\n#commande-pain-site .stock-info.is-empty {\n  color: #b42318 !important;\n}\n\n#commande-pain-site .product.is-sold-out {\n  opacity: .72 !important;\n}\n\n#commande-pain-site .product.is-sold-out .qty {\n  opacity: .75 !important;\n}\n\n\/* ==========================================================\n  MODULE CHARGEMENT PRODUITS \u2014 BLOCAGE COMPLET DU BLOC\n========================================================== *\/\n#commande-pain-site .products-order-card {\n  position: relative !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading {\n  opacity: .68 !important;\n  filter: grayscale(.12) !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading #productsPain {\n  pointer-events: none !important;\n  user-select: none !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading .product,\n#commande-pain-site .products-order-card.is-products-loading .products-empty {\n  opacity: .55 !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading .qty button,\n#commande-pain-site .products-order-card.is-products-loading .qty-input {\n  pointer-events: none !important;\n  cursor: wait !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading::after {\n  content: \"\" !important;\n  position: absolute !important;\n  inset: 0 !important;\n  border-radius: 24px !important;\n  background: rgba(255, 255, 255, .42) !important;\n  z-index: 2 !important;\n  pointer-events: auto !important;\n}\n\n#commande-pain-site .products-order-card.is-products-loading::before {\n  content: \"Chargement des produits...\" !important;\n  position: absolute !important;\n  left: 50% !important;\n  top: 50% !important;\n  transform: translate(-50%, -50%) !important;\n  z-index: 3 !important;\n  min-width: 220px !important;\n  max-width: calc(100% - 36px) !important;\n  padding: 12px 16px !important;\n  border-radius: 999px !important;\n  background: #1f3a2d !important;\n  color: #ffffff !important;\n  box-shadow: 0 12px 28px rgba(31, 58, 45, .22) !important;\n  font-size: 13px !important;\n  line-height: 1.25 !important;\n  font-weight: 950 !important;\n  text-align: center !important;\n  white-space: nowrap !important;\n}\n\n@media (max-width: 420px) {\n  #commande-pain-site .products-order-card.is-products-loading::before {\n    min-width: 0 !important;\n    width: calc(100% - 42px) !important;\n    white-space: normal !important;\n  }\n}\n\n\/* ==========================================================\n  MODULE MODIFICATION \/ SUPPRESSION CLIENT \u2014 CSS ISOL\u00c9\n========================================================== *\/\n#commande-pain-site select {\n  width: 100% !important;\n  max-width: 100% !important;\n  min-width: 0 !important;\n  border: 1px solid #d9e2da !important;\n  border-radius: 16px !important;\n  padding: 14px 14px !important;\n  font-size: 15px !important;\n  background: #f7faf7 !important;\n  color: #1f2a22 !important;\n  outline: none !important;\n  font-family: inherit !important;\n  display: block !important;\n}\n\n#commande-pain-site select:focus {\n  border-color: #2f6b4f !important;\n  box-shadow: 0 0 0 4px rgba(47, 107, 79, .12) !important;\n}\n\n#commande-pain-site .orders-section-title {\n  align-items: center !important;\n}\n\n#commande-pain-site .orders-title-left {\n  display: flex !important;\n  align-items: center !important;\n  gap: 10px !important;\n  min-width: 0 !important;\n  flex-wrap: wrap !important;\n}\n\n#commande-pain-site .orders-action-button {\n  width: auto !important;\n  min-height: 38px !important;\n  border: 0 !important;\n  border-radius: 14px !important;\n  padding: 9px 13px !important;\n  background: #1f3a2d !important;\n  color: #ffffff !important;\n  font-size: 13px !important;\n  font-weight: 950 !important;\n  box-shadow: 0 8px 20px rgba(31, 58, 45, .20) !important;\n  cursor: pointer !important;\n  font-family: inherit !important;\n  white-space: nowrap !important;\n}\n\n#commande-pain-site .orders-action-button:disabled,\n#commande-pain-site .orders-action-button.is-disabled {\n  background: #d1d5db !important;\n  color: #6b7280 !important;\n  opacity: 1 !important;\n  cursor: not-allowed !important;\n  box-shadow: none !important;\n}\n\n#commande-pain-site .modify-orders-panel {\n  margin: 0 0 12px !important;\n  padding: 13px !important;\n  border: 1px solid #d9e2da !important;\n  border-radius: 18px !important;\n  background: #f7faf7 !important;\n}\n\n#commande-pain-site .modify-order-grid {\n  display: grid !important;\n  grid-template-columns: minmax(0, 1fr) auto !important;\n  gap: 10px !important;\n  align-items: center !important;\n}\n\n#commande-pain-site .modify-orders-help {\n  margin: 9px 0 0 !important;\n  color: #6b7280 !important;\n  font-size: 12px !important;\n  line-height: 1.35 !important;\n  font-weight: 700 !important;\n}\n\n#commande-pain-site .order-actions {\n  display: inline-flex !important;\n  align-items: center !important;\n  gap: 8px !important;\n  margin-left: auto !important;\n}\n\n#commande-pain-site .order-delete-btn {\n  width: 34px !important;\n  height: 34px !important;\n  min-width: 34px !important;\n  border: 0 !important;\n  border-radius: 999px !important;\n  background: #fee4e2 !important;\n  color: #b42318 !important;\n  box-shadow: none !important;\n  font-size: 24px !important;\n  font-weight: 950 !important;\n  line-height: 1 !important;\n  cursor: pointer !important;\n  display: inline-flex !important;\n  align-items: center !important;\n  justify-content: center !important;\n  font-family: inherit !important;\n}\n\n#commande-pain-site .order-delete-btn:hover:not(:disabled) {\n  background: #b42318 !important;\n  color: #ffffff !important;\n}\n\n#commande-pain-site .order-delete-btn:disabled {\n  background: #f3f4f6 !important;\n  color: #9ca3af !important;\n  cursor: not-allowed !important;\n  opacity: 1 !important;\n}\n\n#commande-pain-site .order-action-lock-note {\n  color: #8a4b00 !important;\n  font-size: 12px !important;\n  font-weight: 800 !important;\n}\n\n#commande-pain-site .edit-mode-notice {\n  margin: 0 0 12px !important;\n  padding: 13px 14px !important;\n  border-radius: 16px !important;\n  background: #e8f6ef !important;\n  color: #14532d !important;\n  font-size: 13px !important;\n  line-height: 1.35 !important;\n  font-weight: 850 !important;\n}\n\n#commande-pain-site .cancel-edit-button {\n  margin: 0 0 12px !important;\n}\n\n@media (max-width: 520px) {\n  #commande-pain-site .modify-order-grid {\n    grid-template-columns: minmax(0, 1fr) !important;\n  }\n\n  #commande-pain-site .orders-section-title {\n    display: grid !important;\n    align-items: start !important;\n  }\n\n  #commande-pain-site .order-actions {\n    justify-content: flex-start !important;\n    margin-left: 0 !important;\n  }\n}\n\n\n\n\/* ==========================================================\n  MODULE CORRECTION PUBLICATION SITE \u2014 GRILLES FORMULAIRE AUTO \/ HEIGHT AUTO\n  Objectif : emp\u00eacher WordPress \/ Elementor de publier les deux grilles\n  Nom + Emplacement et Date + T\u00e9l\u00e9phone avec height:0px ou offsets \u00e0 0px.\n  Les grilles gardent leur display:grid, mais leur taille revient en auto.\n========================================================== *\/\n#commande-pain-site #orderFormPain .grid,\n#commande-pain-site #orderFormPain .grid.two {\n  position: static !important;\n  inset: auto !important;\n  top: auto !important;\n  right: auto !important;\n  bottom: auto !important;\n  left: auto !important;\n  width: 100% !important;\n  height: auto !important;\n  min-height: auto !important;\n  max-height: none !important;\n  overflow: visible !important;\n  transform: none !important;\n  display: grid !important;\n  align-items: start !important;\n  grid-auto-rows: auto !important;\n}\n\n#commande-pain-site #orderFormPain .grid > div,\n#commande-pain-site #orderFormPain .grid.two > div,\n#commande-pain-site #orderFormPain .date-field-cell {\n  position: static !important;\n  inset: auto !important;\n  top: auto !important;\n  right: auto !important;\n  bottom: auto !important;\n  left: auto !important;\n  width: auto !important;\n  height: auto !important;\n  min-height: auto !important;\n  max-height: none !important;\n  overflow: visible !important;\n  transform: none !important;\n}\n\n#commande-pain-site #orderFormPain .grid input,\n#commande-pain-site #orderFormPain .grid textarea,\n#commande-pain-site #orderFormPain .grid button,\n#commande-pain-site #orderFormPain .date-picker-modern {\n  height: auto;\n  max-height: none;\n}\n\n\n\n\/* ==========================================================\n  MODULE MOBILE \u2014 MASQUAGE BOUTON RETURN TO TOP DU TH\u00c8ME\n  - Actif uniquement quand le module Commande Pain est pr\u00e9sent.\n  - \u00c9vite que le bouton #return-to-top du th\u00e8me g\u00eane le footer.\n========================================================== *\/\nbody.commande-pain-active #return-to-top,\nbody.commande-pain-active a#return-to-top,\nbody.commande-pain-active a[href=\"unsafe:javascript:\"]#return-to-top {\n  display: none !important;\n  visibility: hidden !important;\n  opacity: 0 !important;\n  pointer-events: none !important;\n  z-index: -1 !important;\n}\n\n#commande-pain-site .footer,\nbody.commande-pain-active #commande-pain-site .footer,\nbody.commande-pain-active #orderFooterPain {\n  z-index: 2147483000 !important;\n}\n\n@media (max-width: 768px) {\n  body.commande-pain-active #return-to-top,\n  body.commande-pain-active a#return-to-top {\n    display: none !important;\n    visibility: hidden !important;\n    opacity: 0 !important;\n    pointer-events: none !important;\n  }\n\n  body.commande-pain-active #orderFooterPain {\n    z-index: 2147483000 !important;\n  }\n}\n\n\n\n\/* ==========================================================\n  MODULE MODIFICATION COMMANDE \u2014 SELECT VISIBLE WP \/ MOBILE\n  Force l'affichage du texte dans la liste des commandes \u00e0 modifier.\n========================================================== *\/\n#commande-pain-site #modifyOrderSelectPain,\n#commande-pain-site #modifyOrderSelectPain:focus,\n#commande-pain-site #modifyOrderSelectPain:hover {\n  background-color: #ffffff !important;\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  opacity: 1 !important;\n  text-shadow: none !important;\n  border-color: #d9e2da !important;\n  appearance: auto !important;\n  -webkit-appearance: menulist !important;\n}\n\n#commande-pain-site #modifyOrderSelectPain option,\n#commande-pain-site #modifyOrderSelectPain optgroup {\n  background-color: #ffffff !important;\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  opacity: 1 !important;\n  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif !important;\n}\n\n#commande-pain-site #modifyOrderSelectPain:disabled {\n  background-color: #f3f4f6 !important;\n  color: #6b7280 !important;\n  -webkit-text-fill-color: #6b7280 !important;\n  opacity: 1 !important;\n}\n\n#commande-pain-site #modifyOrdersPanelPain,\n#commande-pain-site #modifyOrdersPanelPain label,\n#commande-pain-site #modifyOrdersHelpPain {\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: currentColor !important;\n  opacity: 1 !important;\n}\n\n#commande-pain-site #modifyOrdersHelpPain {\n  color: #6b7280 !important;\n}\n\n\n\/* ==========================================================\n  MODULE MODIFICATION COMMANDE \u2014 SELECT NON COUP\u00c9 \/ LISIBLE\n  Version renforc\u00e9e pour WPCode + mobile : le s\u00e9lecteur prend\n  toute la largeur et le bouton passe dessous pour \u00e9viter qu'une\n  zone invisible du th\u00e8me coupe le texte.\n========================================================== *\/\n#commande-pain-site #modifyOrdersPanelPain {\n  overflow: visible !important;\n  height: auto !important;\n  min-height: auto !important;\n  max-height: none !important;\n}\n\n#commande-pain-site .modify-order-grid {\n  display: grid !important;\n  grid-template-columns: minmax(0, 1fr) !important;\n  gap: 10px !important;\n  align-items: stretch !important;\n  overflow: visible !important;\n  height: auto !important;\n  min-height: auto !important;\n  max-height: none !important;\n}\n\n#commande-pain-site #modifyOrderSelectPain {\n  display: block !important;\n  width: 100% !important;\n  min-width: 0 !important;\n  height: 56px !important;\n  min-height: 56px !important;\n  max-height: 56px !important;\n  line-height: 56px !important;\n  padding: 0 44px 0 14px !important;\n  box-sizing: border-box !important;\n  overflow: hidden !important;\n  white-space: nowrap !important;\n  text-overflow: ellipsis !important;\n  position: relative !important;\n  z-index: 5 !important;\n  background-color: #ffffff !important;\n  background-image: none !important;\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  font-size: 15px !important;\n  font-weight: 850 !important;\n}\n\n#commande-pain-site #modifyOrderSelectPain option {\n  color: #1f2a22 !important;\n  -webkit-text-fill-color: #1f2a22 !important;\n  background-color: #ffffff !important;\n  font-size: 15px !important;\n}\n\n#commande-pain-site #startModifyOrderBtnPain {\n  width: 100% !important;\n  min-height: 44px !important;\n  position: relative !important;\n  z-index: 4 !important;\n}\n\n<\/style>\n\n\n<!-- ==========================================================\n  PARTIE 2 \/ 5 \u2014 HTML V\u00c9RIFICATION CLIENT\n  Source : index.html, uniquement le contenu utile du body\n========================================================== -->\n<div id=\"commande-pain-site\" data-commande-pain-page=\"single\">\n\n<section class=\"geo-gate\" id=\"geoGatePain\">\n      <div class=\"geo-icon\">\ud83c\udfd5\ufe0f<\/div>\n      <h2>Guest Verification<\/h2>\n      <p>\n        This ordering service is exclusively reserved for guests currently staying at Camping de l'\u00c9tang Philippe.\n      <\/p>\n      <p>\n        To access the form, an automatic verification of your guest access is required.\n      <\/p>\n\n      <button type=\"button\" class=\"geo-button\" id=\"checkLocationBtnPain\">\n        Verify my guest access\n      <\/button> \n\n      <div id=\"geoStatusPain\" class=\"geo-status\"><\/div>\n    <\/section>\n\n\n<!-- ==========================================================\n  PARTIE 3 \/ 5 \u2014 HTML FORMULAIRE DE COMMANDE\n  Source : main-page.html, uniquement le contenu utile du body\n  Le formulaire d\u00e9marre cach\u00e9 et s'affiche apr\u00e8s validation client.\n========================================================== -->\n<main class=\"app hidden\" id=\"orderAppPain\">\n       <section class=\"hero\">\n        <p class=\"eyebrow\">Camping de l'\u00c9tang Philippe<\/p>\n        <h1>Bread & pastry orders<\/h1>\n        <p>Collect your order at reception in the morning between 8:00 AM and 12:00 PM.<\/p>\n      <\/section>\n\n      <div class=\"notice\" id=\"cutoffNoticePain\">\n        \u23f0 Please order before 6:00 PM for the following morning.\n      <\/div> \n\n      <section class=\"card\" id=\"clientOrdersCardPain\">\n        <div class=\"section-title orders-section-title\">\n           <div class=\"orders-title-left\">\n            <h2>My current orders<\/h2>\n            <button type=\"button\" class=\"orders-action-button\" id=\"chooseModifyOrderBtnPain\" disabled=\"disabled\">\n              Edit\n            <\/button>\n          <\/div>\n          <small id=\"clientOrdersCountPain\">0 orders<\/small>\n        <\/div>\n\n        <div id=\"modifyOrdersPanelPain\" class=\"modify-orders-panel hidden\" aria-live=\"polite\">\n          <label for=\"modifyOrderSelectPain\">Order to edit<\/label>\n          <div class=\"modify-order-grid\">\n            <select id=\"modifyOrderSelectPain\"><\/select>\n            <button type=\"button\" class=\"orders-action-button\" id=\"startModifyOrderBtnPain\">\n              Edit this order\n            <\/button>\n          <\/div>\n          <p id=\"modifyOrdersHelpPain\" class=\"modify-orders-help\">\n            Select an order, then edit the items, quantities, or pickup date in the form.\n          <\/p> \n        <\/div>\n\n        <div id=\"clientOrdersPain\" class=\"orders-table\"><\/div>\n\n        <button type=\"button\" class=\"secondary-button\" id=\"refreshOrdersBtnPain\" style=\"margin-top:12px;\">\n           Refresh my orders\n        <\/button>\n      <\/section>\n\n      <form id=\"orderFormPain\">\n        <input class=\"hidden\" type=\"text\" id=\"websitePain\" name=\"website\" autocomplete=\"off\" tabindex=\"-1\">\n\n        <section class=\"card\">\n          <div class=\"grid two\">\n             <div>\n              <label for=\"clientNamePain\">Last name *<\/label>\n              <input id=\"clientNamePain\" name=\"clientName\" type=\"text\" autocomplete=\"name\" placeholder=\"E.g.: Smith\" required=\"\"\/>\n            <\/div>\n\n            <div>\n              <label for=\"locationNumberPain\">Pitch \/ Rental *<\/label>\n              <input id=\"locationNumberPain\" name=\"locationNumber\" type=\"text\" placeholder=\"E.g.: 42, Chalet 3...\" required=\"\"\/>\n            <\/div> \n          <\/div>\n\n          <div class=\"grid two\" style=\"margin-top:14px;\">\n            <div class=\"date-field-cell\">\n              <label for=\"pickupDateButtonPain\">Pickup date *<\/label>\n\n              <div class=\"date-picker-modern\" id=\"pickupDateModernPain\">\n                <input id=\"pickupDatePain\" name=\"pickupDate\" type=\"hidden\" required=\"\">\n\n                <button type=\"button\" id=\"pickupDateButtonPain\" class=\"date-modern-button\" aria-haspopup=\"dialog\" aria-expanded=\"false\" aria-controls=\"pickupCalendarPain\">\n                  <span class=\"date-modern-text\" id=\"pickupDateTextPain\">Choose a date<\/span>\n                  <span class=\"date-modern-icon\" aria-hidden=\"true\">\ud83d\udcc5<\/span>\n                <\/button>\n\n                <div class=\"date-calendar-popover hidden\" id=\"pickupCalendarPain\" role=\"dialog\" aria-label=\"Calendrier de retrait\">\n                  <div class=\"date-calendar-head\">\n                    <button type=\"button\" class=\"calendar-nav\" id=\"calendarPrevPain\" aria-label=\"Mois pr\u00e9c\u00e9dent\">\u2039<\/button>\n                    <strong id=\"calendarMonthLabelPain\">Month<\/strong>\n                    <button type=\"button\" class=\"calendar-nav\" id=\"calendarNextPain\" aria-label=\"Mois suivant\">\u203a<\/button>\n                  <\/div>\n\n                  <div class=\"date-calendar-weekdays\" aria-hidden=\"true\">\n                    <span>Mon<\/span>\n                    <span>Tue<\/span>\n                    <span>Wed<\/span>\n                    <span>Thu<\/span>\n                    <span>Fri<\/span>\n                    <span>Sat<\/span>\n                    <span>Sun<\/span>\n                  <\/div>\n\n                  <div class=\"date-calendar-days\" id=\"calendarDaysPain\"><\/div>\n\n                  <p class=\"date-calendar-help\">\n                     Select an available pickup date.\n                  <\/p>\n                <\/div>\n              <\/div>\n            <\/div>\n\n            <div>\n              <label for=\"phonePain\">Phone <span style=\"color:#6b7280;font-weight:700;\">optional<\/span><\/label>\n              <input id=\"phonePain\" name=\"phone\" type=\"tel\" autocomplete=\"tel\" placeholder=\"06...\">\n            <\/div>\n          <\/div>\n        <\/section>\n\n        <section class=\"card products-order-card is-products-loading\" id=\"productsOrderCardPain\" aria-busy=\"true\">\n           <div class=\"section-title\">\n            <h2>Your order<\/h2>\n            <small id=\"productCountPain\">0 items<\/small>\n          <\/div>\n\n          <p id=\"productsAdminStatusPain\" class=\"products-admin-status\">\n            Loading available items...\n          <\/p> \n\n          <div id=\"productsPain\"><\/div>\n        <\/section>\n\n        <section class=\"card\">\n          <label for=\"commentPain\">Notes <span style=\"color:#6b7280;font-weight:700;\">optional<\/span><\/label>\n          <textarea id=\"commentPain\" name=\"comment\" placeholder=\"E.g.: specific requests, preferences, inquiries...\"><\/textarea>\n\n          <div id=\"editModeNoticePain\" class=\"edit-mode-notice hidden\"><\/div>\n          <button type=\"button\" class=\"secondary-button cancel-edit-button hidden\" id=\"cancelEditOrderBtnPain\">\n            Cancel edit\n          <\/button> \n\n          <div id=\"statusPain\" class=\"status\"><\/div>\n        <\/section>\n      <\/form>\n    <\/main>\n\n\n<!-- ==========================================================\n  PARTIE 4 \/ 5 \u2014 HTML FOOTER FIXE DE COMMANDE\n  Source : main-page.html\n  Le footer d\u00e9marre cach\u00e9 et s'affiche apr\u00e8s validation client.\n========================================================== -->\n<footer class=\"footer hidden\" id=\"orderFooterPain\">\n      <div class=\"footer-inner\">\n         <div class=\"total\">\n          <strong id=\"totalQtyPain\">0<\/strong>\n          <small>item(s)<\/small>\n        <\/div>\n\n        <button class=\"submit\" id=\"submitBtnPain\" type=\"submit\" form=\"orderFormPain\" disabled=\"disabled\">\n          Confirm my order\n        <\/button> \n      <\/div>\n    <\/footer>\n\n<\/div>\n\n\n<!-- ==========================================================\n  PARTIE 5A \/ 5 \u2014 JS V\u00c9RIFICATION CLIENT\n  Source : verification.js\n  Adaptation :\n  - aucune redirection vers main-page.html\n  - affichage du formulaire directement dans ce bloc Elementor\n========================================================== -->\n<script>\n(function () {\n  var CAMPING_CENTER_LAT = 46.0281982422;\n  var CAMPING_CENTER_LNG = 2.82240009308;\n  var CAMPING_ALLOWED_RADIUS_METERS = 2000;\n\n  function toRadians(degrees) {\n    return degrees * Math.PI \/ 180;\n  }\n\n  function calculateDistanceMeters(lat1, lng1, lat2, lng2) {\n    var earthRadiusMeters = 6371000;\n    var dLat = toRadians(lat2 - lat1);\n    var dLng = toRadians(lng2 - lng1);\n    var a =\n      Math.sin(dLat \/ 2) * Math.sin(dLat \/ 2) +\n      Math.cos(toRadians(lat1)) *\n      Math.cos(toRadians(lat2)) *\n      Math.sin(dLng \/ 2) *\n      Math.sin(dLng \/ 2);\n\n    return earthRadiusMeters * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));\n  }\n\n  function setStatus(type, message) {\n    var status = document.getElementById(\"geoStatusPain\");\n\n    if (!status) {\n      return;\n    }\n\n    status.className = \"geo-status \" + (type || \"\");\n    status.innerHTML = message || \"\";\n  }\n\n  function setButtonState(disabled, label) {\n    var button = document.getElementById(\"checkLocationBtnPain\");\n\n    if (!button) {\n      return;\n    }\n\n    button.disabled = disabled;\n    button.textContent = label;\n  }\n\n  function allowAccess() {\n    sessionStorage.setItem(\"commandePainVerified\", \"1\");\n    setStatus(\"ok\", \"&#x2705; Acc\u00e8s client v\u00e9rifi\u00e9. Ouverture du formulaire...\");\n\n    var gate = document.getElementById(\"geoGatePain\");\n    var app = document.getElementById(\"orderAppPain\");\n    var footer = document.getElementById(\"orderFooterPain\");\n\n    setTimeout(function () {\n      if (gate) {\n        gate.classList.add(\"hidden\");\n      }\n\n      if (app) {\n        app.classList.remove(\"hidden\");\n      }\n\n      if (footer) {\n        footer.classList.remove(\"hidden\");\n      }\n\n      window.dispatchEvent(new CustomEvent(\"commandePainVerified\"));\n    }, 250);\n  }\n\n  function denyAccess(message) {\n    sessionStorage.removeItem(\"commandePainVerified\");\n    setStatus(\"err\", message);\n  }\n\n  function verifyLocation() {\n    if (!navigator.geolocation) {\n      denyAccess(\"&#x274c; Votre appareil ne permet pas de finaliser la v\u00e9rification client\u00e8le. Ce service est r\u00e9serv\u00e9 aux clients pr\u00e9sents au camping.\");\n      return;\n    }\n\n    setButtonState(true, \"V\u00e9rification en cours...\");\n    setStatus(\"info\", \"&#x1f3d5;&#xfe0f; V\u00e9rification de votre acc\u00e8s client en cours. Merci d'accepter la demande affich\u00e9e par votre navigateur.\");\n\n    navigator.geolocation.getCurrentPosition(\n      function (position) {\n        var distance = calculateDistanceMeters(\n          position.coords.latitude,\n          position.coords.longitude,\n          CAMPING_CENTER_LAT,\n          CAMPING_CENTER_LNG\n        );\n\n        if (distance <= CAMPING_ALLOWED_RADIUS_METERS) {\n          allowAccess();\n          return;\n        }\n\n        denyAccess(\"&#x274c; Acc\u00e8s refus\u00e9. Ce service est r\u00e9serv\u00e9 aux clients pr\u00e9sents au camping.\");\n        setButtonState(false, \"R\u00e9essayer la v\u00e9rification\");\n      },\n      function (error) {\n        var message = \"&#x274c; V\u00e9rification client\u00e8le impossible. Ce service est r\u00e9serv\u00e9 aux clients pr\u00e9sents au camping.\";\n\n        if (error.code === error.PERMISSION_DENIED) {\n          message = \"&#x274c; V\u00e9rification refus\u00e9e. Pour commander, vous devez autoriser la v\u00e9rification client afin d'acc\u00e9der au service.\";\n        }\n\n        if (error.code === error.POSITION_UNAVAILABLE) {\n          message = \"&#x274c; V\u00e9rification impossible pour le moment. Merci de r\u00e9essayer ou de contacter l'accueil.\";\n        }\n\n        if (error.code === error.TIMEOUT) {\n          message = \"&#x274c; La v\u00e9rification a pris trop de temps. Merci de r\u00e9essayer.\";\n        }\n\n        denyAccess(message);\n        setButtonState(false, \"R\u00e9essayer la v\u00e9rification\");\n      },\n      {\n        enableHighAccuracy: true,\n        timeout: 12000,\n        maximumAge: 0\n      }\n    );\n  }\n\n  function boot() {\n    var button = document.getElementById(\"checkLocationBtnPain\");\n    var gate = document.getElementById(\"geoGatePain\");\n    var app = document.getElementById(\"orderAppPain\");\n    var footer = document.getElementById(\"orderFooterPain\");\n\n    \/*\n      S\u00e9curit\u00e9 demand\u00e9e :\n      \u00e0 chaque rechargement de page, on force une nouvelle v\u00e9rification GPS.\n      On ne r\u00e9ouvre donc plus le formulaire automatiquement avec sessionStorage.\n    *\/\n    sessionStorage.removeItem(\"commandePainVerified\");\n\n    if (!button) {\n      return;\n    }\n\n    button.addEventListener(\"click\", verifyLocation);\n  }\n\n  if (document.readyState === \"loading\") {\n    document.addEventListener(\"DOMContentLoaded\", boot);\n  } else {\n    boot();\n  }\n})();\n<\/script>\n\n\n<!-- ==========================================================\n  PARTIE 5B \/ 5 \u2014 JS COMMANDE\n  Source : main.js\n  Adaptation :\n  - aucune redirection vers index.html\n  - fonctionnement dans le bloc unique Elementor\n========================================================== -->\n<script>\n(function () {\n  function bootCommandePainModule() {\n    var root = document.getElementById(\"commande-pain-site\");\n    var geoButton = document.getElementById(\"checkLocationBtnPain\");\n    var products = document.getElementById(\"productsPain\");\n    var form = document.getElementById(\"orderFormPain\");\n\n    if (!root || !products || !form) {\n      setTimeout(bootCommandePainModule, 150);\n      return;\n    }\n\n    if (root.dataset.commandePainLoaded === \"1\") {\n      return;\n    }\n\n    root.dataset.commandePainLoaded = \"1\";\n\n    try {\n      const APPS_SCRIPT_URL = \"https:\/\/script.google.com\/macros\/s\/AKfycbwK5KVjUzhiKskCVz1BCePKKHQnh9DKV-AWSzSAy5GRrhOnhwp7AC2apbzPPM2LcYbRfg\/exec\";\n\n      const PARIS_TIMEZONE = \"Europe\/Paris\";\n      const PICKUP_WINDOW_TEXT = \"8h - 12h\";\n      const LOCAL_STORAGE_ORDERS_KEY = \"camping_etang_philippe_pain_orders_v2\";\n      \/*\n        Les produits ne sont plus stock\u00e9s dans le HTML.\n        Le formulaire affiche uniquement les produits actifs charg\u00e9s depuis l'API Apps Script.\n      *\/\n      let PRODUCTS_PAIN = [];\n\n      const statePain = {\n        quantities: {},\n        orderingClosed: false,\n        editingOrderId: null,\n        editingOriginalPickupDate: \"\",\n        productsLoading: true,\n        productsLoadingSeq: 0\n      };\n\n      const calendarPain = {\n        viewYear: null,\n        viewMonth: null\n      };\n\n      const elsPain = {\n        products: document.getElementById(\"productsPain\"),\n        productsOrderCard: document.getElementById(\"productsOrderCardPain\"),\n        productCount: document.getElementById(\"productCountPain\"),\n        productsAdminStatus: document.getElementById(\"productsAdminStatusPain\"),\n        totalQty: document.getElementById(\"totalQtyPain\"),\n        submitBtn: document.getElementById(\"submitBtnPain\"),\n        status: document.getElementById(\"statusPain\"),\n        form: document.getElementById(\"orderFormPain\"),\n        cutoffNotice: document.getElementById(\"cutoffNoticePain\"),\n        clientOrders: document.getElementById(\"clientOrdersPain\"),\n        clientOrdersCount: document.getElementById(\"clientOrdersCountPain\"),\n        refreshOrdersBtn: document.getElementById(\"refreshOrdersBtnPain\"),\n        chooseModifyOrderBtn: document.getElementById(\"chooseModifyOrderBtnPain\"),\n        modifyOrdersPanel: document.getElementById(\"modifyOrdersPanelPain\"),\n        modifyOrderSelect: document.getElementById(\"modifyOrderSelectPain\"),\n        startModifyOrderBtn: document.getElementById(\"startModifyOrderBtnPain\"),\n        modifyOrdersHelp: document.getElementById(\"modifyOrdersHelpPain\"),\n        cancelEditOrderBtn: document.getElementById(\"cancelEditOrderBtnPain\"),\n        editModeNotice: document.getElementById(\"editModeNoticePain\"),\n        pickupDateInput: document.getElementById(\"pickupDatePain\"),\n        pickupDateButton: document.getElementById(\"pickupDateButtonPain\"),\n        pickupDateText: document.getElementById(\"pickupDateTextPain\"),\n        pickupCalendar: document.getElementById(\"pickupCalendarPain\"),\n        calendarPrev: document.getElementById(\"calendarPrevPain\"),\n        calendarNext: document.getElementById(\"calendarNextPain\"),\n        calendarMonthLabel: document.getElementById(\"calendarMonthLabelPain\"),\n        calendarDays: document.getElementById(\"calendarDaysPain\")\n      };\n\n      function getParisPartsPain() {\n        const parts = new Intl.DateTimeFormat(\"fr-FR\", {\n          timeZone: PARIS_TIMEZONE,\n          year: \"numeric\",\n          month: \"2-digit\",\n          day: \"2-digit\",\n          hour: \"2-digit\",\n          minute: \"2-digit\",\n          second: \"2-digit\",\n          hour12: false\n        }).formatToParts(new Date());\n\n        const out = {};\n\n        parts.forEach(function (part) {\n          if (part.type !== \"literal\") {\n            out[part.type] = Number(part.value);\n          }\n        });\n\n        return out;\n      }\n\n      function addDaysToYmdPain(year, month, day, daysToAdd) {\n        const date = new Date(Date.UTC(year, month - 1, day + daysToAdd));\n        const y = date.getUTCFullYear();\n        const m = String(date.getUTCMonth() + 1).padStart(2, \"0\");\n        const d = String(date.getUTCDate()).padStart(2, \"0\");\n\n        return y + \"-\" + m + \"-\" + d;\n      }\n\n      function getTomorrowParisDateKeyPain() {\n        const parts = getParisPartsPain();\n        return addDaysToYmdPain(parts.year, parts.month, parts.day, 1);\n      }\n\n      function getMinimumPickupDateKeyPain() {\n        const parts = getParisPartsPain();\n        const afterCutoff = parts.hour > 18 || (parts.hour === 18 ? parts.minute >= 0 : false);\n        return addDaysToYmdPain(parts.year, parts.month, parts.day, afterCutoff ? 2 : 1);\n      }\n\n      function isOrderingClosedPain() {\n        const parts = getParisPartsPain();\n        const pickupInput = document.getElementById(\"pickupDatePain\");\n        const pickupDate = pickupInput ? pickupInput.value : \"\";\n        const tomorrowKey = getTomorrowParisDateKeyPain();\n        const afterCutoff = parts.hour > 18 || (parts.hour === 18 ? parts.minute >= 0 : false);\n\n        \/*\n          Apr\u00e8s 18h, on bloque uniquement la commande pour le lendemain.\n          Exemple : dimanche 05\/07 \u00e0 19h19 => 06\/07 bloqu\u00e9, 07\/07 autoris\u00e9.\n        *\/\n        if (!pickupDate || pickupDate <= tomorrowKey) {\n          return afterCutoff;\n        }\n\n        return false;\n      }\n\n      function updateCutoffStatePain() {\n        statePain.orderingClosed = isOrderingClosedPain();\n\n        if (statePain.orderingClosed) {\n          elsPain.cutoffNotice.classList.add(\"closed-notice\");\n          elsPain.cutoffNotice.innerHTML =\n            \"&#x26d4; Les commandes pour demain sont ferm\u00e9es.<br>Apr\u00e8s 18h00, choisissez une date de retrait plus tardive pour passer commande.\";\n        } else {\n          elsPain.cutoffNotice.classList.remove(\"closed-notice\");\n          elsPain.cutoffNotice.innerHTML =\n            \"&#x23f0; Merci de commander avant 18h00 pour le lendemain matin. Les modifications et suppressions restent possibles jusqu'\u00e0 la veille du retrait avant 18h00.\";\n        }\n\n        updateTotalPain();\n      }\n\n      function euroPain(value) {\n        return new Intl.NumberFormat(\"fr-FR\", {\n          style: \"currency\",\n          currency: \"EUR\"\n        }).format(value || 0);\n      }\n\n      function escapeHtmlPain(value) {\n        return String(value || \"\").replace(\/[&<>\"]\/g, function (char) {\n          return {\n            \"&\": \"&amp;\",\n            \"<\": \"&lt;\",\n            \">\": \"&gt;\",\n            '\"': \"&quot;\"\n          }[char];\n        });\n      }\n\n      function cssSafePain(value) {\n        return String(value || \"\")\n          .toLowerCase()\n          .normalize(\"NFD\")\n          .replace(\/[\\u0300-\\u036f]\/g, \"\")\n          .replace(\/[^a-z0-9]+\/g, \"-\");\n      }\n\n      function getDatePartsFromKeyPain(dateKey) {\n        const match = String(dateKey || \"\").match(\/^(\\d{4})-(\\d{2})-(\\d{2})$\/);\n\n        if (!match) {\n          return null;\n        }\n\n        return {\n          year: Number(match[1]),\n          month: Number(match[2]),\n          day: Number(match[3])\n        };\n      }\n\n      function getDateKeyPain(year, month, day) {\n        return String(year).padStart(4, \"0\") + \"-\" +\n          String(month).padStart(2, \"0\") + \"-\" +\n          String(day).padStart(2, \"0\");\n      }\n\n      function formatDateButtonLabelPain(dateKey) {\n        const parts = getDatePartsFromKeyPain(dateKey);\n\n        if (!parts) {\n          return \"Choisir une date\";\n        }\n\n        return String(parts.day).padStart(2, \"0\") + \"\/\" +\n          String(parts.month).padStart(2, \"0\") + \"\/\" +\n          String(parts.year);\n      }\n\n      function getMonthLabelPain(year, month) {\n        const date = new Date(Date.UTC(year, month - 1, 1));\n\n        return new Intl.DateTimeFormat(\"fr-FR\", {\n          timeZone: \"UTC\",\n          month: \"long\",\n          year: \"numeric\"\n        }).format(date);\n      }\n\n      function updateDateButtonLabelPain() {\n        if (!elsPain.pickupDateInput || !elsPain.pickupDateText) {\n          return;\n        }\n\n        elsPain.pickupDateText.textContent = formatDateButtonLabelPain(elsPain.pickupDateInput.value);\n      }\n\n      function setCalendarViewFromDatePain(dateKey) {\n        const parts = getDatePartsFromKeyPain(dateKey) || getDatePartsFromKeyPain(getMinimumPickupDateKeyPain());\n\n        calendarPain.viewYear = parts.year;\n        calendarPain.viewMonth = parts.month;\n      }\n\n\n      function ensurePickupCalendarInBodyPain() {\n        if (!elsPain.pickupCalendar || !document.body) {\n          return;\n        }\n\n        if (elsPain.pickupCalendar.parentNode !== document.body) {\n          document.body.appendChild(elsPain.pickupCalendar);\n        }\n      }\n\n      function isCalendarOpenPain() {\n        return !!(elsPain.pickupCalendar ? !elsPain.pickupCalendar.classList.contains(\"hidden\") : false);\n      }\n\n      function closePickupCalendarPain() {\n        if (elsPain.pickupCalendar) {\n          elsPain.pickupCalendar.classList.add(\"hidden\");\n        }\n\n        if (elsPain.pickupDateButton) {\n          elsPain.pickupDateButton.setAttribute(\"aria-expanded\", \"false\");\n        }\n      }\n\n      function openPickupCalendarPain() {\n        if (!elsPain.pickupCalendar || !elsPain.pickupDateButton) {\n          return;\n        }\n\n        const footer = document.getElementById(\"orderFooterPain\");\n        if (footer) {\n          footer.style.setProperty(\"z-index\", \"90\", \"important\");\n        }\n\n        ensurePickupCalendarInBodyPain();\n        setCalendarViewFromDatePain(elsPain.pickupDateInput ? elsPain.pickupDateInput.value : \"\");\n        renderPickupCalendarPain();\n\n        elsPain.pickupCalendar.classList.remove(\"hidden\");\n        elsPain.pickupDateButton.setAttribute(\"aria-expanded\", \"true\");\n      }\n\n      function togglePickupCalendarPain() {\n        if (isCalendarOpenPain()) {\n          closePickupCalendarPain();\n        } else {\n          openPickupCalendarPain();\n        }\n      }\n\n      function selectPickupDatePain(dateKey) {\n        if (!elsPain.pickupDateInput) {\n          return;\n        }\n\n        elsPain.pickupDateInput.value = dateKey;\n        updateDateButtonLabelPain();\n        closePickupCalendarPain();\n        updateCutoffStatePain();\n        loadAvailableProductsPain(function () {\n          updateCutoffStatePain();\n        });\n\n        try {\n          elsPain.pickupDateInput.dispatchEvent(new Event(\"change\", { bubbles: true }));\n        } catch (error) { }\n      }\n\n      function renderPickupCalendarPain() {\n        if (!elsPain.calendarDays || !elsPain.calendarMonthLabel) {\n          return;\n        }\n\n        if (!calendarPain.viewYear || !calendarPain.viewMonth) {\n          setCalendarViewFromDatePain(elsPain.pickupDateInput ? elsPain.pickupDateInput.value : \"\");\n        }\n\n        const year = calendarPain.viewYear;\n        const month = calendarPain.viewMonth;\n        const selectedKey = elsPain.pickupDateInput ? elsPain.pickupDateInput.value : \"\";\n        const minKey = getMinimumPickupDateKeyPain();\n        const todayParts = getParisPartsPain();\n        const todayKey = getDateKeyPain(todayParts.year, todayParts.month, todayParts.day);\n        const firstDay = new Date(Date.UTC(year, month - 1, 1));\n        const daysInMonth = new Date(Date.UTC(year, month, 0)).getUTCDate();\n        const firstWeekdayMonday = (firstDay.getUTCDay() + 6) % 7;\n\n        elsPain.calendarMonthLabel.textContent = getMonthLabelPain(year, month);\n        elsPain.calendarDays.innerHTML = \"\";\n\n        for (let i = 0; i < firstWeekdayMonday; i++) {\n          const spacer = document.createElement(\"span\");\n          spacer.className = \"date-day-spacer\";\n          elsPain.calendarDays.appendChild(spacer);\n        }\n\n        for (let day = 1; day <= daysInMonth; day++) {\n          const dateKey = getDateKeyPain(year, month, day);\n          const button = document.createElement(\"button\");\n\n          button.type = \"button\";\n          button.className = \"date-day\";\n          button.textContent = String(day);\n          button.dataset.date = dateKey;\n\n          if (dateKey === selectedKey) {\n            button.classList.add(\"is-selected\");\n          }\n\n          if (dateKey === todayKey) {\n            button.classList.add(\"is-today\");\n          }\n\n          if (dateKey < minKey) {\n            button.classList.add(\"is-disabled\");\n            button.disabled = true;\n            button.setAttribute(\"aria-disabled\", \"true\");\n          }\n\n          button.addEventListener(\"click\", function () {\n            if (!button.disabled) {\n              selectPickupDatePain(dateKey);\n            }\n          });\n\n          elsPain.calendarDays.appendChild(button);\n        }\n      }\n\n      function changeCalendarMonthPain(delta) {\n        let year = calendarPain.viewYear;\n        let month = calendarPain.viewMonth + delta;\n\n        if (month < 1) {\n          month = 12;\n          year -= 1;\n        }\n\n        if (month > 12) {\n          month = 1;\n          year += 1;\n        }\n\n        calendarPain.viewYear = year;\n        calendarPain.viewMonth = month;\n\n        renderPickupCalendarPain();\n      }\n\n      function setDefaultDatePain() {\n        const input = elsPain.pickupDateInput || document.getElementById(\"pickupDatePain\");\n        const minKey = getMinimumPickupDateKeyPain();\n\n        if (!input) {\n          return;\n        }\n\n        input.min = minKey;\n\n        if (!input.value || input.value < minKey) {\n          input.value = minKey;\n        }\n\n        setCalendarViewFromDatePain(input.value);\n        updateDateButtonLabelPain();\n\n        if (isCalendarOpenPain()) {\n          renderPickupCalendarPain();\n        }\n      }\n\n      function setProductsAdminStatusPain(type, message) {\n        if (!elsPain.productsAdminStatus) {\n          return;\n        }\n\n        elsPain.productsAdminStatus.className = \"products-admin-status \" + (type || \"\");\n        elsPain.productsAdminStatus.innerHTML = message || \"\";\n      }\n\n      function setProductsLoadingPain(isLoading) {\n        statePain.productsLoading = isLoading === true;\n\n        if (elsPain.productsOrderCard) {\n          if (statePain.productsLoading) {\n            elsPain.productsOrderCard.classList.add(\"is-products-loading\");\n            elsPain.productsOrderCard.setAttribute(\"aria-busy\", \"true\");\n          } else {\n            elsPain.productsOrderCard.classList.remove(\"is-products-loading\");\n            elsPain.productsOrderCard.setAttribute(\"aria-busy\", \"false\");\n          }\n        }\n\n        if (elsPain.products) {\n          const controls = elsPain.products.querySelectorAll(\"button, input, select, textarea\");\n\n          controls.forEach(function (control) {\n            if (statePain.productsLoading) {\n              control.disabled = true;\n              control.setAttribute(\"aria-disabled\", \"true\");\n            } else {\n              control.removeAttribute(\"aria-disabled\");\n            }\n          });\n        }\n\n        updateTotalPain();\n      }\n\n      function isProductsLoadingPain() {\n        return statePain.productsLoading === true;\n      }\n\n      function normalizeProductListFromServerPain(productsRaw) {\n        const normalized = [];\n\n        if (!Array.isArray(productsRaw)) {\n          return normalized;\n        }\n\n        productsRaw.forEach(function (product, index) {\n          if (!product) {\n            return;\n          }\n\n          const name = cleanUndefinedPain(product.name || product.nom || \"\");\n          let price = Number(product.price || product.prix || 0);\n\n          if (!name) {\n            return;\n          }\n\n          if (!Number.isFinite(price)) {\n            price = 0;\n          }\n\n          price = Math.max(0, Number(price.toFixed(2)));\n\n          const globalLimit = normalizeAvailabilityLimitPain(product.globalLimit);\n          const reserved = normalizeReservedNumberPain(product.reserved);\n          let available = null;\n\n          if (globalLimit !== null) {\n            available = normalizeAvailabilityLimitPain(product.available);\n\n            if (available === null) {\n              available = Math.max(0, globalLimit - reserved);\n            }\n          }\n\n          normalized.push({\n            id: cleanUndefinedPain(product.id || cssSafePain(name) || (\"produit_\" + index)),\n            name: name,\n            price: price,\n            emoji: cleanProductEmojiPain(product.emoji || \"&#x1f956;\"),\n            description: cleanUndefinedPain(product.description || product.desc || name),\n            globalLimit: globalLimit,\n            unlimited: globalLimit === null,\n            reserved: reserved,\n            available: available,\n            unavailableDays: Array.isArray(product.unavailableDays) ? product.unavailableDays : [],\n            unavailableForDate: product.unavailableForDate === true,\n            unavailableDay: cleanUndefinedPain(product.unavailableDay || \"\"),\n            unavailableReason: cleanUndefinedPain(product.unavailableReason || \"\")\n          });\n        });\n\n        return normalized;\n      }\n\n      function normalizeReservedNumberPain(value) {\n        let numberValue = Number(value || 0);\n\n        if (!Number.isFinite(numberValue)) {\n          numberValue = 0;\n        }\n\n        return Math.max(0, Math.floor(numberValue));\n      }\n\n      function normalizeAvailabilityLimitPain(value) {\n        if (value === null || value === undefined) {\n          return null;\n        }\n\n        const textValue = String(value).trim().toLowerCase();\n\n        if (!textValue || textValue === \"illimit\u00e9\" || textValue === \"illimite\" || textValue === \"unlimited\" || textValue === \"\u221e\") {\n          return null;\n        }\n\n        const numberValue = Number(textValue.replace(\",\", \".\"));\n\n        if (!Number.isFinite(numberValue)) {\n          return null;\n        }\n\n        return Math.max(0, Math.floor(numberValue));\n      }\n\n      function getProductByNamePain(name) {\n        return PRODUCTS_PAIN.find(function (product) {\n          return product ? product.name === name : false;\n        }) || null;\n      }\n\n      function getProductAvailablePain(product) {\n        if (!product) {\n          return 0;\n        }\n\n        if (product.unavailableForDate === true) {\n          return 0;\n        }\n\n        if (product.unlimited === true || product.globalLimit === null) {\n          return null;\n        }\n\n        return normalizeAvailabilityLimitPain(product.available) || 0;\n      }\n\n      function getProductMaxQtyPain(product) {\n        const available = getProductAvailablePain(product);\n\n        if (available === null) {\n          return 15;\n        }\n\n        return Math.min(15, available);\n      }\n\n      function getProductMaxQtyByNamePain(name) {\n        return getProductMaxQtyPain(getProductByNamePain(name));\n      }\n\n      function getStockLabelPain(product) {\n        if (product ? product.unavailableForDate === true : false) {\n          return product.unavailableReason || \"Indisponible pour cette date\";\n        }\n\n        const available = getProductAvailablePain(product);\n\n        if (available === null) {\n          return \"\";\n        }\n\n        if (available <= 0) {\n          return \"Indisponible pour cette date\";\n        }\n\n        if (available === 1) {\n          return \"1 disponible pour cette date\";\n        }\n\n        return available + \" disponibles pour cette date\";\n      }\n\n      function getStockClassPain(product) {\n        if (product ? product.unavailableForDate === true : false) {\n          return \"is-empty\";\n        }\n\n        const available = getProductAvailablePain(product);\n\n        if (available === null) {\n          return \"\";\n        }\n\n        if (available <= 0) {\n          return \"is-empty\";\n        }\n\n        if (available < 5) {\n          return \"is-low\";\n        }\n\n        return \"\";\n      }\n\n      function replaceProductsPain(nextProducts, sourceLabel) {\n        const normalized = normalizeProductListFromServerPain(nextProducts);\n        const previousQuantities = statePain.quantities || {};\n\n        PRODUCTS_PAIN = normalized;\n        statePain.quantities = {};\n\n        PRODUCTS_PAIN.forEach(function (product) {\n          const previousQuantity = previousQuantities[product.name] || 0;\n          statePain.quantities[product.name] = Math.min(previousQuantity, getProductMaxQtyPain(product));\n        });\n\n        if (normalized.length > 0) {\n          setProductsAdminStatusPain(\"\", \"\");\n        } else {\n          setProductsAdminStatusPain(\"err\", \"&#x26a0;&#xfe0f; Aucun produit n'est disponible \u00e0 la commande pour le moment.\");\n        }\n\n        renderProductsPain();\n        updateTotalPain();\n        return true;\n      }\n\n      function loadAvailableProductsPain(done) {\n        setProductsAdminStatusPain(\"\", \"Chargement des produits disponibles...\");\n        statePain.productsLoadingSeq += 1;\n        const loadSeq = statePain.productsLoadingSeq;\n        setProductsLoadingPain(true);\n\n        const callbackName = \"commandePainProductsCallback_\" + Date.now() + \"_\" + Math.floor(Math.random() * 10000);\n        const script = document.createElement(\"script\");\n        let finished = false;\n\n        function finishProductsLoadPain(success) {\n          if (finished) {\n            return;\n          }\n\n          finished = true;\n\n          try {\n            delete window[callbackName];\n          } catch (error) {\n            window[callbackName] = undefined;\n          }\n\n          if (script ? !!script.parentNode : false) {\n            script.parentNode.removeChild(script);\n          }\n\n          if (!success) {\n            PRODUCTS_PAIN = [];\n            statePain.quantities = {};\n            setProductsAdminStatusPain(\"err\", \"&#x26a0;&#xfe0f; Impossible de charger les produits disponibles. Merci de r\u00e9essayer ou de contacter l'accueil.\");\n            renderProductsPain();\n            updateTotalPain();\n          }\n\n          if (loadSeq === statePain.productsLoadingSeq) {\n            setProductsLoadingPain(false);\n          }\n\n          if (typeof done === \"function\") {\n            done();\n          }\n        }\n\n        window[callbackName] = function (response) {\n          let success = false;\n\n          try {\n            if (response ? (response.ok ? Array.isArray(response.products) : false) : false) {\n              success = replaceProductsPain(response.products, response.updatedAt || \"admin\");\n            }\n          } catch (error) {\n            success = false;\n          }\n\n          finishProductsLoadPain(success);\n        };\n\n        script.onerror = function () {\n          finishProductsLoadPain(false);\n        };\n\n        const currentPickupDate = elsPain.pickupDateInput ? elsPain.pickupDateInput.value : \"\";\n        const currentOrderId = isEditModePain() ? statePain.editingOrderId : \"\";\n\n        script.src =\n          APPS_SCRIPT_URL +\n          \"?action=products&callback=\" +\n          encodeURIComponent(callbackName) +\n          \"&pickupDate=\" +\n          encodeURIComponent(currentPickupDate) +\n          \"&orderId=\" +\n          encodeURIComponent(currentOrderId) +\n          \"&_=\" +\n          encodeURIComponent(Date.now());\n\n        document.body.appendChild(script);\n      }\n\n      function reloadAvailableProductsPain() {\n        return new Promise(function (resolve) {\n          loadAvailableProductsPain(function () {\n            resolve(true);\n          });\n        });\n      }\n\n      function renderProductsPain() {\n        elsPain.productCount.textContent =\n          PRODUCTS_PAIN.length + \" produit\" + (PRODUCTS_PAIN.length > 1 ? \"s\" : \"\");\n\n        if (PRODUCTS_PAIN.length <= 0) {\n          elsPain.products.innerHTML = `\n            <div class=\"products-empty\">\n              Aucun produit n'est disponible \u00e0 la commande pour le moment.\n            <\/div>\n          `;\n          updateTotalPain();\n          return;\n        }\n\n        elsPain.products.innerHTML = PRODUCTS_PAIN.map(function (product) {\n          statePain.quantities[product.name] = statePain.quantities[product.name] || 0;\n\n          const maxQty = getProductMaxQtyPain(product);\n          const soldOut = maxQty <= 0;\n          const stockClass = getStockClassPain(product);\n          const stockText = getStockLabelPain(product);\n\n          if (statePain.quantities[product.name] > maxQty) {\n            statePain.quantities[product.name] = maxQty;\n          }\n\n          return `\n          <div class=\"product ${soldOut ? \"is-sold-out\" : \"\"}\" data-name=\"${escapeHtmlPain(product.name)}\">\n            <div>\n              <div class=\"product-name\">\n                <span class=\"emoji\">${escapeHtmlPain(cleanProductEmojiPain(product.emoji))}<\/span>\n                <span>${escapeHtmlPain(product.name)}<\/span>\n              <\/div>\n\n              ${product.description ? `<p class=\"desc\">${escapeHtmlPain(product.description)}<\/p>` : \"\"}\n              <p class=\"price\">Prix : ${euroPain(product.price)}<\/p>\n              ${stockText ? `<p class=\"stock-info ${escapeHtmlPain(stockClass)}\">${escapeHtmlPain(stockText)}<\/p>` : \"\"}\n            <\/div>\n\n            <div class=\"qty\" aria-label=\"Quantit\u00e9 ${escapeHtmlPain(product.name)}\">\n              <button type=\"button\" data-action=\"minus\" data-name=\"${escapeHtmlPain(product.name)}\" ${soldOut ? \"disabled\" : \"\"}>\u2212<\/button>\n              <input\n                id=\"qty-${cssSafePain(product.name)}\"\n                class=\"qty-input\"\n                type=\"number\"\n                inputmode=\"numeric\"\n                pattern=\"[0-9]*\"\n                autocomplete=\"off\"\n                min=\"0\"\n                max=\"${maxQty}\"\n                step=\"1\"\n                data-name=\"${escapeHtmlPain(product.name)}\"\n                aria-label=\"Quantit\u00e9 ${escapeHtmlPain(product.name)}\"\n                value=\"0\"\n                ${soldOut ? \"disabled\" : \"\"}\n              >\n              <button type=\"button\" data-action=\"plus\" data-name=\"${escapeHtmlPain(product.name)}\" ${soldOut ? \"disabled\" : \"\"}>+<\/button>\n            <\/div>\n          <\/div>\n        `;\n        }).join(\"\");\n\n        updateTotalPain();\n      }\n\n      function updateTotalPain() {\n        const total = Object.values(statePain.quantities).reduce(function (sum, qty) {\n          return sum + qty;\n        }, 0);\n\n        elsPain.totalQty.textContent = total;\n        const editClosed = isEditModePain() ? isClientActionClosedForPickupDatePain(statePain.editingOriginalPickupDate) : false;\n        const loadingProducts = isProductsLoadingPain();\n        elsPain.submitBtn.disabled = total <= 0 || statePain.orderingClosed || editClosed || loadingProducts;\n\n        PRODUCTS_PAIN.forEach(function (product) {\n          const maxQty = getProductMaxQtyPain(product);\n          let qty = statePain.quantities[product.name] || 0;\n\n          if (qty > maxQty) {\n            qty = maxQty;\n            statePain.quantities[product.name] = qty;\n          }\n\n          const target = document.getElementById(\"qty-\" + cssSafePain(product.name));\n\n          if (target) {\n            target.max = String(maxQty);\n            target.disabled = loadingProducts || maxQty <= 0;\n\n            if (\"value\" in target) {\n              if (document.activeElement !== target) {\n                target.value = String(qty);\n              }\n            } else {\n              target.textContent = qty;\n            }\n          }\n\n          if (elsPain.products) {\n            const productButtons = elsPain.products.querySelectorAll('button[data-name=\"' + String(product.name).replace(\/\"\/g, '\\\"') + '\"]');\n\n            productButtons.forEach(function (button) {\n              button.disabled = loadingProducts || maxQty <= 0;\n              if (button.disabled) {\n                button.setAttribute(\"aria-disabled\", \"true\");\n              } else {\n                button.removeAttribute(\"aria-disabled\");\n              }\n            });\n          }\n        });\n      }\n\n      function setStatusPain(type, message) {\n        elsPain.status.className = \"status \" + (type || \"\");\n        elsPain.status.innerHTML = message || \"\";\n\n        if (message) {\n          elsPain.status.scrollIntoView({\n            behavior: \"smooth\",\n            block: \"center\"\n          });\n        }\n      }\n\n      function generateOrderIdPain() {\n        return \"WEB-\" + Date.now() + \"-\" + Math.floor(Math.random() * 100000);\n      }\n\n      function loadClientOrdersPain() {\n        try {\n          return JSON.parse(localStorage.getItem(LOCAL_STORAGE_ORDERS_KEY) || \"[]\");\n        } catch (error) {\n          return [];\n        }\n      }\n\n      function saveClientOrdersPain(orders) {\n        localStorage.setItem(LOCAL_STORAGE_ORDERS_KEY, JSON.stringify(orders.slice(0, 30)));\n      }\n\n      function addClientOrderPain(order) {\n        const orders = loadClientOrdersPain();\n        orders.unshift(order);\n        saveClientOrdersPain(orders);\n        renderClientOrdersPain();\n      }\n\n      function cleanUndefinedPain(value) {\n        return String(value || \"\")\n          .replace(\/undefined\/g, \"\")\n          .replace(\/\\s+\/g, \" \")\n          .trim();\n      }\n\n      function cleanProductEmojiPain(value) {\n        const emoji = cleanUndefinedPain(value);\n\n        if (!emoji) {\n          return \"&#x1f956;\";\n        }\n\n        if (\/^\\d+$\/.test(emoji)) {\n          return \"&#x1f956;\";\n        }\n\n        return emoji;\n      }\n\n      function safePickupDatePain(value) {\n        const raw = String(value || \"\").trim();\n\n        if (!raw) {\n          return \"Date non disponible\";\n        }\n\n        \/\/ Corrige les anciennes commandes stock\u00e9es avec des morceaux \"undefined\"\n        \/\/ Exemple : 2undefined26-undefined7-undefined6 => 2026-07-06\n        const repaired = raw.replace(\/undefined\/g, \"0\");\n\n        const match = repaired.match(\/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$\/);\n\n        if (match) {\n          const year = match[1];\n          const month = String(Number(match[2])).padStart(2, \"0\");\n          const day = String(Number(match[3])).padStart(2, \"0\");\n\n          return day + \"\/\" + month + \"\/\" + year;\n        }\n\n        const fallbackMatch = raw.match(\/(\\d{4})[-\/](\\d{1,2})[-\/](\\d{1,2})\/);\n\n        if (fallbackMatch) {\n          const year = fallbackMatch[1];\n          const month = String(Number(fallbackMatch[2])).padStart(2, \"0\");\n          const day = String(Number(fallbackMatch[3])).padStart(2, \"0\");\n\n          return day + \"\/\" + month + \"\/\" + year;\n        }\n\n        return cleanUndefinedPain(raw) || \"Date non disponible\";\n      }\n\n      function safePickupWindowPain(value) {\n        const raw = String(value || \"\").trim();\n\n        if (!raw || raw.indexOf(\"undefined\") !== -1) {\n          return PICKUP_WINDOW_TEXT;\n        }\n\n        return cleanUndefinedPain(raw) || PICKUP_WINDOW_TEXT;\n      }\n\n      function safeProductsTextPain(value) {\n        return String(value || \"\")\n          .replace(\/\\s*undefined\\s*\/g, \" ; \")\n          .replace(\/\\s*;\\s*;\\s*\/g, \" ; \")\n          .replace(\/\\s+;\\s+\/g, \" ; \")\n          .replace(\/^(\\s*;\\s*)+|(\\s*;\\s*)+$\/g, \"\")\n          .trim() || \"Produits non disponibles\";\n      }\n\n\n      function isOrderRecoveredPain(order) {\n        if (!order) {\n          return false;\n        }\n\n        return order.paid === true;\n      }\n\n      \/* ==========================================================\n        MODULE MODIFICATION \/ SUPPRESSION CLIENT \u2014 JS ISOL\u00c9\n      ========================================================== *\/\n      function normalizeOrderPickupDatePain(value) {\n        const raw = String(value || \"\").trim();\n\n        if (!raw) {\n          return \"\";\n        }\n\n        const exact = raw.match(\/^(\\d{4})-(\\d{1,2})-(\\d{1,2})$\/);\n\n        if (exact) {\n          return exact[1] + \"-\" + String(Number(exact[2])).padStart(2, \"0\") + \"-\" + String(Number(exact[3])).padStart(2, \"0\");\n        }\n\n        const fallback = raw.match(\/(\\d{4})[-\/](\\d{1,2})[-\/](\\d{1,2})\/);\n\n        if (fallback) {\n          return fallback[1] + \"-\" + String(Number(fallback[2])).padStart(2, \"0\") + \"-\" + String(Number(fallback[3])).padStart(2, \"0\");\n        }\n\n        return raw;\n      }\n\n      function getPreviousDateKeyPain(dateKey) {\n        const parts = getDatePartsFromKeyPain(normalizeOrderPickupDatePain(dateKey));\n\n        if (!parts) {\n          return \"\";\n        }\n\n        return addDaysToYmdPain(parts.year, parts.month, parts.day, -1);\n      }\n\n      function isClientActionClosedForPickupDatePain(pickupDate) {\n        const dateKey = normalizeOrderPickupDatePain(pickupDate);\n        const deadlineDayKey = getPreviousDateKeyPain(dateKey);\n\n        if (!deadlineDayKey) {\n          return true;\n        }\n\n        const parts = getParisPartsPain();\n        const todayKey = getDateKeyPain(parts.year, parts.month, parts.day);\n        const afterCutoff = parts.hour > 18 || (parts.hour === 18 ? parts.minute >= 0 : false);\n\n        if (todayKey < deadlineDayKey) {\n          return false;\n        }\n\n        if (todayKey > deadlineDayKey) {\n          return true;\n        }\n\n        return afterCutoff;\n      }\n\n      function isEditModePain() {\n        return !!statePain.editingOrderId;\n      }\n\n      function getClientOrderByIdPain(orderId) {\n        return loadClientOrdersPain().find(function (order) {\n          return order ? order.orderId === orderId : false;\n        }) || null;\n      }\n\n      function replaceClientOrderPain(orderId, nextOrder) {\n        let found = false;\n        const orders = loadClientOrdersPain().map(function (order) {\n          if (order ? order.orderId === orderId : false) {\n            found = true;\n            return Object.assign({}, order, nextOrder);\n          }\n\n          return order;\n        });\n\n        if (!found) {\n          orders.unshift(nextOrder);\n        }\n\n        saveClientOrdersPain(orders);\n        renderClientOrdersPain();\n      }\n\n      function removeClientOrderLocalPain(orderId) {\n        const orders = loadClientOrdersPain().filter(function (order) {\n          return order ? order.orderId !== orderId : false;\n        });\n\n        saveClientOrdersPain(orders);\n\n        if (statePain.editingOrderId === orderId) {\n          cancelEditOrderPain(false);\n        }\n\n        renderClientOrdersPain();\n      }\n\n      function parseItemsFromProductsTextPain(productsText) {\n        const text = safeProductsTextPain(productsText);\n\n        if (!text || text === \"Produits non disponibles\") {\n          return [];\n        }\n\n        return text.split(\";\").map(function (part) {\n          const cleaned = part.trim();\n          const match = cleaned.match(\/^(.*?)\\s+x\\s*(\\d+)$\/i);\n\n          if (!match) {\n            return null;\n          }\n\n          const productName = cleanUndefinedPain(match[1]);\n          const product = PRODUCTS_PAIN.find(function (item) {\n            return item.name === productName;\n          });\n          const quantity = Math.max(0, Math.min(getProductMaxQtyPain(product), Number(match[2] || 0)));\n\n          if (!product || quantity <= 0) {\n            return null;\n          }\n\n          return {\n            id: product.id,\n            name: product.name,\n            quantity: quantity,\n            price: product.price,\n            lineTotal: Number((quantity * product.price).toFixed(2))\n          };\n        }).filter(Boolean);\n      }\n\n      function getOrderItemsPain(order) {\n        if (order ? (Array.isArray(order.items) ? order.items.length : false) : false) {\n          return order.items.map(function (item) {\n            const product = PRODUCTS_PAIN.find(function (productItem) {\n              return productItem.name === item.name;\n            });\n\n            if (!product) {\n              return null;\n            }\n\n            const quantity = Math.max(0, Math.min(getProductMaxQtyPain(product), Number(item.quantity || 0)));\n\n            if (quantity <= 0) {\n              return null;\n            }\n\n            return {\n              id: product.id,\n              name: product.name,\n              quantity: quantity,\n              price: product.price,\n              lineTotal: Number((quantity * product.price).toFixed(2))\n            };\n          }).filter(Boolean);\n        }\n\n        return parseItemsFromProductsTextPain(order ? order.productsText : \"\");\n      }\n\n      function buildSelectedItemsPain() {\n        return PRODUCTS_PAIN.map(function (product) {\n          const quantity = Math.min(statePain.quantities[product.name] || 0, getProductMaxQtyPain(product));\n          const lineTotal = Number((quantity * product.price).toFixed(2));\n\n          return {\n            id: product.id,\n            name: product.name,\n            quantity: quantity,\n            price: product.price,\n            lineTotal: lineTotal\n          };\n        }).filter(function (item) {\n          return item.quantity > 0;\n        });\n      }\n\n      function updateModifyOrderControlsPain(orders) {\n        const list = Array.isArray(orders) ? orders : loadClientOrdersPain();\n        const hasOrders = list.length > 0;\n\n        if (elsPain.chooseModifyOrderBtn) {\n          elsPain.chooseModifyOrderBtn.disabled = !hasOrders;\n          elsPain.chooseModifyOrderBtn.classList.toggle(\"is-disabled\", !hasOrders);\n        }\n\n        if (!hasOrders ? !!elsPain.modifyOrdersPanel : false) {\n          elsPain.modifyOrdersPanel.classList.add(\"hidden\");\n        }\n      }\n\n      function renderModifyOrderOptionsPain() {\n        const orders = loadClientOrdersPain();\n\n        updateModifyOrderControlsPain(orders);\n\n        if (!elsPain.modifyOrderSelect || !elsPain.startModifyOrderBtn || !elsPain.modifyOrdersHelp) {\n          return;\n        }\n\n        const editableOrders = orders.filter(function (order) {\n          return order ? (order.orderId ? !isClientActionClosedForPickupDatePain(order.pickupDate) : false) : false;\n        });\n\n        elsPain.modifyOrderSelect.innerHTML = \"\";\n\n        if (!editableOrders.length) {\n          elsPain.modifyOrderSelect.disabled = true;\n          elsPain.startModifyOrderBtn.disabled = true;\n          elsPain.startModifyOrderBtn.classList.add(\"is-disabled\");\n          elsPain.modifyOrdersHelp.textContent = \"Aucune modification possible : le d\u00e9lai est d\u00e9pass\u00e9 pour les commandes enregistr\u00e9es. Les modifications ferment la veille du retrait \u00e0 18h00.\";\n          return;\n        }\n\n        editableOrders.forEach(function (order) {\n          const option = document.createElement(\"option\");\n          option.value = order.orderId;\n          option.textContent = safePickupDatePain(order.pickupDate) + \" \u2014 \" + (cleanUndefinedPain(order.clientName) || \"Client\") + \" \u2014 \" + safeProductsTextPain(order.productsText);\n          elsPain.modifyOrderSelect.appendChild(option);\n        });\n\n        elsPain.modifyOrderSelect.disabled = false;\n        elsPain.startModifyOrderBtn.disabled = false;\n        elsPain.startModifyOrderBtn.classList.remove(\"is-disabled\");\n        elsPain.modifyOrdersHelp.textContent = \"Choisissez une commande, puis modifiez les produits, les quantit\u00e9s ou la date de retrait dans le formulaire.\";\n      }\n\n      function showModifyOrderPanelPain() {\n        if (!elsPain.modifyOrdersPanel) {\n          return;\n        }\n\n        if (elsPain.modifyOrdersPanel.classList.contains(\"hidden\")) {\n          renderModifyOrderOptionsPain();\n          elsPain.modifyOrdersPanel.classList.remove(\"hidden\");\n          return;\n        }\n\n        elsPain.modifyOrdersPanel.classList.add(\"hidden\");\n      }\n\n      function setEditModeNoticePain(order) {\n        if (!elsPain.editModeNotice) {\n          return;\n        }\n\n        if (!order) {\n          elsPain.editModeNotice.classList.add(\"hidden\");\n          elsPain.editModeNotice.innerHTML = \"\";\n          return;\n        }\n\n        elsPain.editModeNotice.classList.remove(\"hidden\");\n        elsPain.editModeNotice.innerHTML =\n          \"&#x270f;&#xfe0f; Modification en cours pour la commande du <strong>\" +\n          escapeHtmlPain(safePickupDatePain(order.pickupDate)) +\n          \"<\/strong>. Les changements remplaceront automatiquement cette commande.\";\n      }\n\n      function startEditOrderPain(orderId) {\n        const order = getClientOrderByIdPain(orderId);\n\n        if (!order) {\n          setStatusPain(\"err\", \"&#x274c; Commande introuvable sur cet appareil. Actualisez vos commandes puis r\u00e9essayez.\");\n          return;\n        }\n\n        if (isClientActionClosedForPickupDatePain(order.pickupDate)) {\n          setStatusPain(\"err\", \"&#x26d4; Modification impossible : le d\u00e9lai est d\u00e9pass\u00e9. Les modifications ferment la veille du retrait \u00e0 18h00.\");\n          renderModifyOrderOptionsPain();\n          return;\n        }\n\n        statePain.editingOrderId = order.orderId;\n        statePain.editingOriginalPickupDate = normalizeOrderPickupDatePain(order.pickupDate);\n\n        const clientNameInput = document.getElementById(\"clientNamePain\");\n        const locationInput = document.getElementById(\"locationNumberPain\");\n        const phoneInput = document.getElementById(\"phonePain\");\n        const commentInput = document.getElementById(\"commentPain\");\n\n        if (clientNameInput) clientNameInput.value = cleanUndefinedPain(order.clientName);\n        if (locationInput) locationInput.value = cleanUndefinedPain(order.locationNumber);\n        if (phoneInput) phoneInput.value = cleanUndefinedPain(order.phone);\n        if (commentInput) commentInput.value = cleanUndefinedPain(order.comment);\n\n        if (elsPain.pickupDateInput) {\n          elsPain.pickupDateInput.value = normalizeOrderPickupDatePain(order.pickupDate) || getMinimumPickupDateKeyPain();\n          setCalendarViewFromDatePain(elsPain.pickupDateInput.value);\n          updateDateButtonLabelPain();\n        }\n\n        loadAvailableProductsPain(function () {\n          statePain.quantities = {};\n          PRODUCTS_PAIN.forEach(function (product) {\n            statePain.quantities[product.name] = 0;\n          });\n\n          getOrderItemsPain(order).forEach(function (item) {\n            statePain.quantities[item.name] = item.quantity;\n          });\n\n          if (elsPain.submitBtn) {\n            elsPain.submitBtn.textContent = \"Enregistrer la modification\";\n          }\n\n          if (elsPain.cancelEditOrderBtn) {\n            elsPain.cancelEditOrderBtn.classList.remove(\"hidden\");\n          }\n\n          if (elsPain.modifyOrdersPanel) {\n            elsPain.modifyOrdersPanel.classList.add(\"hidden\");\n          }\n\n          setEditModeNoticePain(order);\n          updateCutoffStatePain();\n          updateTotalPain();\n          setStatusPain(\"info\", \"&#x270f;&#xfe0f; Modifiez la commande puis cliquez sur <strong>Enregistrer la modification<\/strong>.\");\n\n          if (elsPain.form) {\n            elsPain.form.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n          }\n        });\n      }\n\n      function cancelEditOrderPain(showMessage) {\n        statePain.editingOrderId = null;\n        statePain.editingOriginalPickupDate = \"\";\n\n        if (elsPain.form) {\n          elsPain.form.reset();\n        }\n\n        setDefaultDatePain();\n\n        statePain.quantities = {};\n        PRODUCTS_PAIN.forEach(function (product) {\n          statePain.quantities[product.name] = 0;\n        });\n\n        if (elsPain.submitBtn) {\n          elsPain.submitBtn.textContent = \"Valider ma commande\";\n        }\n\n        if (elsPain.cancelEditOrderBtn) {\n          elsPain.cancelEditOrderBtn.classList.add(\"hidden\");\n        }\n\n        setEditModeNoticePain(null);\n        updateTotalPain();\n\n        if (showMessage !== false) {\n          setStatusPain(\"info\", \"Modification annul\u00e9e.\");\n        }\n      }\n\n      async function deleteClientOrderPain(orderId, triggerButton) {\n        const order = getClientOrderByIdPain(orderId);\n\n        if (!order) {\n          setStatusPain(\"err\", \"&#x274c; Commande introuvable sur cet appareil. Actualisez vos commandes puis r\u00e9essayez.\");\n          return;\n        }\n\n        if (isClientActionClosedForPickupDatePain(order.pickupDate)) {\n          setStatusPain(\"err\", \"&#x26d4; Suppression impossible : le d\u00e9lai est d\u00e9pass\u00e9. Les suppressions ferment la veille du retrait \u00e0 18h00.\");\n          renderClientOrdersPain();\n          return;\n        }\n\n        const confirmed = window.confirm(\"Supprimer cette commande ?\");\n\n        if (!confirmed) {\n          return;\n        }\n\n        if (triggerButton) {\n          triggerButton.disabled = true;\n          triggerButton.textContent = \"\u2026\";\n        }\n\n        const payload = {\n          action: \"delete\",\n          orderId: order.orderId,\n          originalPickupDate: normalizeOrderPickupDatePain(order.pickupDate),\n          pickupDate: normalizeOrderPickupDatePain(order.pickupDate),\n          source: window.location.href,\n          verificationClientValidee: true\n        };\n\n        try {\n          await fetch(APPS_SCRIPT_URL, {\n            method: \"POST\",\n            mode: \"no-cors\",\n            headers: {\n              \"Content-Type\": \"text\/plain;charset=utf-8\"\n            },\n            body: JSON.stringify(payload)\n          });\n\n          removeClientOrderLocalPain(order.orderId);\n          setStatusPain(\"ok\", \"&#x2705; Commande supprim\u00e9e.\");\n\n          setTimeout(function () {\n            refreshClientOrderStatusesPain();\n            loadAvailableProductsPain(function () {\n              updateTotalPain();\n            });\n          }, 1200);\n        } catch (error) {\n          setStatusPain(\"err\", \"&#x274c; Impossible de supprimer la commande. Merci de r\u00e9essayer ou de contacter l'accueil.\");\n          renderClientOrdersPain();\n        }\n      }\n\n      function renderClientOrdersPain() {\n        const orders = loadClientOrdersPain();\n\n        elsPain.clientOrdersCount.textContent =\n          orders.length + \" commande\" + (orders.length > 1 ? \"s\" : \"\");\n\n        updateModifyOrderControlsPain(orders);\n\n        if (!orders.length) {\n          elsPain.clientOrders.innerHTML = `\n          <div class=\"order-row\">\n            <div class=\"order-details\">\n              <strong>Aucune commande enregistr\u00e9e sur cet appareil.<\/strong>\n              <span>Vos prochaines commandes appara\u00eetront ici apr\u00e8s validation.<\/span>\n            <\/div>\n          <\/div>\n        `;\n          return;\n        }\n\n        elsPain.clientOrders.innerHTML = orders.map(function (order) {\n          const recovered = isOrderRecoveredPain(order);\n          const badgeClass = recovered ? \"ok\" : \"warning\";\n          const statusText = recovered ? \"Termin\u00e9 &#x2705;\" : \"\u00c0 r\u00e9cup\u00e9rer &#x26a0;&#xfe0f;\";\n          const safeClientName = cleanUndefinedPain(order.clientName) || \"Client\";\n          const safeLocationNumber = cleanUndefinedPain(order.locationNumber) || \"Emplacement non renseign\u00e9\";\n          const safeDate = safePickupDatePain(order.pickupDate);\n          const safeWindow = safePickupWindowPain(order.pickupWindow);\n          const safeProducts = safeProductsTextPain(order.productsText);\n          const actionClosed = isClientActionClosedForPickupDatePain(order.pickupDate);\n          const deleteTitle = actionClosed ? \"Suppression ferm\u00e9e : d\u00e9lai d\u00e9pass\u00e9\" : \"Supprimer cette commande\";\n\n          return `\n          <article class=\"order-row\" data-order-id=\"${escapeHtmlPain(order.orderId)}\">\n            <div class=\"order-head\">\n              <div class=\"order-title\">${escapeHtmlPain(safeClientName)} \u2014 ${escapeHtmlPain(safeLocationNumber)}<\/div>\n              <div class=\"order-actions\">\n                <span class=\"badge ${badgeClass}\">${statusText}<\/span>\n                <button type=\"button\" class=\"order-delete-btn\" data-order-action=\"delete\" data-order-id=\"${escapeHtmlPain(order.orderId)}\" aria-label=\"Supprimer cette commande\" title=\"${escapeHtmlPain(deleteTitle)}\" ${actionClosed ? \"disabled\" : \"\"}>\u00d7<\/button>\n              <\/div>\n            <\/div>\n\n            <div class=\"order-details\">\n              <span><strong>Date retrait :<\/strong> ${escapeHtmlPain(safeDate)} \u2014 ${escapeHtmlPain(safeWindow)}<\/span>\n              <span><strong>Produits :<\/strong> ${escapeHtmlPain(safeProducts)}<\/span>\n              <span class=\"order-total-line\"><strong>Total d\u00fb :<\/strong> <span class=\"order-total-amount\">${euroPain(order.total)}<\/span><\/span>\n              ${actionClosed ? `<span class=\"order-action-lock-note\">Modification et suppression ferm\u00e9es pour cette commande.<\/span>` : \"\"}\n            <\/div>\n          <\/article>\n        `;\n        }).join(\"\");\n\n        if (elsPain.modifyOrdersPanel ? !elsPain.modifyOrdersPanel.classList.contains(\"hidden\") : false) {\n          renderModifyOrderOptionsPain();\n        }\n      }\n\n      function updateClientOrderStatusesPain(statuses) {\n        const orders = loadClientOrdersPain();\n        const statusMap = statuses || {};\n\n        const updated = orders.filter(function (order) {\n          const orderId = order ? (order.orderId ? order.orderId : \"\") : \"\";\n\n          if (!orderId) {\n            return false;\n          }\n\n          if (!Object.prototype.hasOwnProperty.call(statusMap, orderId)) {\n            return true;\n          }\n\n          const remote = statusMap[orderId];\n\n          if (remote ? (remote.exists === false || remote.deleted === true) : false) {\n            return false;\n          }\n\n          if (remote) {\n            if (remote.clientName !== undefined) order.clientName = remote.clientName;\n            if (remote.locationNumber !== undefined) order.locationNumber = remote.locationNumber;\n            if (remote.pickupDate !== undefined) order.pickupDate = remote.pickupDate;\n            if (remote.pickupWindow !== undefined) order.pickupWindow = remote.pickupWindow;\n            if (remote.productsText !== undefined) order.productsText = remote.productsText;\n            if (remote.total !== undefined) order.total = Number(remote.total || 0);\n            if (Array.isArray(remote.items)) order.items = remote.items;\n            if (remote.comment !== undefined) order.comment = remote.comment;\n            if (remote.cb !== undefined) order.cb = remote.cb === true;\n            if (remote.cash !== undefined) order.cash = remote.cash === true;\n\n            if (remote.paid !== undefined) {\n              order.paid = remote.paid === true;\n            } else {\n              order.paid = false;\n            }\n\n            order.status = order.paid === true ? \"Termin\u00e9 &#x2705;\" : \"\u00c0 r\u00e9cup\u00e9rer &#x26a0;&#xfe0f;\";\n          }\n\n          return true;\n        });\n\n        saveClientOrdersPain(updated);\n        renderClientOrdersPain();\n      }\n\n      function setRefreshOrdersLoadingPain(isLoading) {\n        if (!elsPain.refreshOrdersBtn) {\n          return;\n        }\n\n        if (isLoading) {\n          elsPain.refreshOrdersBtn.disabled = true;\n          elsPain.refreshOrdersBtn.classList.add(\"is-loading\");\n          elsPain.refreshOrdersBtn.dataset.originalText = elsPain.refreshOrdersBtn.dataset.originalText || \"Actualiser mes commandes\";\n          elsPain.refreshOrdersBtn.textContent = \"Actualisation en cours\";\n          return;\n        }\n\n        elsPain.refreshOrdersBtn.disabled = false;\n        elsPain.refreshOrdersBtn.classList.remove(\"is-loading\");\n        elsPain.refreshOrdersBtn.textContent = elsPain.refreshOrdersBtn.dataset.originalText || \"Actualiser mes commandes\";\n      }\n\n      function refreshClientOrderStatusesPain(options) {\n        const shouldShowLoading = !!(options ? options.showLoading : false);\n        const doneCallback = options ? options.done : null;\n        let refreshFinished = false;\n\n        function finishRefreshLoadingPain() {\n          if (refreshFinished) {\n            return;\n          }\n\n          refreshFinished = true;\n\n          if (shouldShowLoading) {\n            setRefreshOrdersLoadingPain(false);\n          }\n\n          if (typeof doneCallback === \"function\") {\n            doneCallback();\n          }\n        }\n\n        if (shouldShowLoading) {\n          setRefreshOrdersLoadingPain(true);\n        }\n\n        const orders = loadClientOrdersPain();\n\n        if (!orders.length) {\n          renderClientOrdersPain();\n          finishRefreshLoadingPain();\n          return;\n        }\n\n        const orderIds = orders.map(function (order) {\n          return order.orderId;\n        }).filter(Boolean);\n\n        if (!orderIds.length) {\n          finishRefreshLoadingPain();\n          return;\n        }\n\n        const callbackName = \"commandePainStatusCallback_\" + Date.now() + \"_\" + Math.floor(Math.random() * 10000);\n\n        window[callbackName] = function (response) {\n          try {\n            if (response ? (response.ok ? !!response.statuses : false) : false) {\n              updateClientOrderStatusesPain(response.statuses);\n            } else {\n              renderClientOrdersPain();\n            }\n          } finally {\n            finishRefreshLoadingPain();\n            delete window[callbackName];\n\n            if (script ? !!script.parentNode : false) {\n              script.parentNode.removeChild(script);\n            }\n          }\n        };\n\n        const script = document.createElement(\"script\");\n        script.src =\n          APPS_SCRIPT_URL +\n          \"?action=status&callback=\" +\n          encodeURIComponent(callbackName) +\n          \"&orderIds=\" +\n          encodeURIComponent(orderIds.join(\",\")) +\n          \"&_=\" +\n          encodeURIComponent(Date.now());\n\n        script.onerror = function () {\n          finishRefreshLoadingPain();\n          delete window[callbackName];\n\n          if (script ? !!script.parentNode : false) {\n            script.parentNode.removeChild(script);\n          }\n        };\n\n        document.body.appendChild(script);\n      }\n\n      function refreshClientOrdersAndProductsPain(options) {\n        const shouldShowLoading = !!(options ? options.showLoading : false);\n\n        if (shouldShowLoading) {\n          setRefreshOrdersLoadingPain(true);\n        }\n\n        loadAvailableProductsPain(function () {\n          refreshClientOrderStatusesPain({\n            showLoading: false,\n            done: function () {\n              if (shouldShowLoading) {\n                setRefreshOrdersLoadingPain(false);\n              }\n            }\n          });\n        });\n      }\n\n      elsPain.refreshOrdersBtn.addEventListener(\"click\", function () {\n        refreshClientOrdersAndProductsPain({ showLoading: true });\n      });\n\n      if (elsPain.chooseModifyOrderBtn) {\n        elsPain.chooseModifyOrderBtn.addEventListener(\"click\", function () {\n          showModifyOrderPanelPain();\n        });\n      }\n\n      if (elsPain.startModifyOrderBtn) {\n        elsPain.startModifyOrderBtn.addEventListener(\"click\", function () {\n          const orderId = elsPain.modifyOrderSelect ? elsPain.modifyOrderSelect.value : \"\";\n\n          if (orderId) {\n            startEditOrderPain(orderId);\n          }\n        });\n      }\n\n      if (elsPain.cancelEditOrderBtn) {\n        elsPain.cancelEditOrderBtn.addEventListener(\"click\", function () {\n          cancelEditOrderPain(true);\n        });\n      }\n\n      if (elsPain.clientOrders) {\n        elsPain.clientOrders.addEventListener(\"click\", function (event) {\n          const deleteButton = event.target.closest(\"button[data-order-action='delete']\");\n\n          if (!deleteButton) {\n            return;\n          }\n\n          const orderId = deleteButton.dataset.orderId || \"\";\n\n          if (orderId) {\n            deleteClientOrderPain(orderId, deleteButton);\n          }\n        });\n      }\n\n      const pickupDateInputPain = elsPain.pickupDateInput || document.getElementById(\"pickupDatePain\");\n\n      if (pickupDateInputPain) {\n        pickupDateInputPain.addEventListener(\"change\", function () {\n          setDefaultDatePain();\n          updateCutoffStatePain();\n          loadAvailableProductsPain(function () {\n            updateTotalPain();\n          });\n        });\n      }\n\n      if (elsPain.pickupDateButton) {\n        elsPain.pickupDateButton.addEventListener(\"click\", function (event) {\n          event.preventDefault();\n          togglePickupCalendarPain();\n        });\n      }\n\n      if (elsPain.calendarPrev) {\n        elsPain.calendarPrev.addEventListener(\"click\", function (event) {\n          event.preventDefault();\n          changeCalendarMonthPain(-1);\n        });\n      }\n\n      if (elsPain.calendarNext) {\n        elsPain.calendarNext.addEventListener(\"click\", function (event) {\n          event.preventDefault();\n          changeCalendarMonthPain(1);\n        });\n      }\n\n      document.addEventListener(\"click\", function (event) {\n        const wrapper = document.getElementById(\"pickupDateModernPain\");\n        const calendar = document.getElementById(\"pickupCalendarPain\");\n\n        if (\n          !wrapper ||\n          wrapper.contains(event.target) ||\n          (calendar ? calendar.contains(event.target) : false)\n        ) {\n          return;\n        }\n\n        closePickupCalendarPain();\n      });\n\n      document.addEventListener(\"keydown\", function (event) {\n        if (event.key === \"Escape\") {\n          closePickupCalendarPain();\n        }\n      });\n\n      elsPain.products.addEventListener(\"click\", function (event) {\n        const btn = event.target.closest(\"button[data-action]\");\n\n        if (!btn) return;\n\n        if (isProductsLoadingPain()) {\n          setStatusPain(\"info\", \"&#x23f3; Chargement des produits en cours. Merci de patienter.\");\n          return;\n        }\n\n        updateCutoffStatePain();\n\n        if (statePain.orderingClosed) {\n          setStatusPain(\"err\", \"&#x26d4; Les commandes sont ferm\u00e9es apr\u00e8s 18h00 pour une r\u00e9cup\u00e9ration le lendemain.\");\n          return;\n        }\n\n        const name = btn.dataset.name;\n        const current = statePain.quantities[name] || 0;\n        const maxQty = getProductMaxQtyByNamePain(name);\n\n        if (btn.dataset.action === \"plus\") {\n          if (maxQty <= 0) {\n            setStatusPain(\"err\", \"&#x274c; Ce produit n'est plus disponible pour cette date.\");\n            return;\n          }\n\n          if (current >= maxQty) {\n            setStatusPain(\"err\", \"&#x274c; Quantit\u00e9 disponible atteinte pour ce produit.\");\n            return;\n          }\n\n          statePain.quantities[name] = Math.min(maxQty, current + 1);\n        } else {\n          statePain.quantities[name] = Math.max(0, current - 1);\n        }\n\n        updateTotalPain();\n      });\n\n      function applyManualQuantityPain(input) {\n        if (!input || !input.classList || !input.classList.contains(\"qty-input\")) {\n          return;\n        }\n\n        if (isProductsLoadingPain()) {\n          setStatusPain(\"info\", \"&#x23f3; Chargement des produits en cours. Merci de patienter.\");\n          return;\n        }\n\n        updateCutoffStatePain();\n\n        const name = input.dataset.name;\n\n        if (!name) {\n          return;\n        }\n\n        if (statePain.orderingClosed) {\n          input.value = String(statePain.quantities[name] || 0);\n          setStatusPain(\"err\", \"&#x26d4; Les commandes sont ferm\u00e9es apr\u00e8s 18h00 pour une r\u00e9cup\u00e9ration le lendemain.\");\n          return;\n        }\n\n        let raw = String(input.value || \"\");\n\n        raw = raw.replace(\/[^\\d]\/g, \"\").slice(0, 2);\n\n        let quantity = raw === \"\" ? 0 : Number(raw);\n\n        if (!Number.isFinite(quantity)) {\n          quantity = 0;\n        }\n\n        quantity = Math.max(0, Math.min(getProductMaxQtyByNamePain(name), Math.floor(quantity)));\n\n        statePain.quantities[name] = quantity;\n        input.value = String(quantity);\n        updateTotalPain();\n      }\n\n      elsPain.products.addEventListener(\"keydown\", function (event) {\n        const input = event.target.closest(\".qty-input[data-name]\");\n\n        if (!input) {\n          return;\n        }\n\n        const allowedKeys = [\n          \"Backspace\",\n          \"Delete\",\n          \"ArrowLeft\",\n          \"ArrowRight\",\n          \"ArrowUp\",\n          \"ArrowDown\",\n          \"Tab\",\n          \"Home\",\n          \"End\",\n          \"Enter\"\n        ];\n\n        if (\n          allowedKeys.indexOf(event.key) !== -1 ||\n          event.ctrlKey ||\n          event.metaKey\n        ) {\n          return;\n        }\n\n        if (!\/^[0-9]$\/.test(event.key)) {\n          event.preventDefault();\n        }\n      });\n\n      elsPain.products.addEventListener(\"focusin\", function (event) {\n        const input = event.target.closest(\".qty-input[data-name]\");\n\n        if (!input) {\n          return;\n        }\n\n        setTimeout(function () {\n          input.select();\n        }, 0);\n      });\n\n      elsPain.products.addEventListener(\"input\", function (event) {\n        const input = event.target.closest(\".qty-input[data-name]\");\n\n        if (!input) {\n          return;\n        }\n\n        const name = input.dataset.name;\n\n        if (!name) {\n          return;\n        }\n\n        let raw = String(input.value || \"\").replace(\/[^\\d]\/g, \"\").slice(0, 2);\n\n        input.value = raw;\n\n        const quantity = raw === \"\" ? 0 : Math.max(0, Math.min(getProductMaxQtyByNamePain(name), Number(raw)));\n\n        statePain.quantities[name] = quantity;\n        updateTotalPain();\n      });\n\n      elsPain.products.addEventListener(\"change\", function (event) {\n        applyManualQuantityPain(event.target.closest(\".qty-input[data-name]\"));\n      });\n\n      elsPain.products.addEventListener(\"blur\", function (event) {\n        applyManualQuantityPain(event.target.closest(\".qty-input[data-name]\"));\n      }, true);\n\n      elsPain.products.addEventListener(\"paste\", function (event) {\n        const input = event.target.closest(\".qty-input[data-name]\");\n\n        if (!input) {\n          return;\n        }\n\n        event.preventDefault();\n\n        const text = (event.clipboardData || window.clipboardData).getData(\"text\") || \"\";\n        input.value = text.replace(\/[^\\d]\/g, \"\").slice(0, 2);\n        applyManualQuantityPain(input);\n      });\n\n      elsPain.form.addEventListener(\"submit\", async function (event) {\n        event.preventDefault();\n\n        setStatusPain(\"\", \"\");\n\n        if (isProductsLoadingPain()) {\n          setStatusPain(\"info\", \"&#x23f3; Chargement des produits en cours. Merci de patienter.\");\n          return;\n        }\n\n        updateCutoffStatePain();\n\n        if (statePain.orderingClosed) {\n          setStatusPain(\"err\", \"&#x26d4; Les commandes pour demain sont ferm\u00e9es apr\u00e8s 18h00. Choisissez une date de retrait plus tardive pour passer commande.\");\n          return;\n        }\n\n        const clientName = document.getElementById(\"clientNamePain\").value.trim();\n        const locationNumber = document.getElementById(\"locationNumberPain\").value.trim();\n        const pickupDate = document.getElementById(\"pickupDatePain\").value;\n        const phone = document.getElementById(\"phonePain\").value.trim();\n        const comment = document.getElementById(\"commentPain\").value.trim();\n        const website = document.getElementById(\"websitePain\").value.trim();\n\n        if (website) {\n          setStatusPain(\"err\", \"&#x274c; Commande refus\u00e9e.\");\n          return;\n        }\n\n        if (!clientName || !locationNumber || !pickupDate) {\n          setStatusPain(\"err\", \"&#x274c; Merci de renseigner votre nom, votre emplacement ou location, et la date de retrait.\");\n          return;\n        }\n\n        await reloadAvailableProductsPain();\n\n        const selectedItems = buildSelectedItemsPain();\n\n        if (selectedItems.length === 0) {\n          setStatusPain(\"err\", \"&#x274c; Merci de choisir au moins un produit.\");\n          return;\n        }\n\n        const total = Number(selectedItems.reduce(function (sum, item) {\n          return sum + item.lineTotal;\n        }, 0).toFixed(2));\n\n        const editing = isEditModePain();\n        const existingOrder = editing ? getClientOrderByIdPain(statePain.editingOrderId) : null;\n        const orderId = editing ? statePain.editingOrderId : generateOrderIdPain();\n\n        if (editing ? isClientActionClosedForPickupDatePain(statePain.editingOriginalPickupDate) : false) {\n          setStatusPain(\"err\", \"&#x26d4; Modification impossible : le d\u00e9lai est d\u00e9pass\u00e9. Les modifications ferment la veille du retrait \u00e0 18h00.\");\n          return;\n        }\n\n        const payload = {\n          action: editing ? \"update\" : \"create\",\n          orderId: orderId,\n          originalPickupDate: editing ? statePain.editingOriginalPickupDate : \"\",\n          createdAt: new Date().toISOString(),\n\n          nom: clientName,\n          hebergement: \"Camping\",\n          numero: locationNumber,\n          telephone: phone,\n          dateRetrait: pickupDate,\n          note: comment,\n          items: selectedItems,\n          total: total,\n          source: window.location.href,\n\n          clientName: clientName,\n          locationNumber: locationNumber,\n          pickupDate: pickupDate,\n          phone: phone,\n          comment: comment,\n          website: website,\n\n          verificationClientValidee: true\n        };\n\n        elsPain.submitBtn.disabled = true;\n        elsPain.submitBtn.textContent = editing ? \"Modification en cours...\" : \"Envoi en cours...\";\n\n        try {\n          await fetch(APPS_SCRIPT_URL, {\n            method: \"POST\",\n            mode: \"no-cors\",\n            headers: {\n              \"Content-Type\": \"text\/plain;charset=utf-8\"\n            },\n            body: JSON.stringify(payload)\n          });\n\n          const productsText = selectedItems.map(function (item) {\n            return item.name + \" x\" + item.quantity;\n          }).join(\" ; \");\n\n          const nextOrder = {\n            orderId: orderId,\n            clientName: clientName,\n            locationNumber: locationNumber,\n            pickupDate: pickupDate,\n            pickupWindow: PICKUP_WINDOW_TEXT,\n            productsText: productsText,\n            items: selectedItems,\n            phone: phone,\n            comment: comment,\n            total: total,\n            status: \"\u00c0 r\u00e9cup\u00e9rer &#x26a0;&#xfe0f;\",\n            paid: false,\n            createdAt: existingOrder ? (existingOrder.createdAt ? existingOrder.createdAt : new Date().toISOString()) : new Date().toISOString()\n          };\n\n          if (editing) {\n            replaceClientOrderPain(orderId, nextOrder);\n          } else {\n            addClientOrderPain(nextOrder);\n          }\n\n          setStatusPain(\n            \"ok\",\n            (editing ? \"&#x2705; Commande modifi\u00e9e.\" : \"&#x2705; Commande envoy\u00e9e.\") + \"<br><br><strong>\" + selectedItems.reduce(function (sum, item) {\n              return sum + item.quantity;\n            }, 0) + \" article(s)<\/strong> pour le <strong>\" + pickupDate + \"<\/strong> entre <strong>8h et 12h<\/strong>.\"\n          );\n\n          elsPain.form.reset();\n\n          if (editing) {\n            statePain.editingOrderId = null;\n            statePain.editingOriginalPickupDate = \"\";\n            setEditModeNoticePain(null);\n\n            if (elsPain.cancelEditOrderBtn) {\n              elsPain.cancelEditOrderBtn.classList.add(\"hidden\");\n            }\n          }\n\n          setDefaultDatePain();\n\n          statePain.quantities = {};\n          PRODUCTS_PAIN.forEach(function (product) {\n            statePain.quantities[product.name] = 0;\n          });\n\n          updateTotalPain();\n          renderClientOrdersPain();\n\n          setTimeout(function () {\n            refreshClientOrderStatusesPain();\n            loadAvailableProductsPain(function () {\n              updateTotalPain();\n            });\n          }, 1200);\n        } catch (error) {\n          setStatusPain(\"err\", editing ? \"&#x274c; Impossible de modifier la commande. Merci de r\u00e9essayer ou de contacter l'accueil.\" : \"&#x274c; Impossible d'envoyer la commande. Merci de r\u00e9essayer ou de contacter l'accueil.\");\n        }\n\n        elsPain.submitBtn.textContent = isEditModePain() ? \"Enregistrer la modification\" : \"Valider ma commande\";\n        updateTotalPain();\n      });\n\n      function refreshClientOrdersOnReturnPain() {\n        refreshClientOrderStatusesPain();\n      }\n\n      setDefaultDatePain();\n      if (elsPain.productCount) {\n        elsPain.productCount.textContent = \"...\";\n      }\n      if (elsPain.products) {\n        elsPain.products.innerHTML = '<div class=\"products-empty\">Chargement des produits disponibles...<\/div>';\n      }\n      setProductsLoadingPain(true);\n      renderClientOrdersPain();\n      updateCutoffStatePain();\n      loadAvailableProductsPain(function () {\n        renderClientOrdersPain();\n        updateCutoffStatePain();\n        refreshClientOrderStatusesPain();\n      });\n\n      window.addEventListener(\"pageshow\", function () {\n        refreshClientOrdersOnReturnPain();\n      });\n\n      window.addEventListener(\"focus\", function () {\n        refreshClientOrdersOnReturnPain();\n      });\n\n      document.addEventListener(\"visibilitychange\", function () {\n        if (!document.hidden) {\n          refreshClientOrdersOnReturnPain();\n        }\n      });\n\n      window.addEventListener(\"commandePainVerified\", function () {\n        refreshClientOrdersOnReturnPain();\n      });\n\n      setInterval(function () {\n        setDefaultDatePain();\n        updateCutoffStatePain();\n      }, 30000);\n\n      \/* Statut client : pas de surveillance constante.\n         Le bouton Actualiser mes commandes relit les statuts depuis le script. *\/\n    } catch (error) {\n      console.error(\"Commande pain - erreur d'initialisation :\", error);\n      root.dataset.commandePainLoaded = \"0\";\n\n      var status = document.getElementById(\"geoStatusPain\");\n      if (status) {\n        status.className = \"geo-status err\";\n        status.innerHTML = \"&#x274c; Le module de commande n'a pas pu d\u00e9marrer. Merci de contacter l'accueil.\";\n      }\n    }\n  }\n\n  if (document.readyState === \"loading\") {\n    document.addEventListener(\"DOMContentLoaded\", bootCommandePainModule);\n  } else {\n    bootCommandePainModule();\n  }\n})();\n<\/script>\n\n\n\n<!-- ==========================================================\n  PARTIE 5C \/ 5 \u2014 JS MOBILE WPCODE : MASQUER RETURN TO TOP\n  Objectif : masquer uniquement sur la page o\u00f9 le module est pr\u00e9sent\n  le bouton th\u00e8me <a id=\"return-to-top\"> qui g\u00eane le footer.\n  Aucun MutationObserver pour \u00e9viter les boucles mobile.\n========================================================== -->\n<script>\n(function () {\n  function hideThemeReturnToTopPain() {\n    var root = document.getElementById(\"commande-pain-site\");\n\n    if (!root) {\n      return;\n    }\n\n    if (document.body) {\n      document.body.classList.add(\"commande-pain-active\");\n    }\n\n    var returnButton = document.getElementById(\"return-to-top\");\n\n    if (!returnButton) {\n      return;\n    }\n\n    returnButton.style.setProperty(\"display\", \"none\", \"important\");\n    returnButton.style.setProperty(\"visibility\", \"hidden\", \"important\");\n    returnButton.style.setProperty(\"opacity\", \"0\", \"important\");\n    returnButton.style.setProperty(\"pointer-events\", \"none\", \"important\");\n    returnButton.style.setProperty(\"z-index\", \"-1\", \"important\");\n    returnButton.setAttribute(\"aria-hidden\", \"true\");\n    returnButton.setAttribute(\"tabindex\", \"-1\");\n  }\n\n  function bootReturnToTopFixPain() {\n    hideThemeReturnToTopPain();\n\n    var delays = [150, 500, 1000, 2000, 3500];\n\n    delays.forEach(function (delay) {\n      window.setTimeout(hideThemeReturnToTopPain, delay);\n    });\n  }\n\n  if (document.readyState === \"loading\") {\n    document.addEventListener(\"DOMContentLoaded\", bootReturnToTopFixPain);\n  } else {\n    bootReturnToTopFixPain();\n  }\n\n  window.addEventListener(\"commandePainVerified\", hideThemeReturnToTopPain);\n  window.addEventListener(\"resize\", hideThemeReturnToTopPain);\n})();\n<\/script>\n\n\n<!-- ==========================================================\n  NOTE WPCODE : ancien correctif JS de surveillance Elementor supprim\u00e9.\n  La correction des grilles est maintenant uniquement CSS pour \u00e9viter les boucles mobile.\n========================================================== -->\n\n\n\n<!-- ==========================================================\n  FIN DU BLOC UNIQUE COMMANDE PAIN\n========================================================== -->\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\ud83c\udfd5\ufe0f Guest Verification This ordering service is exclusively reserved for guests currently staying at Camping de l&#8217;\u00c9tang Philippe. To access the form, an automatic verification of your guest access is required. Verify my guest access Camping de l&#8217;\u00c9tang Philippe Bread &#038; pastry orders Collect your order at reception in the morning between 8:00 AM and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"vierge","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Exclusive Orders for Camping \u00c9tang Philippe","_seopress_titles_desc":"Order your morning bread and pastries at Camping de l'\u00c9tang Philippe. Guest verification required to access the order form.","_seopress_robots_index":"","_gt_witbooking_room_id":"","inline_featured_image":false,"gt_fse_maillage_image":"","gt_fse_maillage_titre":"Auto draft","gt_fse_maillage_alt":"Auto draft","gt_fse_maillage_resume":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-4258","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/pages\/4258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/comments?post=4258"}],"version-history":[{"count":1,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/pages\/4258\/revisions"}],"predecessor-version":[{"id":4260,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/pages\/4258\/revisions\/4260"}],"wp:attachment":[{"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/media?parent=4258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/categories?post=4258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.camping-etang-philippe.fr\/en\/wp-json\/wp\/v2\/tags?post=4258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}