/* =====================================================================
   ASSISTANT SOMMELIER — bulle flottante et fenêtre de conversation.
   ===================================================================== */
.bulle-assistant {
  position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; align-items: center; gap: 10px;
  padding: 12px 20px 12px 14px; border-radius: 999px; background: var(--bordeaux); color: var(--creme);
  font-size: 14px; font-weight: 600; box-shadow: 0 14px 34px rgba(93, 26, 26, .35);
  transition: transform .35s var(--courbe), opacity .3s; animation: arriveeBulle .8s var(--courbe) 1.2s both;
}
.bulle-assistant svg { width: 22px; height: 22px; color: var(--or-vif); }
.bulle-assistant:hover { transform: translateY(-3px); }
.assistant-ouvert .bulle-assistant { opacity: 0; pointer-events: none; }
@keyframes arriveeBulle { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }

.assistant {
  position: fixed; right: 24px; bottom: 24px; z-index: 110; width: 420px; height: min(680px, calc(100vh - 48px));
  display: flex; flex-direction: column; background: var(--creme-doux); border-radius: 22px; overflow: hidden;
  box-shadow: var(--ombre-l), 0 0 0 1px rgba(0, 0, 0, .05);
  opacity: 0; transform: translateY(24px) scale(.97); transform-origin: bottom right; pointer-events: none;
  transition: opacity .3s, transform .45s var(--courbe);
}
.assistant.ouvert { opacity: 1; transform: none; pointer-events: auto; }

.assistant__tete { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--noir-doux); color: var(--creme); }
.assistant__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bordeaux); color: var(--or-vif); }
.assistant__avatar svg { width: 22px; height: 22px; }
.assistant__tete strong { display: block; font-family: var(--police-titre); font-size: 17px; font-weight: 600; }
.assistant__tete small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .65; }
.assistant__tete small i { width: 7px; height: 7px; border-radius: 50%; background: var(--succes-vif); }
.assistant__tete button { margin-left: auto; color: var(--creme); opacity: .7; font-size: 15px; }

.assistant__fil { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.message { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 14px; line-height: 1.5; animation: arriveeMessage .35s var(--courbe); }
.message--sommelier { align-self: flex-start; background: var(--blanc); border: 1px solid rgba(0, 0, 0, .06); border-bottom-left-radius: 6px; }
.message--visiteur { align-self: flex-end; background: var(--bordeaux); color: var(--creme); border-bottom-right-radius: 6px; }
.message strong { font-weight: 600; }
@keyframes arriveeMessage { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.message--ecrit { display: flex; gap: 4px; padding: 14px 16px; }
.message--ecrit span { width: 7px; height: 7px; border-radius: 50%; background: var(--gris-clair); animation: points 1.1s infinite ease-in-out; }
.message--ecrit span:nth-child(2) { animation-delay: .15s; }
.message--ecrit span:nth-child(3) { animation-delay: .3s; }
@keyframes points { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.choix { display: flex; flex-wrap: wrap; gap: 7px; padding-left: 2px; animation: arriveeMessage .35s var(--courbe); }
.choix__bouton { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--bordeaux); color: var(--bordeaux); font-size: 13px; font-weight: 500; background: transparent; transition: background .2s, color .2s; }
.choix__bouton:hover { background: var(--bordeaux); color: var(--creme); }

.bouteilles-chat { display: flex; flex-direction: column; gap: 8px; }
.message:has(.bouteilles-chat) { max-width: 100%; width: 100%; padding: 10px; }
.bouteille-chat { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--creme-doux); transition: background .2s; }
.bouteille-chat:hover { background: var(--sable-survol); }
.bouteille-chat img { width: 42px; height: 56px; object-fit: contain; }
.bouteille-chat__vide { width: 42px; height: 56px; }
.bouteille-chat strong { display: block; font-size: 13px; line-height: 1.3; }
.bouteille-chat small { font-size: 11.5px; color: var(--gris); }
.bouteille-chat em { font-style: normal; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lien-chat { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--bordeaux); }

.assistant__saisie { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--ligne); background: var(--blanc); }
.assistant__saisie input { flex: 1; min-width: 0; border: none; outline: none; padding: 10px 12px; font-size: 14px; background: var(--creme-doux); border-radius: 999px; }
.assistant__saisie button { width: 40px; height: 40px; border-radius: 50%; background: var(--bordeaux); color: var(--creme); display: grid; place-items: center; }

/* ---------- Sommelier IA (01/11/2026) ---------- */
.assistant__nouveau { margin-left: auto; padding: 5px 10px; border: 1px solid rgba(245, 240, 232, .35); border-radius: 999px; font-size: 12px; color: var(--creme); opacity: .8; }
.assistant__nouveau:hover { opacity: 1; }
.assistant__nouveau + button { margin-left: 4px; }
.assistant__mention { margin: 0; padding: 0 12px 10px; background: var(--blanc); font-size: 10.5px; line-height: 1.3; color: var(--gris); text-align: center; }

.message--vins { max-width: 100%; width: 100%; padding: 0; background: none; border: none; }
.vins-conseil { display: flex; flex-direction: column; gap: 8px; }
.vin-conseil { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--blanc); border: 1px solid rgba(0, 0, 0, .06); }
.vin-conseil__image img { width: 54px; height: 76px; object-fit: contain; }
.vin-conseil__corps { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vin-conseil__nom { font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--noir-doux); }
.vin-conseil__nom:hover { color: var(--bordeaux); }
.vin-conseil__corps small { font-size: 11.5px; color: var(--gris); }
.vin-conseil__raison { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; }
.vin-conseil__pied { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; }
.vin-conseil__prix { font-style: normal; font-size: 13.5px; font-weight: 700; }
.vin-conseil__prix--demande { font-weight: 600; color: var(--gris); }
.vin-conseil__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.vin-conseil__badge { padding: 2px 7px; border-radius: 999px; background: var(--creme); color: var(--bordeaux); font-size: 10.5px; font-weight: 600; }
.vin-conseil__ajouter, .vin-conseil__demander { margin-left: auto; min-height: 32px; padding: 6px 12px; border-radius: 999px; background: var(--bordeaux); color: var(--creme); font-size: 12px; font-weight: 600; }
.vin-conseil__demander { background: transparent; color: var(--bordeaux); border: 1px solid var(--bordeaux); }
.vin-conseil__ajouter:disabled { background: var(--succes-vif); cursor: default; }
.vin-conseil__epuise { margin-left: auto; font-size: 12px; color: var(--gris); }

@media (max-width: 720px) {
  .bulle-assistant { right: 14px; bottom: 96px; padding: 12px; }
  .bulle-assistant span { display: none; }
  .assistant { inset: 0; width: auto; height: auto; border-radius: 0; }
}
