/* public/css/conseiller.css
   Conseiller parfum : bulle en bas à gauche et panneau façon conversation.
   À gauche, pour laisser libre le coin droit du widget de recette Cockpit.
   Palette et typographies : variables de site.css. */

.ns-c { position: fixed; left: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 9000; font-family: var(--sans); }

/* ------------------------------------------------------------------- Bulle */
.ns-c-bulle { display: flex; align-items: center; gap: 6px; animation: ns-c-apparition .45s ease-out .5s both; }

.ns-c-ouvrir {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 20px 0 16px;
  background: var(--sauge); color: #fff;
  border: 1px solid var(--sauge); border-radius: 999px;
  font: 500 13px/1 var(--sans); letter-spacing: .04em;
  box-shadow: 0 6px 20px rgba(44, 51, 39, .18);
  cursor: pointer; transition: background-color .2s ease, box-shadow .2s ease;
}
.ns-c-ouvrir:hover { background: var(--sauge-fonce); box-shadow: 0 8px 24px rgba(44, 51, 39, .24); }
.ns-c-ouvrir svg { flex: none; }

.ns-c-reduire {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  background: var(--fond); color: var(--texte-doux);
  border: 1px solid var(--bordure); border-radius: 50%;
  cursor: pointer; transition: color .2s ease;
}
.ns-c-reduire:hover { color: var(--encre); }
.ns-c-reduire[hidden] { display: none; }

.ns-c.is-reduit .ns-c-ouvrir { width: 46px; padding: 0; justify-content: center; }
.ns-c.is-reduit .ns-c-ouvrir-texte { display: none; }

.ns-c-ouvrir:focus-visible,
.ns-c-reduire:focus-visible,
.ns-c-panneau button:focus-visible,
.ns-c-panneau a:focus-visible,
.ns-c-panneau textarea:focus-visible { outline: 2px solid var(--laiton); outline-offset: 2px; }

/* ----------------------------------------------------------------- Panneau */
.ns-c-panneau {
  position: absolute; left: 0; bottom: 58px;
  display: flex; flex-direction: column;
  width: 380px; max-width: calc(100vw - 36px);
  height: min(620px, calc(100vh - 110px)); height: min(620px, calc(100dvh - 110px));
  background: var(--fond); color: var(--encre);
  border: 1px solid var(--bordure); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(44, 51, 39, .22);
  overflow: hidden;
  animation: ns-c-ouverture .22s ease-out both;
}
.ns-c-panneau[hidden] { display: none; }

.ns-c-tete {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 12px 18px;
  background: var(--section); border-bottom: 1px solid var(--bordure);
}
.ns-c-titre { margin: 0; font: 600 21px/1.15 var(--serif); color: var(--encre); }
.ns-c-titre:focus { outline: none; }
.ns-c-fermer {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  background: transparent; color: var(--texte-doux);
  border: 0; border-radius: 50%; cursor: pointer;
}
.ns-c-fermer:hover { background: var(--bordure); color: var(--encre); }

.ns-c-fil { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }

.ns-c-messages { display: flex; flex-direction: column; gap: 10px; }
.ns-c-message {
  max-width: 90%; margin: 0; padding: 10px 13px;
  font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
  border-radius: 10px;
}
.ns-c-message--conseiller { align-self: flex-start; background: var(--section); color: var(--encre); border-bottom-left-radius: 3px; }
.ns-c-message--visiteur { align-self: flex-end; background: var(--sauge); color: #fff; border-bottom-right-radius: 3px; }
.ns-c-message--attente { font-style: italic; color: var(--texte-doux); }
.ns-c-message:focus { outline: none; }

.ns-c-zone { margin-top: 12px; }

/* Réponses proposées */
.ns-c-options { display: flex; flex-direction: column; gap: 8px; }
.ns-c-option {
  width: 100%; min-height: 44px; padding: 9px 14px;
  background: transparent; color: var(--sauge-fonce);
  border: 1px solid var(--sauge); border-radius: 8px;
  font: 400 14px/1.3 var(--sans); text-align: left;
  cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.ns-c-option:hover { background: var(--sauge); color: #fff; }

/* Champ libre */
.ns-c-option--libre { border-style: dashed; color: var(--sauge); font-weight: 500; }
.ns-c-option--libre::before { content: "✎"; margin-right: 8px; }
.ns-c-libre { margin-bottom: 12px; }
.ns-c-libre label { display: block; margin-bottom: 6px; font: 500 13px/1.3 var(--sans); color: var(--encre); }
.ns-c-libre textarea {
  display: block; width: 100%; padding: 9px 11px; resize: vertical;
  background: #fff; color: var(--encre);
  border: 1px solid var(--bordure); border-radius: 8px;
  font: 400 16px/1.4 var(--sans);
}
.ns-c-libre-pied { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.ns-c-compteur { font-size: 12px; color: var(--texte-gris); }
.ns-c-mention { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--texte-doux); }
.ns-c-mention a { color: inherit; }

/* Boutons */
.ns-c-bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 7px 14px;
  background: var(--sauge); color: #fff;
  border: 1px solid var(--sauge); border-radius: 6px;
  font: 500 13px/1.2 var(--sans); text-align: center; text-decoration: none;
  cursor: pointer; transition: background-color .15s ease;
}
.ns-c-bouton:hover { background: var(--sauge-fonce); color: #fff; }
.ns-c-bouton[disabled] { opacity: .55; cursor: default; }
.ns-c-lien {
  padding: 6px 2px; background: none; border: 0;
  color: var(--sauge-fonce); font: 400 13px/1.2 var(--sans);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.ns-c-lien:hover { color: var(--laiton); }

/* Résultats */
.ns-c-resultats { display: flex; flex-direction: column; gap: 12px; }
.ns-c-carte { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--bordure); border-radius: 10px; }
.ns-c-visuel { display: block; width: 76px; height: 96px; overflow: hidden; background: var(--section); border-radius: 6px; }
.ns-c-visuel img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ns-c-nom { margin: 0; font: 600 17px/1.2 var(--serif); }
.ns-c-nom a { color: var(--encre); text-decoration: none; }
.ns-c-nom a:hover { color: var(--laiton); }
.ns-c-prix { margin: 4px 0 0; font-size: 14px; font-weight: 500; color: var(--laiton-fonce); }
.ns-c-prix s { margin-left: 6px; font-weight: 400; color: var(--texte-gris); }
.ns-c-pourquoi-titre { margin: 8px 0 2px; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--kraft); }
.ns-c-pourquoi { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--texte-doux); }
.ns-c-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; }

.ns-c-pied { flex: none; display: flex; align-items: center; gap: 18px; min-height: 44px; padding: 4px 16px; border-top: 1px solid var(--bordure); }
.ns-c-pied[hidden] { display: none; }

.ns-c-invisible { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@keyframes ns-c-apparition { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ns-c-ouverture { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Mobile */
@media (max-width: 600px) {
  .ns-c { left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  /* Quasi plein écran, sans recouvrir la rangée du bas : la bulle y reste comme
     bouton de fermeture, et le coin droit reste libre. */
  .ns-c-panneau {
    position: fixed; left: 8px; right: 8px; width: auto; max-width: none;
    top: calc(8px + env(safe-area-inset-top));
    bottom: calc(66px + env(safe-area-inset-bottom));
    height: auto;
  }
  .ns-c-ouvrir { min-height: 44px; }
  .ns-c.is-reduit .ns-c-ouvrir { width: 44px; }
  /* Site de recette : le widget Cockpit tient toute la largeur, sur deux rangées. */
  .ns-c--cockpit { bottom: calc(112px + env(safe-area-inset-bottom)); }
  .ns-c--cockpit .ns-c-panneau { bottom: calc(168px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .ns-c-bulle, .ns-c-panneau { animation: none; }
  .ns-c-ouvrir, .ns-c-option, .ns-c-bouton, .ns-c-reduire { transition: none; }
}

@media print { .ns-c { display: none; } }
