/* ================================================================
   TARA Chat Bot — chat-bot.css
   ================================================================ */

/* ── OVERLAY ──────────────────────────────────────────────────── */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.cb-overlay.cb-open {
  opacity: 1;
  pointer-events: none;
}

/* ── MODAL (bottom sheet on mobile, card on desktop) ──────────── */
.cb-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  pointer-events: none;
  box-shadow: 0 -4px 32px rgba(44,24,16,0.12);
}
.cb-modal.cb-open {
  transform: translateY(0);
  pointer-events: auto;
}

/* Drag handle */
.cb-handle {
  width: 40px;
  height: 4px;
  background: rgba(44,24,16,0.12);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

/* ── HEADER ───────────────────────────────────────────────────── */
.cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(44,24,16,0.07);
  flex-shrink: 0;
}
.cb-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2C1810;
  border: 1.5px solid rgba(197,163,85,0.5);
  color: var(--gold, #C5A355);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cb-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: #2C1810;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.cb-subtitle {
  font-size: 0.72rem;
  color: rgba(44,24,16,0.4);
  letter-spacing: 0.03em;
}
.cb-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(44,24,16,0.05);
  border: 1px solid rgba(44,24,16,0.1);
  color: rgba(44,24,16,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  flex-shrink: 0;
}
.cb-close:hover { background: rgba(44,24,16,0.09); color: #2C1810; }

/* ── MESSAGES ─────────────────────────────────────────────────── */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(44,24,16,0.1) transparent;
  min-height: 0;
  background: #FAFAF8;
}

/* ── MESSAGE BUBBLES ──────────────────────────────────────────── */
.cb-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 85%;
}
.cb-msg--user { align-self: flex-end; align-items: flex-end; }
.cb-msg--ai   { align-self: flex-start; align-items: flex-start; }
.cb-msg__lbl {
  font-size: 0.65rem;
  color: rgba(44,24,16,0.35);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 4px;
}
.cb-msg__bub {
  padding: 8px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  font-family: var(--font-body);
  word-break: break-word;
}
.cb-msg--user .cb-msg__bub {
  background: rgba(197,163,85,0.14);
  border: 1px solid rgba(197,163,85,0.3);
  color: #2C1810;
  border-radius: 12px 12px 3px 12px;
}
.cb-msg--ai .cb-msg__bub {
  background: #ffffff;
  border: 1px solid rgba(44,24,16,0.08);
  color: #2C1810;
  border-radius: 12px 12px 12px 3px;
  box-shadow: 0 1px 4px rgba(44,24,16,0.06);
}

/* ── TYPING INDICATOR ─────────────────────────────────────────── */
.cb-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid rgba(44,24,16,0.08);
  border-radius: 12px 12px 12px 3px;
  padding: 10px 14px;
  box-shadow: 0 1px 4px rgba(44,24,16,0.06);
}
.cb-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(44,24,16,0.25);
  animation: cb-bounce 1.2s ease infinite;
}
.cb-typing span:nth-child(2) { animation-delay: 0.18s; }
.cb-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes cb-bounce {
  0%, 80%, 100% { transform: translateY(0);   opacity: 0.5; }
  40%           { transform: translateY(-5px); opacity: 1;   }
}

/* ── SYSTEM NOTE ──────────────────────────────────────────────── */
.cb-note {
  align-self: center;
  font-size: 0.72rem;
  color: rgba(44,24,16,0.4);
  background: rgba(44,24,16,0.04);
  border-radius: 20px;
  padding: 4px 12px;
  text-align: center;
  font-style: italic;
}

/* ── WHATSAPP CTA ─────────────────────────────────────────────── */
.cb-wa-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25D366;
  color: #fff;
  border-radius: var(--radius, 8px);
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-body);
  text-decoration: none;
  transition: opacity 0.2s;
  margin-top: 2px;
}
.cb-wa-cta:hover { opacity: 0.88; }
.cb-wa-cta svg { flex-shrink: 0; }

/* ── BOOKING CARD ─────────────────────────────────────────────── */
.cb-booking-card {
  align-self: stretch;
  background: #FAF8F5;
  border: 1px solid rgba(197,163,85,0.35);
  border-radius: 8px;
  padding: 14px 16px;
  animation: cb-card-in 0.4s ease;
}
@keyframes cb-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cb-booking-card__eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold, #C5A355);
  margin-bottom: 8px;
}
.cb-booking-card__row {
  font-size: 0.82rem;
  color: rgba(44,24,16,0.75);
  line-height: 1.7;
  font-family: var(--font-body);
}
.cb-booking-card__row strong { color: #2C1810; }
.cb-booking-card__wa {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius, 8px);
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
}
.cb-booking-card__wa:hover { opacity: 0.88; }

/* ── ACTION ROW (chips + call button) ─────────────────────────── */
.cb-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 8px;
  flex-shrink: 0;
  min-height: 48px;
  background: #ffffff;
}
.cb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.cb-chip {
  background: rgba(197,163,85,0.08);
  border: 1px solid rgba(197,163,85,0.35);
  color: #5a3a20;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.cb-chip:hover {
  background: rgba(197,163,85,0.18);
  border-color: rgba(197,163,85,0.55);
}

/* ── CALL BUTTON ──────────────────────────────────────────────── */
.cb-call-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold, #C5A355);
  border: none;
  color: #2C1810;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: opacity 0.2s, transform 0.15s;
}
.cb-call-btn:hover  { opacity: 0.88; transform: scale(1.05); }
.cb-call-btn:active { transform: scale(0.95); }

/* ── INPUT ROW ────────────────────────────────────────────────── */
.cb-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 16px;
  border-top: 1px solid rgba(44,24,16,0.07);
  flex-shrink: 0;
  background: #ffffff;
}
.cb-input {
  flex: 1;
  background: #F5F2EE;
  border: 1px solid rgba(44,24,16,0.12);
  border-radius: 22px;
  color: #2C1810;
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.cb-input::placeholder { color: rgba(44,24,16,0.3); }
.cb-input:focus { border-color: rgba(197,163,85,0.6); }
.cb-input:disabled { opacity: 0.4; pointer-events: none; }
.cb-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold, #C5A355);
  border: none;
  color: #2C1810;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.15s;
}
.cb-send:hover  { opacity: 0.88; transform: scale(1.05); }
.cb-send:active { transform: scale(0.95); }
.cb-send:disabled { opacity: 0.35; pointer-events: none; }

/* ── DESKTOP OVERRIDE ─────────────────────────────────────────── */
@media (min-width: 640px) {
  .cb-modal {
    left: auto;
    right: 2rem;
    bottom: calc(2rem + 56px + 12px + 50px + 12px);
    width: 360px;
    border-radius: 16px;
    max-height: 520px;
    transform: translateY(16px);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
    box-shadow: 0 8px 40px rgba(44,24,16,0.16);
  }
  .cb-modal.cb-open {
    transform: translateY(0);
    opacity: 1;
  }
  .cb-overlay {
    background: transparent;
  }
  .cb-handle { display: none; }
}
