/* ===================== 1308 STUDIO CHAT WIDGET ===================== */

.chatbot-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(160deg, var(--bordeaux) 0%, var(--bordeaux-deep) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 28px -6px rgba(84, 52, 45, .5);
  z-index: 999998;
  transition: transform .2s ease, box-shadow .2s ease;
}
.chatbot-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -6px rgba(84, 52, 45, .6);
}
.chatbot-toggle svg { width: 26px; height: 26px; }
.chatbot-toggle .chatbot-icon-close { display: none; }
.chatbot-toggle.is-open .chatbot-icon-chat { display: none; }
.chatbot-toggle.is-open .chatbot-icon-close { display: block; }

.chatbot-badge {
  position: absolute;
  top: -2px; right: -2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--champagne);
  border: 2px solid var(--white);
}

.chatbot-panel {
  position: fixed;
  bottom: 5.6rem;
  right: 1.5rem;
  width: 366px;
  max-width: 92vw;
  height: 540px;
  max-height: 72vh;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 30px 70px -20px rgba(28, 9, 18, .45);
  z-index: 999998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.chatbot-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(160deg, var(--bordeaux-deep) 0%, var(--bordeaux) 100%);
  color: var(--white);
  flex-shrink: 0;
}
.chatbot-header-info { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.chatbot-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--champagne);
  color: var(--bordeaux-deep);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--heading, 'Cormorant Garamond', serif);
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
.chatbot-title { font-size: .88rem; font-weight: 700; line-height: 1.2; }
.chatbot-subtitle { font-size: .68rem; color: rgba(255,255,255,.75); display: flex; align-items: center; gap: .3rem; }
.chatbot-subtitle::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.chatbot-close {
  background: rgba(255,255,255,.14);
  border: none;
  color: var(--white);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease;
}
.chatbot-close:hover { background: rgba(255,255,255,.26); }
.chatbot-close svg { width: 14px; height: 14px; }

.chatbot-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--parchment);
}

/* Welcome screen */
.chatbot-welcome {
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.chatbot-greeting {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--dark);
  margin-bottom: .3rem;
}
.chatbot-menu-btn {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--champagne-pale);
  border-radius: 12px;
  padding: .85rem 1rem;
  font-family: var(--body, 'Montserrat', sans-serif);
  font-size: .82rem;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.chatbot-menu-btn:hover {
  border-color: var(--bordeaux);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(163,106,94,.35);
}
.chatbot-menu-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--champagne-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.chatbot-menu-arrow { margin-left: auto; color: var(--taupe); flex-shrink: 0; }
.chatbot-menu-arrow svg { width: 14px; height: 14px; }

/* Thread (FAQ chat) screen */
.chatbot-thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chatbot-back {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--champagne-pale);
  color: var(--taupe);
  font-size: .74rem;
  font-weight: 600;
  padding: .65rem 1rem;
  cursor: pointer;
  flex-shrink: 0;
  text-align: left;
}
.chatbot-back:hover { color: var(--bordeaux); }

.chatbot-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.chatbot-msg {
  max-width: 84%;
  padding: .6rem .8rem;
  border-radius: 12px;
  font-size: .8rem;
  line-height: 1.55;
}
.chatbot-msg-bot {
  align-self: flex-start;
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--champagne-pale);
  border-bottom-left-radius: 3px;
}
.chatbot-msg-link {
  color: var(--bordeaux);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.chatbot-msg-link:hover { color: var(--bordeaux-deep); }
.chatbot-msg-user {
  align-self: flex-end;
  background: var(--bordeaux);
  color: var(--white);
  border-bottom-right-radius: 3px;
}
.chatbot-msg-action {
  align-self: flex-start;
  margin-top: -.2rem;
  background: var(--champagne-pale);
  color: var(--bordeaux-deep);
  border: none;
  border-radius: 999px;
  padding: .45rem .9rem;
  font-size: .74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}
.chatbot-msg-action:hover { background: var(--champagne-light); }

/* One-time contact-capture card, rendered inline at the top of the FAQ thread */
.chatbot-capture {
  align-self: stretch;
  background: var(--white);
  border: 1.5px solid var(--champagne-pale);
  border-radius: 12px;
  padding: .9rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.chatbot-capture-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--bordeaux-deep);
  margin: 0 0 .2rem;
  line-height: 1.4;
}
.chatbot-capture-phone {
  color: var(--bordeaux);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chatbot-capture-phone:hover { color: var(--bordeaux-deep); }
.chatbot-capture-input {
  border: 1.5px solid var(--taupe-light);
  border-radius: 8px;
  padding: .55rem .75rem;
  font-size: .8rem;
  font-family: var(--body, 'Montserrat', sans-serif);
  color: var(--dark);
  outline: none;
  width: 100%;
}
.chatbot-capture-input:focus { border-color: var(--bordeaux); }
.chatbot-capture-actions {
  display: flex;
  gap: .5rem;
  margin-top: .2rem;
}
.chatbot-capture-skip {
  flex: 1;
  background: none;
  border: 1.5px solid var(--taupe-light);
  color: var(--taupe);
  border-radius: 8px;
  padding: .55rem;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
}
.chatbot-capture-skip:hover { border-color: var(--taupe); color: var(--dark); }
.chatbot-capture-submit {
  flex: 1;
  background: var(--bordeaux);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: .55rem;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease;
}
.chatbot-capture-submit:hover { background: var(--bordeaux-deep); }
.chatbot-capture-reassurance {
  font-size: .7rem;
  color: var(--taupe);
  line-height: 1.5;
  margin: 0;
}
.chatbot-capture-note {
  font-size: .7rem;
  color: #b23b3b;
  margin: 0;
  min-height: 1em;
}

.chatbot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .4rem 1rem .8rem;
  flex-shrink: 0;
}
.chatbot-chip {
  background: var(--white);
  border: 1px solid var(--champagne-pale);
  border-radius: 999px;
  padding: .4rem .75rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--bordeaux-deep);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  white-space: nowrap;
}
.chatbot-chip:hover { border-color: var(--bordeaux); background: var(--champagne-pale); }

.chatbot-input-row {
  display: flex;
  gap: .5rem;
  padding: .75rem 1rem;
  background: var(--white);
  border-top: 1px solid var(--champagne-pale);
  flex-shrink: 0;
}
.chatbot-input-row input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--taupe-light);
  border-radius: 999px;
  padding: .6rem 1rem;
  font-size: .82rem;
  font-family: var(--body, 'Montserrat', sans-serif);
  color: var(--dark);
  outline: none;
}
.chatbot-input-row input:focus { border-color: var(--bordeaux); }
.chatbot-input-row button {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bordeaux);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s ease;
}
.chatbot-input-row button:hover { background: var(--bordeaux-deep); }
.chatbot-input-row button svg { width: 16px; height: 16px; }

@media (max-width: 640px) {
  .chatbot-toggle { bottom: 5.5rem; right: 1.1rem; width: 52px; height: 52px; }
  .chatbot-panel { bottom: 9.4rem; right: .75rem; width: calc(100vw - 1.5rem); height: 62vh; }
}
