/* =====================================================================
   bob.css — Bob, l'assistant d'OHWEED (3 nov. 2026, voir BOB.md)
   Couleurs du personnage (skin « bob » de Bob Pro) : vert sapin, nom jaune,
   accent vert vif — en accord avec le site (émeraude + vert néon).
   ===================================================================== */
.bob {
  --bob-bg: #06231B; --bob-card: #0B3328; --bob-line: #165442; --bob-text: #ECF7F1; --bob-muted: #A9D1BF;
  --bob-yellow: #FACC15; --bob-green: #4ADE80; --bob-accent: var(--color-accent, #38E07B); --bob-ink: var(--color-accent-ink, #06130C);
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 45;
  font-family: var(--font-body, "Nunito Sans", system-ui, sans-serif); color: var(--bob-text);
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none;
}
.bob > * { pointer-events: auto; }
.bob [hidden] { display: none !important; }

/* Bouton : portrait de Bob dans un anneau aux couleurs de son bonnet */
.bob__launcher { position: relative; width: 80px; height: 80px; padding: 4px; border: 0; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from 200deg, #16a34a, var(--bob-yellow), #dc2626, #16a34a); box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(74, 222, 128, .5);
  transition: transform .2s ease, box-shadow .2s ease; animation: bob-pulse 3.2s ease-out 2s 3; }
.bob__launcher img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bob-bg); }
.bob__launcher:hover { transform: translateY(-2px) scale(1.04); }
.bob__launcher:focus-visible { outline: 3px solid var(--bob-accent); outline-offset: 3px; }
.bob.is-open .bob__launcher { transform: scale(.88); }
.bob__badge { position: absolute; top: 0; right: 0; min-width: 20px; height: 20px; border-radius: 999px; background: #ef4444; color: #fff;
  font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bob-bg); }
@keyframes bob-pulse { 0% { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(74, 222, 128, .55); } 70% { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 16px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(74, 222, 128, 0); } }

/* Bulle d'accueil (« Salut, moi c'est Bob ») */
/* Apparition : à GAUCHE du bouton, au ras du bas de l'écran (ne cache jamais « Ajouter au panier », au-dessus) */
.bob__teaser { position: absolute; right: calc(100% + 12px); bottom: 2px; width: min(390px, calc(100vw - 130px)); display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 30px 12px 12px; border-radius: 18px 18px 4px 18px; background: var(--bob-card); border: 1px solid var(--bob-green);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 0 0 4px rgba(74, 222, 128, .12); animation: bob-pop .55s cubic-bezier(.2, 1.4, .3, 1); }
.bob.is-open .bob__teaser { display: none; }
/* Position de repli quand la bulle cacherait un bouton important (voir dodge() dans bob.js) */
.bob.bob--pop-alt .bob__teaser { position: fixed; right: auto; left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); }
@keyframes bob-pop { 0% { opacity: 0; transform: translateX(16px) scale(.85); } 100% { opacity: 1; transform: none; } }
.bob__pop { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bob__pop-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.bob__pop-actions button { border: 1px solid var(--bob-line); background: var(--bob-bg); color: var(--bob-text); font: inherit; font-size: .76rem; font-weight: 800; padding: 6px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.bob__pop-actions button:first-child { background: var(--bob-accent); color: var(--bob-ink); border-color: transparent; }
.bob__pop-actions button:hover { border-color: var(--bob-green); }
.bob__pop-actions .bob__pop-no { background: none; border-color: transparent; color: var(--bob-muted); font-weight: 600; padding-inline: 4px; }
.bob__teaser img { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; flex: none; }
.bob__teaser p { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: .82rem; line-height: 1.35; color: var(--bob-muted); }
.bob__teaser strong { color: var(--bob-yellow); font-size: .95rem; }
.bob__teaser-close { position: absolute; top: 4px; right: 6px; width: 26px; height: 26px; border: 0; background: none; color: var(--bob-muted); font-size: 1.2rem; cursor: pointer; border-radius: 50%; }
.bob__teaser-close:hover { color: #fff; background: rgba(255, 255, 255, .08); }

/* Fenêtre de discussion */
.bob__panel { width: min(380px, calc(100vw - 24px)); height: min(580px, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bob-bg); border: 1px solid var(--bob-line); border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); animation: bob-in .25s ease-out; transform-origin: bottom right; }
@keyframes bob-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.bob__head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; background: linear-gradient(135deg, #0B3328, #06231B); border-bottom: 1px solid var(--bob-line); }
.bob__head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bob-green); }
.bob__head div { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.bob__head strong { font-size: 1.05rem; color: var(--bob-yellow); letter-spacing: .04em; }
.bob__head small { font-size: .74rem; color: var(--bob-muted); display: flex; align-items: center; gap: 6px; }
.bob__mood { --mood: #2DAA6E; }
.bob__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--mood); box-shadow: 0 0 8px var(--mood); transition: background .3s, box-shadow .3s; }
.bob__mood b { color: var(--mood); font-size: .68rem; letter-spacing: .08em; transition: color .3s; }
.bob__mood span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bob__vitrine { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 12px 6px; padding: 7px 10px; border-radius: 10px; font-size: .76rem; color: var(--bob-muted); text-decoration: none; white-space: nowrap; overflow: hidden; background: rgba(250, 204, 21, .06); border: 1px dashed rgba(250, 204, 21, .3); }
.bob__vitrine img { width: 20px; height: 20px; border-radius: 50%; }
.bob__vitrine strong { color: var(--bob-yellow); }
.bob__vitrine:hover { border-color: var(--bob-yellow); color: var(--bob-text); }
.bob__close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--bob-text); font-size: 1.3rem; cursor: pointer; }
.bob__close:hover { background: rgba(255, 255, 255, .14); }

.bob__log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--bob-line) transparent; }
.bob__msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; animation: bob-in .2s ease-out; }
.bob__msg img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.bob__txt { padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--bob-card); border: 1px solid var(--bob-line); font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.bob__txt ul { margin: 6px 0; padding-left: 18px; display: grid; gap: 4px; }
.bob__txt a { color: var(--bob-green); font-weight: 700; }
.bob__txt strong { color: #fff; }
.bob__msg--me { align-self: flex-end; }
.bob__msg--me .bob__txt { background: var(--bob-accent); color: var(--bob-ink); border-color: transparent; border-radius: 16px 16px 4px 16px; font-weight: 600; }
.bob__msg--typing .bob__txt { display: flex; gap: 4px; padding: 13px 14px; }
.bob__msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--bob-muted); animation: bob-dot 1s infinite ease-in-out; }
.bob__msg--typing i:nth-child(2) { animation-delay: .15s; }
.bob__msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bob-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Carte produit dans la réponse */
.bob-card { display: flex; flex-direction: column; gap: 2px; margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: rgba(6, 35, 27, .7); border: 1px solid var(--bob-line); text-decoration: none; color: var(--bob-text) !important; font-weight: 400 !important; transition: border-color .15s; }
.bob-card:hover { border-color: var(--bob-green); }
.bob-card strong { color: var(--bob-yellow) !important; }
.bob-card small { color: var(--bob-muted); font-size: .76rem; }
.bob-card span { font-size: .82rem; }
.bob-card em { font-style: normal; font-size: .78rem; font-weight: 800; color: var(--bob-green); }

/* Sujets proposés */
.bob__chips { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; border-top: 1px solid var(--bob-line); scrollbar-width: none; flex: none; }
.bob__chips::-webkit-scrollbar { display: none; }
.bob__chips:empty { display: none; }
.bob__chips button { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--bob-line); background: var(--bob-card); color: var(--bob-text); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; }
.bob__chips button:hover, .bob__chips button:focus-visible { border-color: var(--bob-green); color: var(--bob-green); outline: none; }

.bob__form { display: flex; gap: 8px; padding: 10px 12px 6px; flex: none; }
.bob__form input { flex: 1; min-width: 0; padding: 11px 14px; border-radius: 999px; border: 1px solid var(--bob-line); background: var(--bob-card); color: var(--bob-text); font: inherit; font-size: .92rem; }
.bob__form input::placeholder { color: var(--bob-muted); opacity: .8; }
.bob__form input:focus { outline: none; border-color: var(--bob-green); }
.bob__form button { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--bob-accent); color: var(--bob-ink); cursor: pointer; display: grid; place-items: center; }
.bob__form button svg { width: 18px; height: 18px; }
.bob__legal { margin: 0; padding: 0 14px 10px; font-size: .66rem; color: var(--bob-muted); opacity: .75; text-align: center; }

@media (max-width: 720px) {
  .bob { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .bob__launcher { width: 68px; height: 68px; padding: 3px; }
  .bob.is-open { inset: 0; right: 0; bottom: 0; gap: 0; }
  .bob.is-open .bob__launcher { display: none; }
  .bob__panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .bob__teaser { position: fixed; right: 12px; left: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); width: auto; }
  .bob.bob--pop-alt .bob__teaser { left: 12px; right: 12px; bottom: auto; top: calc(76px + env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) { .bob *, .bob { animation: none !important; transition: none !important; } }
@media print { .bob { display: none; } }
