/* ==========================================================
   CHAT DO CLIENTE
========================================================== */

.customer-menu button[data-customer-action="chat"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-menu-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #d93025;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.customer-menu-chat-badge[hidden] {
  display: none !important;
}

.customer-chat-view {
  display: grid;
  gap: 14px;
}

.customer-chat-intro {
  margin: -2px 0 0;
  color: #686868;
  line-height: 1.5;
}

.customer-chat-state {
  padding: 9px 12px;
  border-radius: 9px;
  background: #e6f4ea;
  color: #137333;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
}

.customer-chat-state[data-state="closed"] {
  background: #f1f3f4;
  color: #5f6368;
}

.customer-chat-older {
  justify-self: center;
  padding: 7px 12px;
  border: 1px solid #d1d5da;
  border-radius: 9px;
  background: #fff;
  color: #333;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.customer-chat-older[hidden] {
  display: none !important;
}

.customer-chat-older:disabled {
  cursor: wait;
  opacity: 0.6;
}

.customer-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: min(52vh, 520px);
  min-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border: 1px solid #d8dadd;
  border-radius: 13px;
  background: #f7f8f9;
  scrollbar-gutter: stable;
}

.customer-chat-empty {
  margin: auto;
  padding: 22px 12px;
  color: #69717a;
  line-height: 1.5;
  text-align: center;
}

.customer-chat-message {
  width: min(86%, 430px);
  padding: 10px 12px;
  border: 1px solid #e0e2e5;
  border-radius: 12px;
  background: #fff;
  overflow-wrap: anywhere;
}

.customer-chat-message[data-sender="customer"] {
  align-self: flex-end;
  border-color: #b9dce9;
  background: #d9eef7;
}

.customer-chat-message[data-sender="admin"] {
  align-self: flex-start;
}

.customer-chat-message__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}

.customer-chat-message__header strong {
  font-size: 0.78rem;
}

.customer-chat-message__header time {
  color: #68717a;
  font-size: 0.68rem;
  white-space: nowrap;
}

.customer-chat-message__body {
  margin: 0;
  color: #202020;
  line-height: 1.45;
  white-space: pre-wrap;
}

.customer-chat-form {
  display: grid;
  gap: 8px;
}

.customer-chat-form label {
  color: #333;
  font-size: 0.88rem;
  font-weight: 750;
}

.customer-chat-form textarea {
  width: 100%;
  min-height: 94px;
  padding: 12px 13px;
  resize: vertical;
  border: 1px solid #c7c9cc;
  border-radius: 11px;
  background: #fff;
  color: #202020;
  font: inherit;
  line-height: 1.45;
  outline: none;
}

.customer-chat-form textarea:focus {
  border-color: #777;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 8%);
}

.customer-chat-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.customer-chat-form__footer span {
  color: #6b7280;
  font-size: 0.75rem;
}

.customer-chat-form__footer button {
  min-width: 118px;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: #202020;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.customer-chat-form__footer button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.customer-chat-view button,
.customer-chat-view textarea,
.customer-menu button[data-customer-action="chat"] {
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 560px) {
  .customer-chat-view {
    gap: 12px;
  }

  .customer-chat-messages {
    height: 430px;
    min-height: 330px;
    padding: 10px;
  }

  .customer-chat-message {
    width: 91%;
  }

  .customer-chat-message__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .customer-chat-form__footer button {
    min-width: 108px;
  }
}

