/* Assistente ricambi - finestra chat */
.archatbot { --arch-color: #d9700f; position: fixed; bottom: 20px; z-index: 9999; font-family: inherit; font-size: 14px; line-height: 1.4; }
.archatbot--right { right: 20px; }
.archatbot--left { left: 20px; }
.archatbot [hidden] { display: none !important; }
.archatbot *, .archatbot *::before, .archatbot *::after { box-sizing: border-box; }

.archatbot__launcher { display: flex; align-items: center; gap: 8px; border: 0; border-radius: 30px; padding: 12px 18px 12px 14px; background: var(--arch-color); color: #fff; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-weight: 600; font-size: 15px; }
.archatbot__launcher:hover, .archatbot__launcher:focus { filter: brightness(1.08); outline: none; }
.archatbot.is-open .archatbot__launcher-label { display: none; }
.archatbot.is-open .archatbot__launcher { padding: 12px; }

.archatbot__panel { position: absolute; bottom: 64px; width: 360px; max-width: calc(100vw - 24px); height: 560px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.3); overflow: hidden; }
.archatbot--right .archatbot__panel { right: 0; }
.archatbot--left .archatbot__panel { left: 0; }

.archatbot__header { display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 16px; background: var(--arch-color); color: #fff; }
.archatbot__title { flex: 1; font-weight: 700; font-size: 16px; }
.archatbot__icon { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; padding: 4px 8px; cursor: pointer; border-radius: 6px; }
.archatbot__icon:hover, .archatbot__icon:focus { background: rgba(255,255,255,.18); outline: none; }

.archatbot__body { flex: 1; overflow-y: auto; padding: 14px; background: #f4f5f7; display: flex; flex-direction: column; gap: 8px; }
.archatbot__msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.archatbot__msg--bot { align-self: flex-start; background: #fff; color: #222; border-bottom-left-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.archatbot__msg--user { align-self: flex-end; background: var(--arch-color); color: #fff; border-bottom-right-radius: 4px; }
.archatbot__typing { color: #888; letter-spacing: 2px; }

.archatbot__products { display: flex; flex-direction: column; gap: 6px; }
.archatbot__product { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; padding: 8px; color: #222; text-decoration: none; }
.archatbot__product:hover { border-color: var(--arch-color); text-decoration: none; }
.archatbot__product img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; background: #eee; }
.archatbot__pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.archatbot__pname { font-weight: 600; }
.archatbot__pprice { color: var(--arch-color); font-weight: 700; }
.archatbot__pstock { font-size: 12px; color: #8a6d00; }
.archatbot__pstock.is-ok { color: #1e7b34; }

.archatbot__choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.archatbot__choices:empty { display: none; }
.archatbot__choice { border: 1px solid var(--arch-color); background: #fff; color: var(--arch-color); border-radius: 18px; padding: 7px 12px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.archatbot__choice:hover, .archatbot__choice:focus { background: var(--arch-color); color: #fff; text-decoration: none; outline: none; }
.archatbot__choice--wa { background: #25d366; border-color: #25d366; color: #fff; font-weight: 700; }
.archatbot__choice--wa:hover, .archatbot__choice--wa:focus { background: #1ebe5a; border-color: #1ebe5a; color: #fff; }
.archatbot__choice--main { background: var(--arch-color); color: #fff; margin-top: 10px; }

.archatbot__form { display: flex; gap: 6px; padding: 10px 12px 12px; background: #fff; border-top: 1px solid #eee; }
.archatbot__input { flex: 1; min-width: 0; border: 1px solid #ccc; border-radius: 20px; padding: 9px 14px; font-size: 16px; }
.archatbot__input:focus { border-color: var(--arch-color); outline: none; }
.archatbot__input:disabled { background: #f2f2f2; }
.archatbot__photo { color: #555; font-size: 20px; }
.archatbot__send { border: 0; border-radius: 20px; background: var(--arch-color); color: #fff; padding: 0 16px; font-weight: 700; cursor: pointer; }
.archatbot__send:disabled { opacity: .5; cursor: default; }

.archatbot__consent { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.archatbot__consent p { margin: 0 0 8px; }
.archatbot__consent a { color: var(--arch-color); text-decoration: underline; }

/* telefono: la chat occupa tutto lo schermo */
@media (max-width: 480px) {
  .archatbot { bottom: 12px; }
  .archatbot--right { right: 12px; }
  .archatbot--left { left: 12px; }
  .archatbot.is-open { top: 0; left: 0; right: 0; bottom: 0; }
  .archatbot.is-open .archatbot__panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .archatbot.is-open .archatbot__launcher { display: none; }
  .archatbot__launcher-label { display: none; }
  .archatbot__launcher { padding: 14px; }
}
