/**
 * LJO-SITE-116 — Widget chatbot Le Jardam · FAQ orientativo
 * Sem backend · Sem API · Sem coleta de dados
 */

.lj-chat-root {
  --lj-green: #2f7d59;
  --lj-green-dark: #1e5c40;
  --lj-bg: #fafafa;
  --lj-panel: #fff;
  --lj-text: #17211d;
  --lj-muted: #65736d;
  --lj-line: #d8ded8;
  --lj-bot-bg: #eef4f0;
  --lj-user-bg: #2f7d59;
  --lj-wa: #25d366;
  --lj-radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.lj-chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--lj-green);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(47, 125, 89, 0.35);
  z-index: 9990;
  transition: transform 0.15s;
}

.lj-chat-toggle:hover { transform: scale(1.03); }

.lj-chat-toggle-icon { font-size: 1.25rem; }

.lj-chat-window {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - 7rem));
  background: var(--lj-panel);
  border-radius: var(--lj-radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9991;
  overflow: hidden;
  border: 1px solid var(--lj-line);
}

.lj-chat-window.lj-chat-hidden { display: none; }

.lj-chat-header {
  background: var(--lj-green-dark);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lj-chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lj-chat-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lj-chat-status {
  display: block;
  font-size: 0.7rem;
  opacity: 0.85;
}

.lj-chat-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
}

.lj-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--lj-bg);
}

.lj-chat-msg {
  max-width: 88%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  animation: lj-chat-fadeIn 0.25s ease;
}

@keyframes lj-chat-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lj-chat-msg-bot {
  align-self: flex-start;
  background: var(--lj-bot-bg);
  border-bottom-left-radius: 4px;
}

.lj-chat-msg-user {
  align-self: flex-end;
  background: var(--lj-user-bg);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lj-chat-msg-time {
  font-size: 0.65rem;
  opacity: 0.65;
  margin-top: 0.25rem;
}

.lj-chat-quick {
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  border-top: 1px solid var(--lj-line);
  background: var(--lj-panel);
  max-height: 120px;
  overflow-y: auto;
}

.lj-chat-quick-btn {
  background: #fff;
  border: 1px solid var(--lj-green);
  color: var(--lj-green-dark);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
}

.lj-chat-quick-btn:hover {
  background: var(--lj-bot-bg);
}

.lj-chat-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--lj-line);
  background: var(--lj-panel);
}

.lj-chat-btn-whatsapp {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--lj-wa);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.lj-chat-btn-whatsapp small {
  font-weight: 400;
  opacity: 0.85;
}

.lj-chat-disclaimer {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  color: var(--lj-muted);
  text-align: center;
}

.lj-chat-wa-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.lj-chat-wa-modal.lj-chat-hidden { display: none; }

.lj-chat-wa-modal-box {
  background: var(--lj-panel);
  border-radius: var(--lj-radius);
  padding: 1.5rem;
  max-width: 360px;
  text-align: center;
}

.lj-chat-wa-modal-box h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.lj-chat-wa-number {
  font-size: 1.1rem;
  color: var(--lj-green-dark);
}

.lj-chat-wa-msg {
  background: var(--lj-bot-bg);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: left;
  margin: 1rem 0;
}

.lj-chat-btn-close-modal {
  background: var(--lj-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
}

/* LJO-SITE-141 — cards visuais compactos das suítes */
.lj-chat-suite-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  align-self: stretch;
  max-width: 100%;
}

.lj-chat-suite-card {
  display: flex;
  gap: 0.65rem;
  background: var(--lj-panel);
  border: 1px solid var(--lj-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.lj-chat-suite-img {
  width: 88px;
  min-width: 88px;
  height: 72px;
  object-fit: cover;
  display: block;
  background: var(--lj-bot-bg);
}

.lj-chat-suite-body {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.lj-chat-suite-nome {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lj-green-dark);
  line-height: 1.2;
}

.lj-chat-suite-destaque {
  margin: 0;
  font-size: 0.7rem;
  color: var(--lj-muted);
  line-height: 1.3;
}

.lj-chat-suite-qtd {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--lj-text);
}

.lj-chat-suite-photos-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
  background: transparent;
  border: 1px solid var(--lj-green);
  color: var(--lj-green-dark);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.lj-chat-suite-photos-btn:hover,
.lj-chat-suite-photos-btn:focus {
  background: var(--lj-bot-bg);
  outline: 2px solid var(--lj-green);
  outline-offset: 1px;
}

@media (max-width: 480px) {
  .lj-chat-suite-img {
    width: 76px;
    min-width: 76px;
    height: 64px;
  }

  .lj-chat-suite-nome {
    font-size: 0.8rem;
  }
}

/* LJO-SITE-133 — separa chatbot e WhatsApp no desktop/tablet (>480px) */
@media (min-width: 481px) {
  .lj-chat-toggle {
    right: calc(1.5rem + 58px + 0.75rem);
  }
}

@media (max-width: 480px) {
  /* LJO-SITE-131 — faixa inferior alinhada: Atendimento (esq.) + wa-float (dir.) */
  .lj-chat-toggle {
    left: 0.75rem;
    right: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    max-width: calc(100vw - 0.75rem - 0.75rem - 52px - 0.5rem);
    box-shadow: 0 6px 20px rgba(47, 125, 89, 0.32);
    z-index: 9990;
  }

  .wa-float {
    right: 0.75rem;
    left: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
    z-index: 9989;
  }

  .wa-float svg {
    width: 26px;
    height: 26px;
  }

  .lj-chat-window {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    height: min(480px, calc(100vh - 7.5rem - env(safe-area-inset-bottom, 0px)));
    z-index: 9991;
  }

  .lj-chat-toggle-label {
    display: inline;
  }
}
