/* Meus pedidos e Acompanhar pedido estilizam "button" com largura total: o chat define a própria. */
.fale-chat-toggle, .fale-chat-panel button { width: auto; margin: 0; }
.fale-chat-toggle { position: fixed; z-index: 30; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 22px 0 8px; border: 1px solid #ffffff2e; border-radius: 999px; background: linear-gradient(135deg, #0b2f73, #185adb 70%, #2f7bf0); color: #fff; font: inherit; font-size: .95rem; font-weight: 750; letter-spacing: -.01em; box-shadow: 0 14px 32px #0b2f7359, inset 0 1px 0 #ffffff33; cursor: pointer; transition: translate .2s ease, box-shadow .2s ease; }
.fale-chat-toggle:hover { translate: 0 -2px; box-shadow: 0 18px 38px #0b2f7373, inset 0 1px 0 #ffffff33; }
.fale-chat-toggle:focus-visible, .fale-chat-panel a:focus-visible, .fale-chat-panel button:focus-visible { outline: 3px solid #e0a526; outline-offset: 2px; }
.fale-chat-toggle[hidden], .fale-chat-panel[hidden], .fale-chat-form[hidden], .fale-chat-progress[hidden] { display: none; }
.fale-chat-icon, .fale-chat-avatar { display: block; flex-shrink: 0; border-radius: 50%; background: #fff url("logo-fale3d.png") center / 78% no-repeat; }
.fale-chat-icon { width: 42px; height: 42px; box-shadow: 0 0 0 2px #ffffff40; }

.fale-chat-panel { position: fixed; z-index: 40; right: 24px; bottom: 24px; display: flex; flex-direction: column; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 48px)); height: min(640px, calc(100dvh - 48px)); overflow: hidden; border: 1px solid #ffffff; border-radius: 22px; background: #fff; color: #162d4f; box-shadow: 0 28px 70px #0b2f7347, 0 4px 14px #0b2f7314; font-size: .9rem; animation: fale-chat-open .22s ease-out; }
.fale-chat-header { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(135deg, #0b2f73, #185adb 70%, #2f7bf0); color: #fff; }
.fale-chat-avatar { width: 46px; height: 46px; box-shadow: 0 0 0 3px #ffffff33; }
.fale-chat-title { flex: 1; min-width: 0; }
.fale-chat-title strong, .fale-chat-status { display: block; }
.fale-chat-title strong { font-size: 1.02rem; letter-spacing: -.01em; }
.fale-chat-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: .74rem; color: #dce8ff; }
.fale-chat-status::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: #45e08a; box-shadow: 0 0 0 3px #45e08a33; }
.fale-chat-panel .fale-chat-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: #ffffff24; color: #fff; font-size: 1.25rem; line-height: 1; cursor: pointer; transition: background .15s; }
.fale-chat-panel .fale-chat-close:hover { background: #ffffff40; }

.fale-chat-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 18px 16px; background: linear-gradient(180deg, #f3f7fe, #f9fbff); scrollbar-width: thin; scrollbar-color: #c6d5ec transparent; }
.fale-chat-message { position: relative; display: grid; gap: 10px; max-width: 86%; padding: 11px 14px; border-radius: 16px; overflow-wrap: anywhere; animation: fale-chat-in .2s ease-out; }
.fale-chat-message p { margin: 0; white-space: pre-wrap; line-height: 1.5; }
.fale-chat-assistant { align-self: flex-start; margin-left: 34px; border: 1px solid #e6edf8; border-top-left-radius: 5px; background: #fff; box-shadow: 0 3px 10px #0b2f730d; }
.fale-chat-assistant::before { content: ""; position: absolute; left: -35px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #fff url("logo-fale3d.png") center / 78% no-repeat; box-shadow: 0 1px 5px #0b2f7326; }
.fale-chat-user { align-self: flex-end; border-top-right-radius: 5px; background: linear-gradient(135deg, #124bbd, #2470e8); color: #fff; box-shadow: 0 5px 14px #185adb33; }

.fale-chat-typing { display: inline-flex; align-items: center; gap: 5px; padding-block: 15px; }
.fale-chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #7f97ba; animation: fale-chat-dot 1.1s infinite ease-in-out; }
.fale-chat-typing span:nth-child(2) { animation-delay: .15s; }
.fale-chat-typing span:nth-child(3) { animation-delay: .3s; }

.fale-chat-product { display: grid; gap: 8px; padding: 8px; border: 1px solid #dfe8f6; border-radius: 13px; background: #fff; transition: border-color .15s, box-shadow .15s, translate .15s; }
.fale-chat-product-main { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.fale-chat-panel .fale-chat-add { padding: 9px 12px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #124bbd, #2470e8); color: #fff; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.fale-chat-panel .fale-chat-add:disabled { opacity: .6; cursor: default; }
.fale-chat-message p.fale-chat-added { color: #137a3c; font-size: .8rem; font-weight: 650; }
.fale-chat-added a { color: #124bbd; }
.fale-chat-product:hover { translate: 0 -1px; border-color: #185adb; box-shadow: 0 6px 16px #185adb1f; }
.fale-chat-product img { width: 60px; height: 60px; flex-shrink: 0; border-radius: 10px; object-fit: contain; background: #f4f7fc; }
.fale-chat-product-copy { display: grid; gap: 1px; min-width: 0; line-height: 1.3; }
.fale-chat-product-copy strong { font-size: .84rem; }
.fale-chat-product-price { color: #124bbd; font-size: .95rem; font-weight: 800; }
.fale-chat-product-link { color: #5d7192; font-size: .74rem; font-weight: 650; }
.fale-chat-whatsapp { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 11px; background: #137a3c; color: #fff; font-size: .84rem; font-weight: 700; text-decoration: none; transition: background .15s; }
.fale-chat-whatsapp:hover { background: #0f6631; }
.fale-chat-whatsapp svg { width: 18px; height: 18px; flex-shrink: 0; }

.fale-chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 34px; }
.fale-chat-suggestions button { padding: 8px 13px; border: 1px solid #bcd0ee; border-radius: 999px; background: #fff; color: #124bbd; font: inherit; font-size: .8rem; font-weight: 650; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.fale-chat-suggestions button:hover { border-color: #185adb; background: #185adb; color: #fff; }

.fale-chat-form { display: flex; align-items: center; gap: 6px; margin: 12px 14px 14px; padding: 5px 5px 5px 16px; border: 1px solid #d3dfef; border-radius: 999px; background: #fff; box-shadow: 0 3px 12px #0b2f730f; transition: border-color .15s, box-shadow .15s; }
.fale-chat-form:focus-within { border-color: #185adb; box-shadow: 0 0 0 3px #185adb26; }
.fale-chat-form input { flex: 1; width: auto; min-width: 0; padding: 8px 0; border: 0; border-radius: 0; outline: 0; font: inherit; font-size: 16px; color: inherit; background: transparent; box-shadow: none; }
/* A loja contorna todo campo em foco; aqui quem mostra o foco é a borda da caixa inteira. */
.fale-chat-panel .fale-chat-form input:focus-visible { outline: 0; }
.fale-chat-panel .fale-chat-send { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(135deg, #124bbd, #2470e8); color: #fff; cursor: pointer; transition: opacity .15s, scale .15s; }
.fale-chat-panel .fale-chat-send:hover { scale: 1.05; }
.fale-chat-panel .fale-chat-send:disabled { opacity: .5; scale: 1; cursor: default; }
.fale-chat-send svg { width: 20px; height: 20px; }

.fale-chat-progress { display: grid; gap: 6px; padding: 10px 16px; border-bottom: 1px solid #e6edf8; background: #fff; color: #4d6386; font-size: .74rem; font-weight: 650; }
.fale-chat-progress-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.fale-chat-progress-bar span { height: 5px; border-radius: 999px; background: #dfe8f6; transition: background .2s; }
.fale-chat-progress-bar .is-done { background: linear-gradient(90deg, #124bbd, #2470e8); }
.fale-chat-summary { display: grid; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: #f3f7fe; }
.fale-chat-summary div { min-width: 0; }
.fale-chat-summary dt { color: #5d7192; font-size: .72rem; font-weight: 650; }
.fale-chat-summary dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.fale-chat-assistant .fale-chat-note { color: #5d7192; font-size: .74rem; line-height: 1.45; }
.fale-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fale-chat-panel .fale-chat-confirm, .fale-chat-panel .fale-chat-edit { flex: 1 1 auto; padding: 10px 12px; border-radius: 11px; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.fale-chat-panel .fale-chat-confirm { border: 0; background: linear-gradient(135deg, #124bbd, #2470e8); color: #fff; }
.fale-chat-panel .fale-chat-edit { border: 1px solid #bcd0ee; background: #fff; color: #124bbd; }
.fale-chat-panel .fale-chat-confirm:disabled, .fale-chat-panel .fale-chat-edit:disabled { opacity: .55; cursor: default; }

@keyframes fale-chat-open { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fale-chat-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fale-chat-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
    .fale-chat-panel, .fale-chat-message, .fale-chat-typing span { animation: none; }
    .fale-chat-toggle, .fale-chat-product, .fale-chat-panel .fale-chat-send, .fale-chat-progress-bar span { transition: none; }
}
@media (max-width: 640px) {
    .fale-chat-toggle { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: 58px; padding: 0; justify-content: center; }
    .fale-chat-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .fale-chat-panel { right: 16px; bottom: 16px; height: calc(100vh - 32px); height: calc(100dvh - 32px); }
}
