/* Anti-rafraîchissement temporaire sur mobile : appliqué UNIQUEMENT pendant
   l'ouverture de la fenêtre; le site reprend son comportement normal après. */
html.nj-custom-scroll-locked,
body.nj-custom-scroll-locked {
  overscroll-behavior: none !important;
  overscroll-behavior-y: none !important;
  overflow: hidden !important;
}
/* NJIBLEK — fenêtre de personnalisation v4, 15/11/2026
   Design de la fiche article de référence. Styles limités à .nj-custom-*/
.nj-custom-overlay {
  z-index: 10050 !important;
  background: rgba(22, 25, 31, .66) !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  overscroll-behavior: none !important;
}
.nj-custom-modal {
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  position: relative !important;
  width: min(100%, 540px) !important;
  max-width: 540px !important;
  height: min(820px, calc(100vh - 24px)) !important;
  height: min(820px, calc(100dvh - 24px)) !important;
  max-height: calc(100vh - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 23px !important;
  background: #fff !important;
  box-shadow: 0 20px 58px rgba(0, 0, 0, .24) !important;
  overflow: hidden !important;
  text-align: left !important;
}
/* v3 — react-responsive-modal ajoute une div FocusTrap entre le modal et
   notre composant. Sans hauteur explicite, cette div prend la hauteur totale
   du contenu, pousse le footer sous l'écran et interdit le défilement.
   On préserve le piège à focus et on fixe sa hauteur au viewport du modal. */
.nj-custom-modal > div {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
}
.nj-custom-product,
.nj-custom-product * { box-sizing: border-box; }
.nj-custom-product {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  color: #282c3f !important;
  font: 400 15px/1.42 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  letter-spacing: normal !important;
}
.nj-custom-product-header {
  flex: 0 0 auto;
  min-width: 0;
  padding: 13px 15px 8px;
}
.nj-custom-image-frame {
  width: 100%;
  height: clamp(140px, 25vh, 225px);
  height: clamp(140px, 25dvh, 225px);
  overflow: hidden;
  border-radius: 14px;
  background: #fafafa;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Les images des restaurants peuvent déjà intégrer leur logo et bandeau rouge.
   On conserve donc la photo COMPLÈTE : pas de recadrage, de zoom ni de bandeau dupliqué. */
.nj-custom-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
}
.nj-custom-product-meta { padding: 11px 3px 4px; min-width: 0; }
.nj-custom-title {
  margin: 0 0 3px !important;
  padding: 0 !important;
  color: #282c3f !important;
  font-family: inherit !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  line-height: 1.28 !important;
  text-transform: none !important;
  letter-spacing: -.012em !important;
  overflow-wrap: anywhere;
}
.nj-custom-price-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.nj-custom-base-price {
  color: #303545 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  white-space: nowrap;
}
.nj-custom-personalizable {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #62ad84 !important;
}
.nj-custom-addon-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 2px 16px 15px;
  touch-action: pan-y !important;
  scroll-behavior: auto;
}
.nj-addon-category {
  padding: 10px 0 13px;
  margin: 0 !important;
  border-top: 1px solid #e4e6eb;
}
.nj-addon-category:first-child { border-top: 0; padding-top: 6px; }
.nj-addon-category-title {
  display: block !important;
  margin: 0 0 7px !important;
  padding: 9px 10px !important;
  background: #f1f2f4 !important;
  color: #303341 !important;
  border: none !important;
  border-radius: 9px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  overflow-wrap: anywhere;
}
.nj-addon-options {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 9px;
  align-items: start;
}
.nj-addon-option {
  display: flex !important;
  align-items: center !important;
  min-height: 43px;
  min-width: 0;
  gap: 8px;
  margin: 0 !important;
  padding: 7px 8px !important;
  color: #303545 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-transform: none !important;
  cursor: pointer;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  background: transparent;
  overflow-wrap: anywhere;
}
.nj-addon-option:hover { background: #f5f8fd; }
.nj-addon-option--selected { background: #f3f8ff; }
.nj-addon-option--disabled { opacity: .5; cursor: not-allowed; }
.nj-addon-option-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nj-addon-option-price { display: inline; font-size: 12px; font-weight: 500; color: #747986; white-space: nowrap; }
.nj-addon-option input[type='checkbox'],
.nj-addon-option input[type='radio'] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  position: static !important;
  display: block !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  flex: 0 0 20px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  cursor: inherit;
  accent-color: #1681f5 !important;
  vertical-align: middle !important;
  box-shadow: none !important;
}
.nj-custom-footer {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  gap: 9px !important;
  min-width: 0;
  padding: 11px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px solid #e5e7eb !important;
  background: #fff !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, .025);
}
.nj-custom-total {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 1px !important;
  margin: 0 !important;
  min-width: 0;
  color: #33394a !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
}
.nj-custom-total strong {
  display: block;
  color: #252a38 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nj-custom-actions { display: flex !important; gap: 7px !important; flex: 0 0 auto; align-items: stretch; }
.nj-custom-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 41px !important;
  height: 41px !important;
  margin: 0 !important;
  padding: 0 11px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: nowrap;
  border-radius: 10px !important;
  cursor: pointer !important;
  touch-action: manipulation;
  box-shadow: none !important;
}
.nj-custom-cancel { color: #353c4b !important; background: #fff !important; border: 1px solid #a7aeba !important; }
.nj-custom-confirm { color: #fff !important; background: #4384ed !important; border: 1px solid #4384ed !important; }
.nj-custom-actions button:focus-visible,
.nj-addon-option input:focus-visible { outline: 2px solid #126ce0 !important; outline-offset: 3px; }
@media (max-width: 460px) {
  .nj-custom-overlay { padding: 9px !important; }
  .nj-custom-modal {
    width: calc(100vw - 18px) !important;
    max-width: calc(100vw - 18px) !important;
    height: min(790px, calc(100vh - 18px)) !important;
    height: min(790px, calc(100dvh - 18px)) !important;
    max-height: calc(100dvh - 18px) !important;
    border-radius: 19px !important;
  }
  .nj-custom-product-header { padding: 10px 11px 7px; }
  .nj-custom-image-frame { height: clamp(125px, 23dvh, 205px); border-radius: 12px; }
  .nj-custom-title { font-size: 18px !important; }
  .nj-custom-base-price { font-size: 15px !important; }
  .nj-custom-addon-scroll { padding: 2px 11px 11px; }
  .nj-addon-options { grid-template-columns: 1fr; gap: 0; }
  .nj-addon-category-title { font-size: 14px !important; }
  .nj-addon-option { min-height: 42px; padding: 7px 8px !important; font-size: 14px !important; }
  .nj-custom-footer { padding: 10px 11px calc(10px + env(safe-area-inset-bottom, 0px)) !important; }
  .nj-custom-total strong { font-size: 18px !important; }
  .nj-custom-actions button { font-size: 13px !important; padding: 0 10px !important; }
}
@media (max-width: 340px) {
  .nj-custom-total strong { font-size: 16px !important; }
  .nj-custom-actions button { font-size: 12px !important; padding: 0 7px !important; }
}
@media (max-height: 625px) {
  .nj-custom-image-frame { height: clamp(75px, 17dvh, 125px); }
  .nj-custom-product-header { padding-top: 8px; }
  .nj-custom-title { font-size: 16px !important; }
  .nj-custom-footer { padding-top: 8px !important; padding-bottom: 8px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .nj-custom-modal { animation: none !important; }
}
