/* EasyChat Order AI v1.11.0 build64 — FCS Franck Chemla Software © 2026 */

/* ---- Bulle flottante ---- */
#ppos-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  background: #1E3A8A;
  color: #fff;
  border-radius: 50px;
  padding: 13px 22px 13px 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
  font-family: 'Poppins', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: transform .15s, box-shadow .15s;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
}
#ppos-chat-bubble:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.28); }
#ppos-bubble-label { white-space: nowrap; }
#ppos-notif {
  background: #e53e3e;
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin-left: 2px;
}

/* ---- Panneau principal ---- */
#ppos-chat-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9999;
  width: 380px;
  max-height: 750px;
  height: 750px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  font-family: 'Poppins', Arial, sans-serif;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

/* ---- Header ---- */
#ppos-chat-header {
  background: #00182A;
  color: #fff;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#ppos-chat-header-left { display: flex; align-items: center; gap: 11px; }

#ppos-header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #1E3A8A;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#ppos-header-avatar svg { width: 20px; height: 20px; }

#ppos-chat-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
}
#ppos-chat-status {
  font-size: 11px;
  color: #aab4be;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
#ppos-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22C55E;
  display: inline-block;
  animation: ppos-pulse 2s infinite;
}
@keyframes ppos-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#ppos-chat-header .ppos-header-actions {
  display: flex; align-items: center; gap: 6px;
}
#ppos-chat-reset, #ppos-chat-close {
  background: rgba(255,255,255,0.10);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#ppos-chat-reset:hover, #ppos-chat-close:hover { background: rgba(255,255,255,0.2); }

/* ---- Handle resize ---- */
#ppos-resize-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 20px;
  cursor: ns-resize;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  user-select: none;
}
#ppos-resize-handle:hover { background: #e2e8f0; }

/* ---- Corps ---- */
#ppos-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F4F7FB;
}
#ppos-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---- Mini-panier ---- */
#ppos-cart-preview {
  flex-shrink: 0;
  background: #00182A;
  border-bottom: 2px solid #0a2540;
  padding: 10px 14px;
}
#ppos-cart-title {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  gap: 5px;
  margin-bottom: 6px;
  cursor: pointer;
}
.ppos-cart-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #cbd5e0;
  padding: 3px 0;
  border-bottom: 1px solid #1e3a5f;
  gap: 6px;
}
.ppos-cart-item:last-of-type { border-bottom: none; }
.ppos-cart-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ppos-cart-item-price { font-weight: 600; color: #fff; white-space: nowrap; flex-shrink: 0; }
#ppos-cart-total { font-size: 13px; font-weight: 700; color: #fff; text-align: right; margin-top: 6px; }
#ppos-btn-checkout {
  width: 100%; margin-top: 10px; padding: 10px;
  background: #1E3A8A; color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
#ppos-btn-checkout:hover { background: #2d4f9f; }

/* ---- Messages bulles ---- */
.ppos-msg { display: flex; gap: 7px; max-width: 88%; }
.ppos-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.ppos-msg-av {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
.ppos-msg.bot .ppos-msg-av { background: #E2EAF4; color: #1E3A8A; }
.ppos-msg.user .ppos-msg-av { background: #1E3A8A; color: #fff; }

.ppos-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.6;
}
.ppos-msg.bot .ppos-msg-bubble {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #1a202c;
  border-radius: 3px 14px 14px 14px;
}
.ppos-msg.user .ppos-msg-bubble {
  background: #bbf7d0;
  color: #166534;
  border-radius: 14px 3px 14px 14px;
}

/* Horodatage */
.ppos-msg-time {
  font-size: 10px;
  color: #94a3b8;
  text-align: right;
  margin-top: 2px;
  padding-right: 2px;
}

/* ---- Cartes options (déclinaisons produit) ---- */
.ppos-attr-item {
  font-family: 'Poppins', sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 13px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ppos-attr-item:hover { border-color: #1E3A8A; }
.ppos-attr-item.selected {
  border: 2px solid #1E3A8A;
  box-shadow: 0 0 0 1px rgba(30,58,138,0.08);
}

.ppos-attr-letter {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #E2EAF4;
  color: #1E3A8A;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.ppos-attr-item.selected .ppos-attr-letter {
  background: #1E3A8A;
  color: #fff;
}

.ppos-attr-info { flex: 1; min-width: 0; }
.ppos-attr-name {
  font-size: 12px; font-weight: 600;
  color: #1a202c;
  transition: color 0.15s;
}
.ppos-attr-item.selected .ppos-attr-name { color: #1E3A8A; }
.ppos-attr-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.ppos-attr-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.ppos-attr-item.selected .ppos-attr-check {
  background: #1E3A8A;
  border-color: #1E3A8A;
}
.ppos-attr-check svg { display: none; }
.ppos-attr-item.selected .ppos-attr-check svg { display: block; }

/* ---- Carte promo ---- */
.ppos-promo-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #1a202c;
  line-height: 1.5;
  max-width: 88%;
}
.ppos-promo-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.ppos-promo-body { flex: 1; }
.ppos-promo-cat { color: #1E3A8A; font-weight: 700; }
.ppos-promo-free { color: #22C55E; font-weight: 700; }
.ppos-promo-time { font-size: 10px; color: #94a3b8; white-space: nowrap; flex-shrink: 0; align-self: flex-end; }

/* ---- Chips (catégories / boutons rapides) ---- */
.ppos-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.ppos-chip {
  padding: 5px 12px;
  border: 1.5px solid #1E3A8A;
  border-radius: 20px;
  font-size: 11px;
  color: #1E3A8A;
  cursor: pointer;
  background: #fff;
  transition: background .12s, color .12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}
.ppos-chip:hover { background: #EEF2FF; }
.ppos-chip-primary {
  background: #1E3A8A !important;
  color: #fff !important;
  border-color: #1E3A8A !important;
  font-weight: 600;
}
.ppos-chip-primary:hover { background: #16306e !important; }
.ppos-chip-menu {
  text-decoration: none;
  border-color: #1E3A8A !important;
  color: #1E3A8A !important;
  font-weight: 600;
}
.ppos-chip-menu:hover { background: #1E3A8A !important; color: #fff !important; }

/* ---- Typing indicator ---- */
.ppos-typing { display: flex; gap: 4px; padding: 10px 14px; }
.ppos-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #cbd5e0;
  animation: ppos-bounce .9s infinite;
}
.ppos-typing span:nth-child(2) { animation-delay: .15s; }
.ppos-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ppos-bounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }

/* ---- Pied de saisie ---- */
#ppos-chat-footer {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fff;
  flex-shrink: 0;
}
#ppos-attach-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  padding: 0 2px;
  display: flex; align-items: center;
  transition: color .15s;
  flex-shrink: 0;
}
#ppos-attach-btn:hover { color: #1E3A8A; }
#ppos-input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  font-family: 'Poppins', Arial, sans-serif;
  background: #F4F7FB;
  color: #1a202c;
  transition: border-color .15s;
  -webkit-appearance: none;
}
#ppos-input:focus { border-color: #1E3A8A; background: #fff; }
#ppos-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #1E3A8A;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
#ppos-send:hover { background: #16306e; }

/* ---- Footer brand — Kit officiel FC Tiger Software ---- */
#ppos-chat-brand.fct-footer {
  --fct-eye:       22px;
  --fct-text:      13px;
  --fct-label:     9px;
  --fct-color:     #1E3A8A;
  --fct-orange:    #f5820a;
  --fct-label-col: #94a3b8;
  --fct-gap:       6px;
  --fct-pad:       8px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--fct-gap);
  padding: var(--fct-pad) 12px;
  width: 100%;
  box-sizing: border-box;
  line-height: 1;
  background: #fff;
  border-top: 1px solid #f0f4f8;
  flex-shrink: 0;
  -webkit-user-select: none; user-select: none;
}
#ppos-chat-brand .fct-label {
  color: var(--fct-label-col);
  font-family: 'Space Grotesk', 'Exo 2', Arial, sans-serif;
  font-size: var(--fct-label);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .9;
}
#ppos-chat-brand .fct-brand {
  display: flex;
  align-items: center;
  gap: 4px;
}
#ppos-chat-brand .fct-eye {
  height: var(--fct-eye);
  width: auto;
  display: block;
}
#ppos-chat-brand .fct-eye-light { display: none; }
#ppos-chat-brand .fct-name {
  font-family: 'Exo 2', 'Space Grotesk', Arial, sans-serif;
  font-weight: 500;
  font-size: var(--fct-text);
  letter-spacing: 1px;
  color: var(--fct-color);
  white-space: nowrap;
}
#ppos-chat-brand .fct-name .fct-soft { color: var(--fct-orange); }

/* ---- Mobile ---- */
@media (max-width: 600px) {
  #ppos-chat-bubble {
    right: 12px; bottom: 16px;
    border-radius: 50px;
    padding: 12px 18px 12px 14px;
    touch-action: manipulation;
  }
  #ppos-bubble-label { display: inline; font-size: 13px; }
  #ppos-chat-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100% !important;
    max-height: 100% !important;
    border-radius: 0;
  }
  #ppos-chat-close { width: 36px; height: 36px; }
  #ppos-messages { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
}

/* ====== CHIPS — nouveau design punchy ====== */
.ppos-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ppos-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 2px solid #1E3A8A;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #1E3A8A;
  cursor: pointer;
  background: #ffffff;
  transition: background .15s, color .15s, transform .1s, box-shadow .15s;
  touch-action: manipulation;
  font-family: 'Poppins', sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(30,58,138,0.10);
}
.ppos-chip:hover {
  background: #1E3A8A;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30,58,138,0.22);
}
.ppos-chip:active { transform: translateY(0); }

.ppos-chip-primary {
  background: #ffffff !important;
  color: #1E3A8A !important;
  border: 2px solid #1E3A8A !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(30,58,138,0.15) !important;
}
.ppos-chip-primary:hover {
  background: #16306e !important;
  border-color: #16306e !important;
  transform: translateY(-1px);
}

.ppos-chip-menu {
  text-decoration: none;
  border-color: #00182A !important;
  color: #00182A !important;
  font-weight: 700;
}
.ppos-chip-menu:hover {
  background: #00182A !important;
  color: #fff !important;
}

/* ====== CARTES PRODUIT — nouveau design ====== */
.ppos-card-item {
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: row;
  align-items: stretch;
}
.ppos-card-item:hover {
  border-color: #1E3A8A;
  box-shadow: 0 4px 14px rgba(30,58,138,0.13);
  transform: translateY(-1px);
}

.ppos-card-img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: #F4F7FB;
}
.ppos-card-img-placeholder {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #E2EAF4 0%, #F4F7FB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.ppos-card-body {
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.ppos-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ppos-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #1E3A8A;
  margin-bottom: 4px;
}
.ppos-card-desc {
  display: none;
}
.ppos-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ppos-card-order-btn {
  background: #1E3A8A;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: background .15s;
  flex-shrink: 0;
}
.ppos-card-order-btn:hover { background: #16306e; }
