/* Assistente flutuante Jorge Bloco — bordô #391D22, laranja #E87A20 */
.jba { --c: #E87A20; --b: #391D22; --bg: #fff; --bg2: #f6f3ef; --ink: #2a1a1d; --mut: #6b6461; --lin: #e7e1da; --sh: 0 24px 60px -18px rgba(57,29,34,.45), 0 4px 14px rgba(57,29,34,.12); --ease: cubic-bezier(.2,.8,.2,1); --fundo: calc(20px + env(safe-area-inset-bottom)); font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
.jba *, .jba *::before, .jba *::after { box-sizing: border-box; }
.jba button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* Botão */
.jba .jba__abrir { position: fixed; right: 20px; bottom: var(--fundo); z-index: 96; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px 0 8px; border-radius: 999px; background: linear-gradient(135deg, #f08a2e, var(--c) 55%, #d96a12); color: var(--b) !important; font-weight: 800; font-size: 15px; box-shadow: 0 14px 30px -10px rgba(232,122,32,.75), 0 3px 8px rgba(57,29,34,.18), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s; animation: jba-in .5s var(--ease) .6s backwards; }
.jba__abrir:hover { transform: translateY(-2px); }
.jba__abrir:focus-visible { outline: 3px solid var(--b); outline-offset: 3px; }
.jba__abrir::after { content: ""; position: absolute; inset: 0; border-radius: inherit; animation: jba-anel 2.4s ease-out 2s 2; pointer-events: none; }
.jba__ic { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--b); color: #fff; }
.jba__ic::after { content: ""; position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; border-radius: 50%; background: #34c759; box-shadow: 0 0 0 2px var(--b); }
.jba.is-aberto .jba__abrir { opacity: 0; pointer-events: none; transform: scale(.9); }
@keyframes jba-in { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes jba-anel { 0% { box-shadow: 0 0 0 0 rgba(232,122,32,.5); } 80%, 100% { box-shadow: 0 0 0 14px rgba(232,122,32,0); } }

/* Painel */
.jba__painel { position: fixed; right: 20px; bottom: var(--fundo); z-index: 130; width: 400px; max-width: calc(100vw - 32px); height: min(640px, calc(100vh - 40px)); display: none; flex-direction: column; overflow: hidden; border-radius: 24px; background: var(--bg); color: var(--ink); box-shadow: var(--sh); }
.jba.is-aberto .jba__painel { display: flex; animation: jba-pin .28s var(--ease); }
@keyframes jba-pin { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.jba__topo { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--b); color: #fff; }
.jba__av { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: var(--b); font-weight: 800; font-size: 18px; }
.jba__tit { flex: 1; min-width: 0; }
.jba__tit b { display: block; font-size: 16px; line-height: 1.2; }
.jba__tit span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; opacity: .8; }
.jba__tit span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34c759; }
.jba__fechar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff !important; }
.jba__fechar:hover { background: rgba(255,255,255,.12); }
.jba__msgs { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--bg2); }
.jba__m { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; animation: jba-msg .25s var(--ease) both; }
.jba__m--bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(57,29,34,.08); }
.jba__m--eu { align-self: flex-end; background: var(--b); color: #fff; border-bottom-right-radius: 6px; }
@keyframes jba-msg { from { opacity: 0; transform: translateY(6px); } }
.jba__prods { align-self: stretch; display: grid; gap: 8px; }
.jba__p { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px 8px 8px; border-radius: 14px; background: #fff; border: 1px solid var(--lin); color: var(--ink) !important; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.jba__p:hover { border-color: var(--c); transform: translateY(-1px); }
.jba__p img, .jba__p i { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; background: var(--bg2); display: block; }
.jba__p b { display: block; font-size: 14px; font-weight: 650; line-height: 1.3; }
.jba__p small { display: block; margin-top: 2px; font-size: 12px; color: var(--mut); }
.jba__p strong { font-size: 15px; color: var(--b); white-space: nowrap; }
.jba__links { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.jba__links a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--b); color: var(--b) !important; font-size: 13.5px; font-weight: 700; text-decoration: none !important; background: #fff; }
.jba__links a:hover { background: var(--b); color: #fff !important; }
.jba__chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; background: var(--bg2); scrollbar-width: none; }
.jba__chips::-webkit-scrollbar { display: none; }
.jba .jba__chips button { flex: none; min-height: 36px; padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--lin); font-size: 13.5px; font-weight: 600; color: var(--b); }
.jba__chips button:hover { border-color: var(--c); }
.jba__pensar { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; border-radius: 18px; background: #fff; }
.jba__pensar i { width: 7px; height: 7px; border-radius: 50%; background: var(--mut); animation: jba-pt 1.2s infinite; }
.jba__pensar i:nth-child(2) { animation-delay: .15s; } .jba__pensar i:nth-child(3) { animation-delay: .3s; }
@keyframes jba-pt { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.jba__form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--lin); background: #fff; }
.jba__form input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid var(--lin); border-radius: 999px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg2); }
.jba__form input:focus { outline: none; border-color: var(--c); box-shadow: 0 0 0 3px rgba(232,122,32,.2); background: #fff; }
.jba .jba__form button { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--b) !important; }
.jba__form button:disabled { opacity: .5; }
.jba__ia { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--c); color: var(--b); font-style: normal; font-size: 11px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }
.jba-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Telemóvel e tablet: ícone redondo acima da barra de baixo (Início, Categorias…); painel em ecrã inteiro. */
@media (max-width: 1023px) {
	.jba { --fundo: calc(var(--jb-barra-h, 62px) + env(safe-area-inset-bottom) + 14px); }
	.jba__abrir { right: 14px; width: 56px; height: 56px; padding: 0; justify-content: center; }
	.jba__abrir .jba__txt { display: none; }
	.jba__ic { width: 56px; height: 56px; background: none; color: var(--b); }
	.jba__ic::after { top: 6px; right: 6px; box-shadow: 0 0 0 2px var(--c); }
}
@media (max-width: 600px) {
	.jba__painel { inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; border-radius: 0; }
	.jba__topo { padding-top: calc(12px + env(safe-area-inset-top)); }
	html.jba-travado, html.jba-travado body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .jba *, .jba *::before, .jba *::after { animation: none !important; transition: none !important; } }
@media print { .jba { display: none; } }
