/* Dedicated AI Chatbot page — a full-height single-conversation "app"
   panel below the site header, styled after WhatsApp Web's chat pane
   (green header bar, beige message area, bubble alignment). Unlike the
   floating widget (.vw-*, small corner card), this is the primary content
   of its own page. */

.ac-page {
  background: #e9e3d8;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
}

.ac-panel {
  width: 100%;
  max-width: 820px;
  height: calc(100vh - var(--header-h) - 48px);
  min-height: 480px;
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ac-head {
  background: var(--green);
  color: var(--ivory);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ac-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.ac-title { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; }
.ac-sub { font-size: .78rem; opacity: .85; }
.ac-connected-dot { color: #6fd88a; }

.ac-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f4f1ea;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ac-loading { text-align: center; color: var(--text-lt); font-size: .9rem; margin: auto; }

.ac-msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: .92rem;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.ac-msg-assistant { background: var(--white); align-self: flex-start; border-bottom-left-radius: 4px; }
.ac-msg-visitor { background: var(--green); color: var(--ivory); align-self: flex-end; border-bottom-right-radius: 4px; }
.ac-msg-link { color: var(--gold-dk); font-weight: 600; word-break: break-all; }
.ac-msg-assistant .ac-msg-link { color: var(--gold-dk); }
.ac-msg-visitor .ac-msg-link { color: var(--ivory); text-decoration: underline; }

.ac-status { text-align: center; font-size: .78rem; color: var(--text-lt); }
.ac-status.thinking { font-style: italic; }

.ac-confirm-row { display: flex; gap: 10px; justify-content: center; padding: 10px 20px; background: #f4f1ea; flex-shrink: 0; }
.ac-confirm-btn { padding: 8px 20px; border-radius: var(--r-pill); border: none; font-weight: 700; font-size: .86rem; cursor: pointer; font-family: inherit; transition: transform var(--t); }
.ac-confirm-btn:hover { transform: scale(1.05); }
.ac-confirm-yes { background: #2fae4e; color: #fff; }
.ac-confirm-no { background: var(--ivory-dk); color: var(--text); }

.ac-foot {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.ac-input {
  flex: 1; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  font-family: inherit; font-size: .92rem;
}
.ac-input:focus { outline: none; border-color: var(--gold); }
.ac-send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--green); color: var(--ivory);
  border: none; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t), background var(--t);
}
.ac-send-btn:hover { transform: scale(1.06); background: var(--gold-dk); }

/* First-open language picker — same idea as the widget's, styled for the
   larger panel. */
.ac-lang-intro { text-align: center; margin: auto; padding: 20px; max-width: 420px; }
.ac-lang-intro p { color: var(--text-lt); font-size: .95rem; margin: 14px 0 18px; }
.ac-lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ac-lang-btn {
  padding: 14px 12px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--white); font-size: .98rem; font-weight: 600; color: var(--green);
  cursor: pointer; font-family: inherit; transition: transform var(--t), background var(--t);
}
.ac-lang-btn:hover { background: var(--ivory-dk); transform: scale(1.03); }

/* Lead-capture form shown right after the language pick — gates the
   conversation until Name/Phone/City are supplied. */
.ac-contact-form { text-align: center; margin: auto; padding: 20px; max-width: 380px; width: 100%; }
.ac-contact-field { margin-bottom: 12px; text-align: left; }
.ac-contact-field input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: inherit; font-size: .92rem; box-sizing: border-box;
}
.ac-contact-field input:focus { outline: none; border-color: var(--gold); }
.city-suggestions {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 30;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: var(--sh-md); max-height: 220px; overflow-y: auto; text-align: left;
}
.city-suggestion { padding: 7px 10px; font-size: .8rem; cursor: pointer; }
.city-suggestion:hover, .city-suggestion.active { background: var(--ivory-dk); }
.city-suggestion .cs-region { display: block; font-size: .65rem; color: var(--text-lt); margin-top: 1px; }
.city-suggestion-empty { padding: 7px 10px; font-size: .74rem; color: var(--text-lt); }
.city-suggestion-heading {
  padding: 7px 10px 3px; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--gold); background: var(--ivory);
  position: sticky; top: 0;
}
.ac-contact-error { color: #b23; font-size: .82rem; margin-bottom: 10px; text-align: left; }
.ac-contact-submit {
  width: 100%; padding: 12px; margin-top: 6px;
  border-radius: var(--r-pill); border: none;
  background: var(--gold); color: var(--green);
  font-weight: 700; font-size: .92rem; cursor: pointer; font-family: inherit;
  transition: transform var(--t);
}
.ac-contact-submit:hover { transform: scale(1.02); }

/* Always-visible category quick-switch bar, shown once the chat unlocks —
   lets a visitor jump to a different category's pricing/recipe at any
   point and switch again just by tapping another chip. */
.ac-category-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: #f4f1ea; flex-shrink: 0;
}
.ac-category-bar::-webkit-scrollbar { height: 4px; }
.ac-category-btn {
  flex-shrink: 0; padding: 7px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--white); font-size: .8rem; font-weight: 600; color: var(--green);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background var(--t), transform var(--t);
}
.ac-category-btn:hover { background: var(--ivory-dk); transform: scale(1.04); }
.ac-category-btn.active { background: var(--gold); border-color: var(--gold); }

.ac-error-note { text-align: center; color: #b23; font-size: .88rem; margin: auto; padding: 20px; }
.ac-link-btn { background: none; border: none; color: var(--gold-dk); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: underline; font-family: inherit; display: block; margin: 10px auto 0; }

@media (max-width: 600px) {
  .ac-page { padding: 0; }
  .ac-panel { max-width: 100%; height: calc(100vh - var(--header-h)); border-radius: 0; }
  .ac-msg { max-width: 85%; }
}
