/* ==========================================================================
   Assistente de Atendimento (Chatbot) — Agência Print
   ========================================================================== */

.agprint-chatbot { position: fixed; right: 16px; bottom: 16px; z-index: 300; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* Botão flutuante */
.agprint-chatbot__toggle {
	display: flex; align-items: center; gap: 10px;
	background: var(--agprint-primary, #1a3c6e); color: #fff; border: none;
	border-radius: 999px; padding: 13px 18px; box-shadow: 0 10px 26px rgba(0,0,0,.22);
	font-weight: 700; font-size: 14px;
}
.agprint-chatbot__toggle-icon--close { display: none; }
.agprint-chatbot__toggle[aria-expanded="true"] .agprint-chatbot__toggle-icon--chat { display: none; }
.agprint-chatbot__toggle[aria-expanded="true"] .agprint-chatbot__toggle-icon--close { display: flex; }
.agprint-chatbot__toggle-label { white-space: nowrap; }

/* Janela de conversa */
.agprint-chatbot__window {
	position: fixed; right: 16px; bottom: 84px; left: 16px;
	max-width: 380px; margin-left: auto;
	background: #fff; border-radius: 14px; box-shadow: 0 20px 55px rgba(0,0,0,.28);
	display: flex; flex-direction: column; overflow: hidden;
	height: min(560px, 72vh);
	opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none;
	transition: opacity .18s ease, transform .18s ease;
}
.agprint-chatbot__window.is-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.agprint-chatbot__header {
	display: flex; align-items: center; gap: 10px; padding: 14px 14px;
	background: var(--agprint-primary, #1a3c6e); color: #fff; flex-shrink: 0;
}
.agprint-chatbot__avatar {
	width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.agprint-chatbot__title { margin: 0; font-size: 14px; font-weight: 700; }
.agprint-chatbot__subtitle { margin: 2px 0 0; font-size: 11.5px; opacity: .82; }
.agprint-chatbot__close { margin-left: auto; background: none; border: none; color: #fff; opacity: .85; padding: 4px; }
.agprint-chatbot__close:hover { opacity: 1; }

.agprint-chatbot__messages {
	flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px;
	background: #f7f8fa;
}

.agprint-chatbot__msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 13.8px; line-height: 1.45; }
.agprint-chatbot__msg--bot { align-self: flex-start; background: #fff; border: 1px solid #e3e6ea; border-bottom-left-radius: 4px; }
.agprint-chatbot__msg--user { align-self: flex-end; background: var(--agprint-accent, #e2231a); color: #fff; border-bottom-right-radius: 4px; }

.agprint-chatbot__typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid #e3e6ea; border-radius: 14px; border-bottom-left-radius: 4px; }
.agprint-chatbot__typing span { width: 6px; height: 6px; border-radius: 50%; background: #b6bcc4; animation: agprint-typing 1s infinite ease-in-out; }
.agprint-chatbot__typing span:nth-child(2) { animation-delay: .15s; }
.agprint-chatbot__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes agprint-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.agprint-chatbot__quick-replies { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; flex-shrink: 0; }
.agprint-chatbot__quick-replies:empty { display: none; }
.agprint-chatbot__chip {
	background: #fff; border: 1px solid var(--agprint-primary, #1a3c6e); color: var(--agprint-primary, #1a3c6e);
	border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 600;
}
.agprint-chatbot__chip:hover { background: var(--agprint-primary, #1a3c6e); color: #fff; }

.agprint-chatbot__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e3e6ea; flex-shrink: 0; background: #fff; }
.agprint-chatbot__form input {
	flex: 1; border: 1px solid #e3e6ea; border-radius: 999px; padding: 10px 15px; font-size: 14px; background: #f7f8fa;
}
.agprint-chatbot__form button {
	background: var(--agprint-accent, #e2231a); color: #fff; border: none; border-radius: 50%;
	width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Mobile: janela ocupa quase o ecrã todo */
@media (max-width: 480px) {
	.agprint-chatbot__toggle-label { display: none; }
	.agprint-chatbot__window { right: 10px; left: 10px; bottom: 78px; height: min(76vh, 620px); max-width: none; }
}

/* Desktop: janela um pouco maior */
@media (min-width: 960px) {
	.agprint-chatbot__window { width: 380px; }
}
