/* =====================================================================
   CURATIO — 1ª tela (imagem + botão sem rolar) e chat de atendimento
   ===================================================================== */

/* ---------- 1ª tela: imagem da campanha + botão "Ver os produtos" visíveis sem rolar ---------- */
.fold { --top: 142px; --cta: 84px; --tab: 0px; background: #fff; }
.fold__img { display: block; position: relative; overflow: hidden; width: 100%;
  height: clamp(340px, calc(100vh - var(--top) - var(--cta) - var(--tab)), 66.7vw);
  height: clamp(340px, calc(100svh - var(--top) - var(--cta) - var(--tab)), 66.7vw); background: #f3ece4; }
.fold__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transition: transform 1.4s var(--ease); }
.fold__img:hover img { transform: scale(1.02); }
.fold__cta { min-height: var(--cta); display: flex; align-items: center; justify-content: center; gap: 14px 28px; flex-wrap: wrap; padding: 12px var(--gut); background: var(--cream, #FBF6EF); border-bottom: 1px solid var(--hair, #eadfd2); }
.fold__btn { min-width: 220px; height: 54px; font-size: 16px; }
.fold__note { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--grey); }
.fold__note .ico { width: 18px; height: 18px; color: var(--accent); }
@media (max-width: 900px) {
  .fold { --top: 108px; --cta: 128px; --tab: 76px; }
  .fold__cta { flex-direction: column; gap: 10px; padding: 14px 20px 16px; align-items: stretch; text-align: center; }
  .fold__btn { width: 100%; }
  .fold__cta .tlink { align-self: center; }
  .fold__note { display: none; }
  .fold__img { height: clamp(300px, calc(100svh - var(--top) - var(--cta) - var(--tab)), 120vw); }
}

/* ---------- chat ---------- */
.chat[hidden] { display: none; }
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 56; height: 54px; padding: 0 22px 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; background: linear-gradient(180deg, #5B83A4, #46698A); color: #fff; font-size: 15px; font-weight: 500; box-shadow: 0 16px 30px -12px rgba(20, 45, 70, .65); transition: transform .2s var(--ease), box-shadow .25s; }
.chat-fab:hover { transform: translateY(-3px); box-shadow: 0 20px 34px -12px rgba(20, 45, 70, .75); }
.chat-fab__dot { position: absolute; top: 6px; right: 8px; width: 13px; height: 13px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.chat.is-open .chat-fab { display: none; }
.chat-panel { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 380px; max-width: calc(100vw - 24px); height: min(580px, calc(100vh - 36px)); display: flex; flex-direction: column; background: #fffdf9; border: 1px solid var(--hair, #eadfd2); border-radius: 20px; box-shadow: 0 30px 70px -20px rgba(30, 40, 50, .45); overflow: hidden; animation: chatIn .28s var(--ease); }
.chat-panel[hidden] { display: none; }
@keyframes chatIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px 20px; background: linear-gradient(135deg, #4F7596, #6C93B3); color: #fff; }
.chat-head strong { display: block; font-weight: 500; font-size: 16px; }
.chat-head small { opacity: .8; font-size: 12.5px; }
.chat-close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; }
.chat-close:hover { background: rgba(255, 255, 255, .14); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; scroll-behavior: smooth; }
.chat-msg { display: flex; flex-direction: column; max-width: 86%; gap: 3px; }
.chat-msg small { font-size: 11px; color: var(--grey-2); padding: 0 6px; }
.chat-msg--cliente { align-self: flex-end; align-items: flex-end; }
.chat-msg--bot, .chat-msg--atendente { align-self: flex-start; }
.chat-bub { padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; background: #fff; border: 1px solid var(--hair, #eadfd2); word-break: break-word; }
.chat-bub b { display: block; font-size: 12px; color: var(--accent-ink); margin-bottom: 2px; font-weight: 600; }
.chat-msg--cliente .chat-bub { background: #4F7596; border-color: #4F7596; color: #fff; border-bottom-right-radius: 5px; }
.chat-msg--bot .chat-bub { background: var(--cream-2, #F4EADF); border-color: transparent; border-bottom-left-radius: 5px; }
.chat-msg--atendente .chat-bub { background: #e8f4fb; border-color: #cfe7f5; border-bottom-left-radius: 5px; }
.chat-link { display: inline-block; margin-top: 8px; color: var(--accent-ink); font-weight: 500; border-bottom: 1px solid currentColor; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 14px 14px; }
.chat-quick:empty { display: none; }
.chat-chip { padding: 9px 14px; border-radius: 999px; border: 1px solid #4F7596; color: #4F7596; background: #fff; font-size: 13.5px; transition: background .2s, color .2s; }
.chat-chip:hover, .chat-chip:active { background: #4F7596; color: #fff; }
.chat-chip--hot { background: #4F7596; color: #fff; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--hair, #eadfd2); background: #fff; }
.chat-form[hidden] { display: none; }
.chat-input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--hair, #eadfd2); background: #fff; font-size: 16px; }
textarea.chat-input { height: auto; padding: 10px 14px; resize: none; font-family: inherit; }
.chat-input:focus { outline: 2px solid rgba(27, 161, 220, .4); border-color: var(--accent); }
.chat-send { width: 46px; height: 46px; border-radius: 50%; background: #4F7596; color: #fff; display: grid; place-items: center; flex: none; }
.chat-send:active { transform: scale(.94); }
.chat-lead { display: grid; gap: 10px; padding: 14px; background: #fff; border: 1px solid var(--hair, #eadfd2); border-radius: 16px; }
.chat-lead p { margin: 0; font-size: 14px; color: var(--grey); }
.chat-lead small { color: var(--grey-2); font-size: 11.5px; }
.chat-err { color: var(--err); font-size: 13px; min-height: 0; margin: 0; }
.chat-err:empty { display: none; }

@media (max-width: 900px) {
  .chat-fab { bottom: 86px; right: 14px; height: 50px; padding: 0 18px 0 14px; }
  .chat-panel { inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100dvh; border-radius: 0; border: 0; }
  .chat-body { padding-bottom: 12px; }
  .chat-form { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.chat-open { overflow: hidden; }
  body.chat-open .tabbar { display: none; }
}
@media print { .chat { display: none; } }
@media (prefers-reduced-motion: reduce) { .chat-panel { animation: none; } .chat-fab:hover { transform: none; } .chat-body { scroll-behavior: auto; } }

/* ---------- painel: aba Atendimento ---------- */
.atd { display: grid; grid-template-columns: 340px 1fr; gap: 16px; min-height: 560px; }
.atd__list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: auto; max-height: 72vh; }
.atd__item { display: grid; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; cursor: pointer; }
.atd__item:hover, .atd__item.on { background: var(--sky-3); }
.atd__item strong { display: flex; justify-content: space-between; gap: 8px; font-weight: 500; font-size: 14.5px; }
.atd__item small { color: var(--grey-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd__item .n { background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.atd__item.done { opacity: .6; }
.atd__thread { background: #fff; border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 560px; max-height: 72vh; }
.atd__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.atd__msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #fbfaf8; }
.atd__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); }
.atd__form textarea { flex: 1; min-height: 46px; max-height: 120px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); font: inherit; resize: vertical; }
.atd__empty { display: grid; place-items: center; text-align: center; color: var(--grey-2); padding: 40px; flex: 1; }
.atd .chat-msg { max-width: 78%; }
.atd .chat-msg--cliente { align-self: flex-start; align-items: flex-start; }
.atd .chat-msg--cliente .chat-bub { background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 5px; border-bottom-right-radius: 16px; }
.atd .chat-msg--atendente { align-self: flex-end; align-items: flex-end; }
.atd .chat-msg--atendente .chat-bub { background: #4F7596; color: #fff; border-color: #4F7596; border-bottom-right-radius: 5px; border-bottom-left-radius: 16px; }
.atd .chat-msg--atendente .chat-bub b { color: #cfe7f5; }
@media (max-width: 900px) { .atd { grid-template-columns: 1fr; } .atd__list { max-height: 260px; } .atd__thread { min-height: 460px; } }

@media (max-width: 900px) {
  .chat-fab { width: 54px; height: 54px; padding: 0; justify-content: center; }
  .chat-fab__txt { display: none; }
}
