/* Buds Bot — la chat nel sito. Colori e caratteri sono quelli del catalogo
   (style.css): verde bosco, oro, carta. Pensata prima per il telefono. */
:root {
  --ink: #10161a; --ink-soft: #46545c; --ink-faint: #6d7a82;
  --paper: #f6f4ef; --paper-2: #fffefb; --line: #e2ded4; --line-2: #cdc7b8;
  --forest: #123b2e; --forest-2: #1b5442; --forest-ink: #0b241c;
  --gold: #b98f2c; --gold-soft: #e8c86a;
  --wa: #0e7a3e;     /* più scuro del verde WhatsApp: testo bianco leggibile */
  --tg: #166f9c;     /* idem per l'azzurro Telegram */
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto;
  background: var(--paper); }
@media (min-width: 600px) { .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: 0 24px 70px -30px rgba(16,22,26,.35); } }

/* testata */
.testa { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--forest); color: #fff; flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.nomi { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nomi strong { font-size: 16px; letter-spacing: .01em; }
.nomi span { font-size: 12px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.testa a, .ricomincia { color: #fff; background: rgba(255,255,255,.12); border: 0; border-radius: 10px; min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; text-decoration: none; cursor: pointer; }
.testa a:hover, .ricomincia:hover { background: rgba(255,255,255,.22); }

/* conversazione */
.chat { flex: 1; overflow-y: auto; padding: 14px 12px 18px; display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.msg { max-width: 88%; padding: 10px 12px; border-radius: 18px; overflow-wrap: anywhere; animation: entra .22s ease-out; }
.msg.bot { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(16,22,26,.05), 0 6px 18px -12px rgba(16,22,26,.22); }
.msg.io { align-self: flex-end; background: var(--forest); color: #fff; border-bottom-right-radius: 6px; max-width: 80%; }
.msg--nav { width: 88%; }
.foto { display: block; width: calc(100% + 24px); margin: -10px -12px 10px; max-height: 320px; object-fit: cover;
  border-radius: 17px 17px 0 0; background: var(--line); }
.testo b { font-weight: 700; }
.piccolo { font-size: 12.5px; color: var(--ink-faint); }
.nota { margin: 10px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); font-style: italic; }

/* pulsanti */
.tasti { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.riga { display: flex; gap: 6px; }
.tasto { flex: 1; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--paper); color: var(--forest-ink); font: 600 14.5px/1.25 var(--sans); text-align: center;
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .08s; -webkit-tap-highlight-color: transparent; }
.tasto:hover { background: #efece4; border-color: var(--forest-2); }
.tasto:active { transform: scale(.98); }
.tasto:disabled { opacity: .45; cursor: default; transform: none; }
.tasto--wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.tasto--wa:hover { background: #0b6a35; border-color: #0b6a35; }
.tasto--tg { background: var(--tg); border-color: var(--tg); color: #fff; }
.tasto--tg:hover { background: #125f86; border-color: #125f86; }
.tasto--pdf { background: var(--gold); border-color: #a47c22; color: var(--ink); font-weight: 800; letter-spacing: .02em;
  min-height: 50px; box-shadow: 0 6px 16px -10px rgba(185,143,44,.9); }
.tasto--pdf:hover { background: #c79c36; }
.tasto--pdf2 { border: 2px solid var(--forest); color: var(--forest); background: var(--paper-2); }
/* aggiungi al carrello: secondario, ma si vede che è un'azione di acquisto */
.tasto--agg { border: 2px solid var(--gold); color: var(--ink); background: #fffaf0; }
.tasto--agg:hover { background: #fff3d6; border-color: #a47c22; }
/* ordina dal carrello: il più visibile dopo i due ordini, verde bosco pieno */
.tasto--car { background: var(--forest); border-color: var(--forest); color: #fff; font-weight: 800; min-height: 48px;
  box-shadow: 0 6px 16px -10px rgba(18,59,46,.9); }
.tasto--car:hover { background: var(--forest-2); border-color: var(--forest-2); }
.tasto:focus-visible, .testa a:focus-visible, .ricomincia:focus-visible, .copia:focus-visible, #testo:focus-visible, #invia:focus-visible {
  outline: 3px solid var(--gold-soft); outline-offset: 2px; }

/* il riepilogo dell'ordine, da copiare con un tocco */
.copia { margin: 10px 0 0; padding: 10px 12px; background: var(--paper); border: 1px dashed var(--line-2); border-radius: 10px;
  font: 14px/1.5 var(--sans); white-space: pre-wrap; cursor: copy; position: relative; }   /* non il carattere a spaziatura fissa: su un telefono spezzava le righe a metà */
.copia.copiato::after { content: '✓'; position: absolute; top: 6px; right: 10px; color: var(--wa); font-weight: 700; }

/* sta scrivendo */
.scrive { display: inline-flex; gap: 4px; padding: 12px 14px; }
.scrive span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: punto 1s infinite ease-in-out; }
.scrive span:nth-child(2) { animation-delay: .15s; } .scrive span:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* la barra in basso */
.barra { display: flex; gap: 8px; padding: 10px 12px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--paper-2); border-top: 1px solid var(--line); flex: none; }
#testo { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: 16px var(--sans); }      /* 16px: iOS non ingrandisce la pagina */
#testo:disabled { background: var(--paper); color: var(--ink-faint); }
#invia { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--forest); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
#invia:disabled { background: var(--line-2); cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .msg, .scrive span { animation: none; }
  .tasto { transition: none; }
}

/* «Vedi prezzi e ordina» (prezzi riservati, 8/10/2026): l'oro del sito,
   il pulsante che conta nella scheda finché i prezzi non si vedono */
.tasto--sblocca { background: var(--gold-soft); border-color: #d6b24f; color: var(--forest-ink); font-weight: 800;
  min-height: 50px; box-shadow: 0 6px 16px -10px rgba(185,143,44,.9); }
.tasto--sblocca:hover { background: #f2d57a; border-color: #c9a23f; }
