/* Webchat da Maro — mesma linguagem visual do tema (stone, serif itálico, pílulas) */

.maro-chat-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  border: none;
  background: #1c1917;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(28, 25, 23, 0.3);
  transition: transform 150ms ease;
}
.maro-chat-btn:hover { transform: scale(1.06); }
.maro-chat-btn.is-open { background: #44403c; }

.maro-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 9999;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(28, 25, 23, 0.25);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.maro-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #1c1917;
  color: #fff;
}
.maro-chat-head strong { font-family: Georgia, serif; font-style: italic; font-size: 18px; }
.maro-chat-sub { display: block; font-size: 11px; color: #d6d3d1; }
.maro-chat-head-acoes { display: flex; align-items: center; gap: 10px; }
.maro-chat-close, .maro-chat-nova {
  background: none; border: none; color: #d6d3d1; font-size: 16px; cursor: pointer;
  min-width: 28px; min-height: 28px;
}
.maro-chat-nova {
  font-size: 15px;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 9999px;
}
.maro-chat-close:hover, .maro-chat-nova:hover { color: #fff; }
.maro-chat-nova:hover { border-color: #fff; }

.maro-chat-escalado {
  padding: 8px 14px;
  background: #fffbeb;
  color: #92400e;
  border-bottom: 1px solid #fde68a;
  font-size: 12px;
  line-height: 1.4;
}

.maro-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.maro-chat-msg { display: flex; flex-direction: column; gap: 6px; max-width: 85%; }
.maro-chat-msg--visitor { align-self: flex-end; align-items: flex-end; }
.maro-chat-msg--ai, .maro-chat-msg--admin { align-self: flex-start; align-items: flex-start; }

.maro-chat-bolha {
  padding: 9px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.maro-chat-msg--visitor .maro-chat-bolha { background: #1c1917; color: #fff; border-bottom-right-radius: 4px; }
.maro-chat-msg--ai .maro-chat-bolha { background: #fff; color: #1c1917; border: 1px solid #e7e5e4; border-bottom-left-radius: 4px; }
.maro-chat-msg--admin .maro-chat-bolha { background: #ecfdf5; color: #064e3b; border: 1px solid #a7f3d0; border-bottom-left-radius: 4px; }

.maro-chat-digitando { font-size: 12px; color: #a8a29e; font-style: italic; padding: 2px 6px; }

.maro-chat-bolha--erro {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 12.5px;
}

.maro-chat-contato {
  align-self: stretch;
  max-width: 100%;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #57534e;
}
.maro-chat-contato p { margin: 0 0 8px; }
.maro-chat-contato-form { display: flex; gap: 6px; }
.maro-chat-contato-form input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #d6d3d1;
  border-radius: 9999px;
  font-size: 13px;
  outline: none;
}
.maro-chat-contato-form input:focus { border-color: #1c1917; }
.maro-chat-contato-form button {
  padding: 7px 14px;
  border: none;
  border-radius: 9999px;
  background: #1c1917;
  color: #fff;
  font-size: 12.5px;
  cursor: pointer;
}

/* Confirmação de carrinho (RF-14) */
.maro-chat-contato--ok { border-color: #a7f3d0; background: #ecfdf5; }
.maro-chat-contato--ok p { color: #064e3b; font-weight: 600; }
.maro-chat-cart-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9999px;
  background: #1c1917;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  flex: 1;
}
.maro-chat-cart-cta:hover { background: #44403c; }

/* Cartão de produto (RF-13) */
.maro-chat-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-areas: "foto nome" "foto preco" "foto cta";
  gap: 2px 10px;
  align-items: center;
  width: 240px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 150ms ease;
}
.maro-chat-card:hover { border-color: #1c1917; }
.maro-chat-card img { grid-area: foto; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.maro-chat-card-nome { grid-area: nome; font-size: 13px; font-weight: 600; color: #1c1917; }
.maro-chat-card-preco { grid-area: preco; font-size: 13px; color: #57534e; }
.maro-chat-card-cta { grid-area: cta; font-size: 12px; font-weight: 600; color: #1c1917; text-decoration: underline; text-underline-offset: 2px; }

.maro-chat-privacidade {
  padding: 6px 14px;
  font-size: 10.5px;
  color: #a8a29e;
  border-top: 1px solid #e7e5e4;
  background: #fff;
}
.maro-chat-encerrar {
  display: block;
  margin-top: 4px;
  padding: 8px 0; /* achado ux-designer: alvo de toque < 44px, discreto não devia significar difícil de tocar no mobile */
  border: none;
  background: none;
  color: #78716c; /* achado ux-designer: #a8a29e dava contraste ~2.3:1, abaixo do mínimo WCAG AA */
  font-size: 10.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.maro-chat-encerrar:hover { color: #44403c; }

.maro-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
}
.maro-chat-form input {
  flex: 1;
  padding: 9px 14px;
  border: 1px solid #d6d3d1;
  border-radius: 9999px;
  font-size: 14px;
  background: #fafaf9;
  outline: none;
}
.maro-chat-form input:focus { border-color: #1c1917; background: #fff; }
.maro-chat-form button {
  width: 40px; height: 40px;
  border: none; border-radius: 9999px;
  background: #1c1917; color: #fff;
  cursor: pointer; font-size: 15px;
}

@media (max-width: 480px) {
  .maro-chat-panel { right: 8px; bottom: 80px; }
}
