/* Atendimento: botão flutuante e painel. Usa os tokens de site.css
   (--ink, --paper, --cream, --coral, --line, --white, --serif, --sans). */

.pt-at {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  font: 400 15px/1.6 var(--sans);
  color: var(--ink);
}

/* Nas páginas de passeio a barra .experience-mobile-action ocupa o rodapé. */
@media (max-width: 760px) {
  body[data-page^="passeios/"] .pt-at,
  body[data-page^="ar/excursiones/"] .pt-at {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  /* No checkout o botão flutuante não pode cobrir o envio do formulário. */
  body[data-page$="reservar"] {
    padding-bottom: 76px;
  }
}

/* ------------------------------------------------------------------ FAB */
.pt-at-fab {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 20px 13px 17px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 600 12px/1.2 var(--sans);
  letter-spacing: 0.01em;
  box-shadow: 0 12px 30px -12px #173f3573;
  transition:
    background 0.2s,
    transform 0.2s;
}
.pt-at-fab svg {
  width: 21px;
  height: 21px;
}
.pt-at-fab:hover {
  background: #28584a;
  transform: translateY(-2px);
}
.pt-at-fab[aria-expanded="true"] {
  background: #28584a;
}

/* ---------------------------------------------------------------- painel */
.pt-at-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 28px);
  max-height: min(600px, calc(100svh - 130px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 30px 70px -28px #173f3566;
  animation: pt-at-entra 0.22s ease-out;
}
/* Na conversa o painel assume a altura cheia; no menu segue o conteúdo. */
.pt-at-panel[data-vista="chat"] {
  height: min(600px, calc(100svh - 130px));
}
@keyframes pt-at-entra {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.pt-at-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--ink);
  color: var(--paper);
}
.pt-at-mark {
  width: 30px;
  height: 30px;
  padding: 4px;
  border-radius: 50%;
  background: var(--paper);
}
.pt-at-heading {
  display: grid;
  margin-right: auto;
  line-height: 1.25;
}
.pt-at-heading b {
  font: 400 19px/1.2 var(--serif);
  letter-spacing: -0.02em;
  color: var(--paper);
}
.pt-at-sub {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: #c7d6c6;
}
.pt-at-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid #3f6357;
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
}
.pt-at-icon svg {
  width: 17px;
  height: 17px;
}
.pt-at-icon:hover {
  background: #28584a;
}

/* O painel é uma coluna: só o log rola; cabeçalho, chips e campo ficam fixos. */
.pt-at-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pt-at-menu {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 16px 18px;
}
.pt-at-lead {
  margin-bottom: 14px;
  font: 400 21px/1.25 var(--serif);
  letter-spacing: -0.03em;
}

/* ----------------------------------------------------------- dois cartões */
.pt-at-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  width: 100%;
  margin-bottom: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 0.2s,
    transform 0.2s;
}
.pt-at-card:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}
.pt-at-card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
}
.pt-at-card-icon svg {
  width: 21px;
  height: 21px;
}
.pt-at-card-text {
  display: grid;
  gap: 4px;
  flex: 1;
}
.pt-at-card-text b {
  font-size: 15px;
  font-weight: 600;
}
.pt-at-card-text span {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}
.pt-at-tag {
  justify-self: start;
  margin-top: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cream);
  font: 700 9px/1.6 var(--sans);
  font-style: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #3c5a4f;
}
.pt-at-card-go {
  align-self: center;
  color: var(--muted);
}
.pt-at-card-go svg {
  width: 19px;
  height: 19px;
}
.pt-at-card:hover .pt-at-card-go {
  color: var(--ink);
}
.pt-at-fine {
  padding: 4px 2px 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* -------------------------------------------------------------- conversa */
.pt-at-chat {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 14px 14px 12px;
}
.pt-at-log {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}
.pt-at-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.pt-at-user {
  align-self: flex-end;
  max-width: 88%;
}
.pt-at-avatar {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin-bottom: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
}
.pt-at-bubble {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
  background: var(--white);
  font-size: 13.5px;
  line-height: 1.55;
}
.pt-at-user .pt-at-bubble {
  border-color: var(--ink);
  border-radius: 14px 14px 4px;
  background: var(--ink);
  color: var(--paper);
}
.pt-at-bubble p + p {
  margin-top: 7px;
}
.pt-at-bubble .pt-at-item {
  margin-top: 2px;
  padding-left: 2px;
  font-size: 13px;
}
.pt-at-handoff,
.pt-at-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-right: 8px;
  padding: 9px 15px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}
.pt-at-handoff {
  background: var(--ink);
  color: var(--paper);
}
.pt-at-handoff::after {
  content: "↗";
}
.pt-at-link {
  background: transparent;
  color: var(--ink);
}
.pt-at-link:hover {
  background: var(--cream);
}

.pt-at-typing .pt-at-bubble {
  display: flex;
  gap: 5px;
  padding: 14px;
}
.pt-at-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7d9188;
  animation: pt-at-pulso 1s infinite ease-in-out;
}
.pt-at-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.pt-at-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes pt-at-pulso {
  50% {
    opacity: 0.3;
    transform: translateY(-2px);
  }
}

.pt-at-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 10px;
}
.pt-at-chips:empty {
  margin: 0;
}
.pt-at-chip {
  padding: 8px 13px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
  text-align: left;
}
.pt-at-chip:hover {
  border-color: var(--ink);
  background: var(--cream);
}

.pt-at-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.pt-at-input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: 999px;
  background: var(--white);
  font-size: 13.5px;
}
.pt-at-input::placeholder {
  color: #64776d;
}
.pt-at-send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
}
.pt-at-send svg {
  width: 19px;
  height: 19px;
}
.pt-at-send:hover {
  background: #28584a;
}
.pt-at-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------- celular */
@media (max-width: 560px) {
  .pt-at-fab {
    padding: 11px 17px 11px 14px;
    font-size: 11.5px;
  }
  /* O seletor com atributo precisa ser repetido aqui: sem isso a altura fixa
     da conversa vence a tela cheia por alcance, e o painel para no meio. */
  .pt-at-panel,
  .pt-at-panel[data-vista="chat"] {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    border: 0;
    border-radius: 0;
    animation: none;
  }
  .pt-at-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .pt-at-chat {
    flex: 1;
    min-height: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .pt-at-log {
    flex: 1;
    max-height: none;
  }
  .pt-at-menu {
    padding-top: 22px;
  }
  html.pt-at-aberto,
  html.pt-at-aberto body {
    overflow: hidden;
  }
}

/* O movimento é aditivo: sem ele o painel continua legível e completo. */
@media (prefers-reduced-motion: reduce) {
  .pt-at-panel {
    animation: none;
  }
  .pt-at-typing span {
    animation: none;
  }
}
