/* Assistente Klik · chat de pré-atendimento */
.kchat { position: fixed; right: 22px; bottom: 22px; z-index: 60; font-family: var(--sora, system-ui, sans-serif); }
.kchat__fab { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; background: #0a0a0a; box-shadow: 0 16px 36px -10px rgba(0, 0, 0, .55), 0 0 0 3px rgba(36, 217, 183, .9); transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.kchat__fab:hover { transform: scale(1.06); }
.kchat__fab img { width: 30px; height: 30px; transition: opacity .2s, transform .3s; }
.kchat__x { position: absolute; width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; opacity: 0; transform: rotate(-90deg); transition: opacity .2s, transform .3s; }
.kchat.is-open .kchat__fab img { opacity: 0; transform: rotate(90deg); }
.kchat.is-open .kchat__x { opacity: 1; transform: none; }
.kchat__dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #24d9b7; border: 2.5px solid #0a0a0a; }
.kchat__dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: #24d9b7; opacity: .6; animation: kpulse 2s infinite; }
.kchat.is-open .kchat__dot { display: none; }
@keyframes kpulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.4); opacity: 0; } }

.kchat__teaser { position: absolute; right: 0; bottom: 80px; width: 260px; padding: 16px 18px; border-radius: 18px 18px 4px 18px; background: #fff; color: #121212; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .35); cursor: pointer; animation: kin .5s cubic-bezier(.2, .7, .2, 1); }
.kchat__teaser p { margin: 0; font-size: 14px; line-height: 1.45; }
.kchat__teaser-x { position: absolute; top: -10px; left: -10px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #121212; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
@keyframes kin { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.kchat__box { position: absolute; right: 0; bottom: 80px; width: 380px; height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; color: #121212; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .05); transform-origin: 100% 100%; animation: kopen .35s cubic-bezier(.2, .7, .2, 1); }
.kchat__box[hidden] { display: none; }
@keyframes kopen { from { opacity: 0; transform: translateY(16px) scale(.94); } }

.kchat__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: linear-gradient(135deg, #1f8bff, #3233fd); color: #fff; }
.kchat__av { width: 42px; height: 42px; border-radius: 50%; background: #0a0a0a; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.kchat__head div { flex: 1; min-width: 0; }
.kchat__head b { display: block; font-size: 15px; }
.kchat__head small { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; }
.kchat__head small i { width: 7px; height: 7px; border-radius: 50%; background: #24d9b7; }
.kchat__restart, .kchat__close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.kchat__restart:hover, .kchat__close:hover { background: rgba(255, 255, 255, .3); }

.kchat__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 8px; background: #f4f5f6; overscroll-behavior: contain; }
.kmsg { max-width: 86%; padding: 11px 14px; font-size: 14.5px; line-height: 1.45; border-radius: 18px; animation: kin .3s cubic-bezier(.2, .7, .2, 1); word-wrap: break-word; }
.kmsg--bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06); }
.kmsg--me { align-self: flex-end; background: #121212; color: #fff; border-bottom-right-radius: 6px; }
.kmsg--typing { display: flex; gap: 4px; padding: 14px 16px; }
.kmsg--typing i { width: 7px; height: 7px; border-radius: 50%; background: #b5babf; animation: ktype 1.2s infinite; }
.kmsg--typing i:nth-child(2) { animation-delay: .15s; }
.kmsg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ktype { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.kchat__foot { padding: 12px 14px 14px; background: #fff; border-top: 1px solid #eceef0; display: grid; gap: 8px; }
.kchat__foot:empty { display: none; }
.kchat__opts { display: flex; flex-wrap: wrap; gap: 7px; max-height: 190px; overflow-y: auto; }
.kopt { padding: 9px 14px; border-radius: 999px; border: 1.5px solid #d8dbde; background: #fff; color: #121212; font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s; }
.kopt:hover { border-color: #121212; }
.kopt[aria-pressed="true"] { background: #24d9b7; border-color: #24d9b7; }
.kchat__form { display: flex; gap: 8px; }
.kchat__input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #d8dbde; font: inherit; font-size: 16px; color: #121212; background: #fff; }
.kchat__input:focus { outline: none; border-color: #24d9b7; box-shadow: 0 0 0 4px rgba(36, 217, 183, .2); }
.kchat__input.is-bad { border-color: #e5484d; }
.kchat__input.is-bad::placeholder { color: #e5484d; }
.kchat__send { height: 46px; min-width: 46px; padding: 0 16px; border-radius: 999px; border: 0; background: #121212; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.kchat__send:disabled { opacity: .35; cursor: default; }
.kchat__skip { justify-self: center; border: 0; background: none; color: #6b6f73; font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px; }
.kchat__wa { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 999px; background: #25d366; color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .2s; }
.kchat__wa:hover { transform: translateY(-2px); }
.kchat__wa svg { width: 22px; height: 22px; }

@media (max-width: 520px) {
  .kchat { right: 16px; bottom: 16px; }
  .kchat__box { position: fixed; inset: auto 0 0 0; width: 100%; height: 88vh; height: 88svh; border-radius: 22px 22px 0 0; }
  .kchat.is-open .kchat__fab { display: none; }
  .kchat__teaser { width: 210px; padding: 12px 14px; bottom: 74px; }
  .kchat__teaser p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .kchat *, .kchat { animation: none !important; transition: none !important; }
}
