/* Chat da Maison Clinics. Um elemento só: o botão cresce e vira o painel, e volta pelo mesmo caminho.
   Posição: canto direito. No celular sobe pela altura de --chat-base (a barra fixa da página). */
.mc-chat {
  --p: #F4F0E8; --t: #2B3420; --v: #37432A; --o: #C5AA78; --oc: #E8D7AC; --linha: rgba(43, 52, 32, .14);
  --metal: linear-gradient(112deg, rgba(255,255,255,0) 30%, rgba(255,250,235,.6) 47%, rgba(255,255,255,0) 64%),
           linear-gradient(180deg, #F6E8C2 0%, #DCC28A 45%, #BD9C60 100%);
  --dur: .52s; --curva: cubic-bezier(.22, .8, .2, 1);
  position: fixed; z-index: 90; right: 28px; bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  width: 76px; height: 76px; border-radius: 38px;
  background: var(--v); color: var(--p); overflow: hidden;
  font-family: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 17px; line-height: 1.45;
  box-shadow: 0 14px 34px rgba(32, 38, 22, .34), inset 0 0 0 3px var(--o);
  transition: width var(--dur) var(--curva), height var(--dur) var(--curva), border-radius var(--dur) var(--curva),
              background-color var(--dur) var(--curva), box-shadow var(--dur) var(--curva), transform .6s var(--curva), opacity .6s ease,
              bottom .6s var(--curva), right var(--dur) var(--curva);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
.mc-chat[data-chegou="0"] { transform: translateY(18px); opacity: 0; pointer-events: none; }
.mc-chat *, .mc-chat *::before, .mc-chat *::after { box-sizing: border-box; }
.mc-chat button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mc-chat :focus-visible { outline: 2px solid var(--o); outline-offset: 2px; }

/* ---- fechado: o botão ---- */
/* redondo, com aro dourado. Fechado, ele chama a atenção de tempos em tempos: cresce um pouco e solta dois anéis */
.mc-lanca { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; transition: opacity .22s ease; }
.mc-lanca svg { width: 42px; height: 42px; color: var(--oc); }
.mc-lanca svg .mc-d { animation: mc-pulsa 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mc-lanca svg .mc-d:nth-of-type(2) { animation-delay: .18s; } .mc-lanca svg .mc-d:nth-of-type(3) { animation-delay: .36s; }
.mc-chat[data-aberto="0"][data-chegou="1"] { animation: mc-chama 3.6s ease-in-out 1.2s infinite; }
@keyframes mc-chama {
  0%, 60%, 100% { transform: scale(1); box-shadow: 0 14px 34px rgba(32, 38, 22, .34), inset 0 0 0 3px #C5AA78, 0 0 0 0 rgba(197, 170, 120, 0), 0 0 0 0 rgba(197, 170, 120, 0); }
  7% { transform: scale(1.08); }
  14% { transform: scale(1); box-shadow: 0 14px 34px rgba(32, 38, 22, .34), inset 0 0 0 3px #C5AA78, 0 0 0 0 rgba(197, 170, 120, .7), 0 0 0 0 rgba(197, 170, 120, .45); }
  46% { box-shadow: 0 14px 34px rgba(32, 38, 22, .34), inset 0 0 0 3px #C5AA78, 0 0 0 20px rgba(197, 170, 120, 0), 0 0 0 36px rgba(197, 170, 120, 0); }
}
.mc-chat[data-aberto="1"] .mc-lanca { opacity: 0; pointer-events: none; }

/* ---- aberto: o painel ---- */
.mc-chat[data-aberto="1"] { width: min(408px, calc(100vw - 32px)); height: min(660px, calc(100svh - 56px)); border-radius: 26px;
  background: var(--p); color: var(--t); box-shadow: 0 30px 70px rgba(32, 38, 22, .36), inset 0 0 0 1px var(--linha); }
.mc-painel { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden;
  transition: opacity .3s ease .16s, visibility 0s linear .5s; }
.mc-chat[data-aberto="1"] .mc-painel { opacity: 1; visibility: visible; transition: opacity .3s ease .2s, visibility 0s; }

/* o cabeçalho: barra verde firme, a medalha de metal com a porta da marca, o nome grande, o WhatsApp e o fechar */
.mc-topo { flex: none; display: flex; align-items: center; gap: 12px; height: 78px; padding: 0 10px 0 16px; background: var(--v); color: var(--p); position: relative; z-index: 2;
  box-shadow: 0 8px 18px rgba(20, 26, 12, .18); }
.mc-topo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--metal); }
.mc-medalha { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--metal);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -1px 0 rgba(110,80,30,.35), 0 4px 10px rgba(0,0,0,.28); }
.mc-medalha svg { width: 19px; height: 28px; color: var(--v); }
.mc-nome { flex: 1; min-width: 0; }
.mc-nome b { display: block; font-family: 'Noto Serif Display', Georgia, serif; font-weight: 700; font-stretch: 66%; font-size: 27px; letter-spacing: -.01em; line-height: 1; }
.mc-nome span { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 13.5px; line-height: 1; color: var(--oc); white-space: nowrap; }
.mc-vivo { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--oc); animation: mc-vivo 2.4s ease-out infinite; }
@keyframes mc-vivo { 0% { box-shadow: 0 0 0 0 rgba(232, 215, 172, .6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(232, 215, 172, 0); } }
.mc-zap-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--p); text-decoration: none;
  box-shadow: inset 0 0 0 1.5px rgba(232, 215, 172, .5); transition: background-color .2s ease; }
.mc-zap-ic:hover { background: rgba(244, 240, 232, .14); }
.mc-zap-ic svg { width: 21px; height: 21px; }
.mc-fechar { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: background-color .2s ease; }
.mc-fechar:hover { background: rgba(244, 240, 232, .14); }
.mc-fechar svg { width: 18px; height: 18px; }

/* a conversa vazia abre com a recepção da Maison, com o letreiro; a faixa recolhe na primeira pergunta */
.mc-capa { flex: none; height: 0; background: #2F3A24 url(img/chat-capa.webp) center 42% / cover no-repeat; transition: height .5s var(--curva); position: relative; }
.mc-capa::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,26,12,.28), rgba(20,26,12,0) 40%, rgba(244,240,232,0) 78%, rgba(244,240,232,.55)); }
.mc-chat[data-vazio="1"] .mc-capa { height: 136px; }
@media (max-height: 640px) { .mc-chat[data-vazio="1"] .mc-capa { height: 84px; } }
.mc-saudacao b { display: block; font-family: 'Noto Serif Display', Georgia, serif; font-weight: 700; font-stretch: 66%; font-size: 31px; line-height: 1; letter-spacing: -.015em; color: var(--t); }
.mc-saudacao span { display: block; margin-top: 7px; font-size: 15px; line-height: 1.35; color: rgba(43, 52, 32, .72); }
.mc-assuntos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.mc-assuntos button { min-height: 78px; padding: 12px 14px 13px; border-radius: 16px; background: #FFFDF8; color: var(--t); text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; box-shadow: inset 0 0 0 1px rgba(197, 170, 120, .75);
  transition: box-shadow .2s ease, transform .25s var(--curva); animation: mc-sobe .45s var(--curva) both; }
.mc-assuntos button:nth-child(2) { animation-delay: .05s; } .mc-assuntos button:nth-child(3) { animation-delay: .1s; } .mc-assuntos button:nth-child(4) { animation-delay: .15s; }
.mc-assuntos button:hover { box-shadow: inset 0 0 0 1.5px var(--o), 0 8px 18px rgba(60, 40, 10, .1); transform: translateY(-2px); }
.mc-assuntos button b { font-family: 'Noto Serif Display', Georgia, serif; font-weight: 600; font-stretch: 76%; font-size: 21px; line-height: 1.05; }
.mc-assuntos button span { font-size: 13.5px; line-height: 1.3; color: rgba(43, 52, 32, .72); }
.mc-assuntos button.destaque { background: var(--v); color: var(--p); box-shadow: inset 0 0 0 1px rgba(232, 215, 172, .4); }
.mc-assuntos button.destaque span { color: var(--oc); }
.mc-zap-linha { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 16px; border-radius: 16px; text-decoration: none; color: var(--t);
  background: var(--metal); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px rgba(60, 40, 10, .16); font-size: 15px; animation: mc-sobe .45s var(--curva) .2s both; }
.mc-zap-linha svg { width: 21px; height: 21px; flex: none; }
.mc-zap-linha b { font-weight: 700; }

/* a resposta da assistente vem ao lado da medalha da porta */
.mc-linha { display: flex; align-items: flex-end; gap: 8px; max-width: 92%; animation: mc-sobe .36s var(--curva) both; }
.mc-linha .mc-msg { max-width: none; animation: none; }
.mc-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--metal); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.mc-av svg { width: 11px; height: 16px; color: var(--v); }

.mc-rolo { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--linha) transparent; }
.mc-msg { max-width: 86%; padding: 11px 15px 12px; border-radius: 18px; white-space: pre-wrap; overflow-wrap: anywhere; animation: mc-sobe .36s var(--curva) both; }
.mc-msg.a { align-self: flex-start; background: #FFFDF8; box-shadow: inset 0 0 0 1px var(--linha); border-bottom-left-radius: 6px; }
.mc-msg.u { align-self: flex-end; background: var(--v); color: var(--p); border-bottom-right-radius: 6px; }
@keyframes mc-sobe { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mc-pontos { display: inline-flex; gap: 5px; padding: 6px 0 4px; }
.mc-pontos i { width: 7px; height: 7px; border-radius: 50%; background: var(--o); animation: mc-pulsa 1.1s ease-in-out infinite; }
.mc-pontos i:nth-child(2) { animation-delay: .16s; } .mc-pontos i:nth-child(3) { animation-delay: .32s; }
@keyframes mc-pulsa { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.mc-sug { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mc-sug button { min-height: 44px; padding: 9px 16px; border-radius: 22px; box-shadow: inset 0 0 0 1.5px var(--o); font-size: 16px; font-weight: 500; color: var(--t); text-align: left;
  transition: background-color .2s ease, box-shadow .2s ease; }
.mc-sug button:hover { background: rgba(197, 170, 120, .18); }

.mc-pe { flex: none; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linha); background: var(--p); }
.mc-form { display: flex; align-items: flex-end; gap: 8px; background: #FFFDF8; border-radius: 26px; box-shadow: inset 0 0 0 1px var(--linha); padding: 6px 6px 6px 18px; }
.mc-form:focus-within { box-shadow: inset 0 0 0 1.5px var(--v); }
.mc-form textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: none; font: inherit; color: var(--t); line-height: 1.4; padding: 9px 0; max-height: 120px; }
.mc-form textarea:focus-visible { outline: 0; }
.mc-form textarea::placeholder { color: rgba(43, 52, 32, .55); }
.mc-enviar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--v) !important; color: var(--p) !important; display: grid; place-items: center; transition: opacity .2s ease, transform .2s var(--curva); }
.mc-enviar svg { width: 19px; height: 19px; }
.mc-enviar[disabled] { opacity: .35; cursor: default; }
.mc-enviar:not([disabled]):active { transform: scale(.94); }
.mc-zap { margin-top: 10px; width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 25px; text-decoration: none;
  background: var(--metal); color: var(--t); font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 6px 14px rgba(60, 40, 10, .18); }
.mc-zap svg { width: 21px; height: 21px; }
.mc-aviso { margin: 7px 4px 0; font-size: 11.5px; line-height: 1.2; color: rgba(43, 52, 32, .55); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mc-veu { position: fixed; inset: 0; z-index: 89; background: rgba(24, 30, 16, .5); opacity: 0; pointer-events: none; transition: opacity .4s ease; }

/* ---- celular: o botão é um círculo; aberto, vira uma folha que sobe de baixo ---- */
@media (max-width: 640px) {
  .mc-chat { right: 16px; bottom: calc(var(--chat-base, 0px) + 16px + env(safe-area-inset-bottom, 0px)); width: 64px; height: 64px; border-radius: 32px; }
  .mc-lanca svg { width: 36px; height: 36px; }
  /* na primeira tela do celular o canto de baixo é do preço e do selo: o botão fica em cima, sob o cabeçalho,
     e desce para o canto de baixo quando a pessoa rola */
  .mc-chat[data-topo="1"]:not([data-aberto="1"]) { bottom: calc(100svh - 66px); width: 54px; height: 54px; border-radius: 27px; }
  .mc-chat[data-topo="1"]:not([data-aberto="1"]) .mc-lanca svg { width: 31px; height: 31px; }
  .mc-balao { right: 92px; bottom: calc(var(--chat-base, 0px) + 22px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 112px); }
  .mc-balao[data-topo="1"] { opacity: 0 !important; pointer-events: none !important; }
  .mc-chat[data-aberto="1"] { right: 0; bottom: 0; width: 100vw; height: var(--mc-alt, min(88svh, 740px)); border-radius: 26px 26px 0 0; }
  .mc-veu[data-on="1"] { opacity: 1; pointer-events: auto; }
  .mc-msg { max-width: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .mc-chat, .mc-painel, .mc-lanca, .mc-veu, .mc-balao { transition: none !important; }
  .mc-chat, .mc-lanca svg .mc-d { animation: none !important; }
  .mc-msg, .mc-pontos i { animation: none !important; }
}

/* ---- o que a assistente faz na página ---- */
.mc-msg .mc-txt { display: block; }
.mc-oferta { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linha); }
.mc-zap-texto { margin: 0 0 10px; font-size: 15px; line-height: 1.4; color: rgba(43, 52, 32, .78); white-space: normal; }
.mc-zap.mc-zap-msg { margin-top: 0; min-height: 46px; font-size: 16px; }
/* aviso curto de para onde a página foi levada: fica acima do botão do chat e some sozinho */
.mc-ida { position: fixed; z-index: 90; right: 28px; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); max-width: min(320px, calc(100vw - 32px));
  padding: 11px 18px 12px; border-radius: 22px; background: #F4F0E8; color: #2B3420; font-family: Switzer, system-ui, sans-serif; font-size: 16px; font-weight: 500; line-height: 1.3;
  box-shadow: 0 12px 28px rgba(32, 38, 22, .22), inset 0 0 0 1.5px #C5AA78; opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .35s ease, transform .5s cubic-bezier(.22, .8, .2, 1); }
.mc-ida[data-on="1"] { opacity: 1; transform: none; }
@media (max-width: 640px) { .mc-ida { right: 16px; bottom: calc(var(--chat-base, 0px) + 86px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .mc-ida { transition: none !important; } }

/* ---- o balão ao lado do botão: diz para que ele serve. Tocar nele também abre a conversa ---- */
.mc-balao { position: fixed; z-index: 90; right: 116px; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); margin: 0; border: 0; cursor: pointer; text-align: left;
  padding: 10px 18px 11px; border-radius: 20px 20px 6px 20px; background: #F4F0E8; color: #2B3420; font-family: Switzer, system-ui, sans-serif; line-height: 1.25;
  box-shadow: 0 12px 28px rgba(32, 38, 22, .22), inset 0 0 0 1.5px #C5AA78; opacity: 0; transform: translateX(14px) scale(.96); transform-origin: right bottom; pointer-events: none;
  transition: opacity .4s ease, transform .6s cubic-bezier(.22, .8, .2, 1), bottom .6s cubic-bezier(.22, .8, .2, 1); -webkit-tap-highlight-color: transparent; }
.mc-balao b { display: block; font-size: 17px; font-weight: 600; white-space: nowrap; }
.mc-balao span { display: block; font-size: 14px; color: rgba(43, 52, 32, .75); white-space: nowrap; }
.mc-balao[data-on="1"] { opacity: 1; transform: none; pointer-events: auto; }
.mc-balao:focus-visible { outline: 2px solid #37432A; outline-offset: 2px; }
.mc-ida { bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) {
  .mc-balao { right: 92px; bottom: calc(var(--chat-base, 0px) + 22px + env(safe-area-inset-bottom, 0px)); max-width: calc(100vw - 112px); }
  .mc-balao[data-topo="1"] { opacity: 0 !important; pointer-events: none !important; }
  .mc-ida { bottom: calc(var(--chat-base, 0px) + 96px + env(safe-area-inset-bottom, 0px)); }
}
