/* BTO Group Reno — AI Chat widget styles. Scoped under .btoai-root. */
.btoai-root {
  --btoai-accent: #0a7d5a;
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 99998; /* below Joinchat (usually bottom-right) so they never overlap */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.btoai-launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--btoai-accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.btoai-launcher:hover { transform: scale(1.06); }

.btoai-panel {
  position: absolute;
  left: 0;
  bottom: 70px;
  width: 408px;
  max-width: calc(100vw - 28px);
  height: 640px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.btoai-root.btoai-open .btoai-panel { display: flex; }

.btoai-head {
  background: var(--btoai-accent);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btoai-title { font-weight: 600; font-size: 15px; flex: 1; }
.btoai-wa {
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 3px 10px;
}
.btoai-wa:hover { background: rgba(255, 255, 255, 0.15); }
.btoai-new {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.9;
}
.btoai-new:hover { opacity: 1; transform: rotate(-45deg); transition: transform 0.15s ease; }
.btoai-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.btoai-msgs {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain; /* don't scroll the page behind the panel */
  padding: 14px;
  background: #f6f7f9;
}
.btoai-msg { display: flex; margin-bottom: 10px; }
.btoai-user { justify-content: flex-end; }
.btoai-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.btoai-bot .btoai-bubble {
  background: #fff;
  color: #1f2733;
  border: 1px solid #e6e8eb;
  border-bottom-left-radius: 4px;
}
.btoai-user .btoai-bubble {
  background: var(--btoai-accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.btoai-bubble a { color: inherit; text-decoration: underline; }
.btoai-typing .btoai-bubble { color: #98a2b3; letter-spacing: 2px; }

.btoai-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eceef0;
  background: #fff;
}
.btoai-input {
  flex: 1;
  border: 1px solid #d7dbe0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
}
.btoai-input:focus { border-color: var(--btoai-accent); }
.btoai-send {
  background: var(--btoai-accent);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.btoai-attach {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 2px;
  line-height: 1;
}
.btoai-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #eceef0;
  background: #f6f7f9;
  font-size: 12px;
  color: #4b5563;
}
.btoai-preview img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.btoai-preview span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btoai-preview-x { background: none; border: none; font-size: 18px; color: #9ca3af; cursor: pointer; }
.btoai-userimg { max-width: 180px; border-radius: 8px; display: block; margin-bottom: 4px; }

/* Quick-question chips above the input (JD-style): single row, swipe/scroll
   sideways. Mouse wheel is mapped to horizontal scroll in JS. */
.btoai-quick {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid #eceef0;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.btoai-quick::-webkit-scrollbar { height: 5px; }
.btoai-quick::-webkit-scrollbar-thumb { background: #d0d5d3; border-radius: 999px; }
.btoai-quickchip {
  flex: 0 0 auto;
  background: #f2f5f4;
  border: 1px solid #e0e6e4;
  color: var(--btoai-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}
.btoai-quickchip:hover { background: #e8efed; }

.btoai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}
.btoai-chip {
  background: #fff;
  border: 1px solid var(--btoai-accent);
  color: var(--btoai-accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.btoai-chip:hover { background: rgba(0, 0, 0, 0.03); }
a.btoai-chip { text-decoration: none; display: inline-block; }
.btoai-chip.btoai-cart {
  background: var(--btoai-accent);
  color: #fff;
  border-color: var(--btoai-accent);
}
.btoai-chip.btoai-cart:hover { filter: brightness(0.96); background: var(--btoai-accent); }

/* JD-style "you may also ask" follow-up suggestions */
.btoai-suggest { margin: 2px 0 10px; }
.btoai-suggest-h { font-size: 12px; color: #98a2b3; margin: 6px 2px 4px; }
.btoai-suggest-q {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 10px;
  padding: 9px 12px;
  margin: 6px 0;
  font-size: 13.5px;
  line-height: 1.35;
  color: #1f2733;
  cursor: pointer;
}
.btoai-suggest-q:hover { background: #f6f7f9; border-color: var(--btoai-accent); }

/* In-chat lead / booking form (overrides the bubble width cap) */
.btoai-bubble.btoai-form2 {
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btoai-form2-title { font-weight: 600; margin-bottom: 2px; }
.btoai-form2 input,
.btoai-form2 textarea {
  border: 1px solid #d7dbe0;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}
.btoai-form2 .lf-submit {
  background: var(--btoai-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 14px;
  cursor: pointer;
}
.btoai-form2 .lf-submit:disabled { opacity: 0.6; }
.btoai-form2-note { font-size: 12.5px; color: #4b5563; line-height: 1.4; }
.btoai-form2 .lf-wa {
  display: block;
  text-align: center;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  margin: 2px 0 4px;
}
.btoai-form2 .lf-wa:hover { filter: brightness(0.96); }

/* Proactive nudge bubble */
.btoai-teaser {
  position: absolute;
  left: 0;
  bottom: 70px;
  width: 232px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 12px 30px 12px 14px;
  font-size: 13.5px;
  line-height: 1.4;
  color: #1f2733;
  cursor: pointer;
  animation: btoai-pop 0.2s ease;
}
.btoai-teaser-txt { display: block; }
.btoai-teaser-x {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
}
@keyframes btoai-pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .btoai-root { left: 12px; bottom: 12px; }
  .btoai-panel { bottom: 66px; }
}
