/* Toby (Crisp) entry points: Figma "Claude Design - MJ" Section 9, decided rows 0 to 9.
   Loaded only when CRISP_WEBSITE_ID_TOWLOS is set (App\Library\CrispAiChat). */

/* ---------- Buttons (row 0) ---------- */
.crisp-ai-chat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.crisp-ai-chat-btn:hover,
.crisp-ai-chat-btn:focus { text-decoration: none; }
.crisp-ai-chat-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.crisp-ai-chat-btn--sm { height: 30px; padding: 0 10px; gap: 8px; font-size: 12px; }

.crisp-ai-chat-btn .crisp-ai-chat-icon { flex: 0 0 auto; fill: currentColor; }
.crisp-ai-chat-btn .svg-icon { width: 24px; height: 24px; flex: 0 0 auto; color: currentColor; }
.crisp-ai-chat-btn--sm .svg-icon { width: 16px; height: 16px; }

/* Primary: red, for white surfaces */
.crisp-ai-chat-btn--primary { background: var(--red); color: #fff; }
.crisp-ai-chat-btn--primary:hover,
.crisp-ai-chat-btn--primary:focus { background: #e03e40; color: #fff; }

/* Secondary: white, for red banners and the floating button */
.crisp-ai-chat-btn--secondary,
.crisp-ai-chat-btn--outline { background: #fff; color: var(--blue); border-color: rgba(43, 50, 82, .25); }
.crisp-ai-chat-btn--secondary:hover,
.crisp-ai-chat-btn--secondary:focus,
.crisp-ai-chat-btn--outline:hover,
.crisp-ai-chat-btn--outline:focus { color: var(--blue); border-color: rgba(43, 50, 82, .5); background: #fff; }

/* 24/7 pill: red on light buttons, white with red text inside red buttons */
.crisp-ai-chat-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.crisp-ai-chat-btn--sm .crisp-ai-chat-pill { padding: 3px 6px; }
.crisp-ai-chat-btn--primary .crisp-ai-chat-pill { background: #fff; color: var(--red); }

/* Equal-width pair (Ask Toby + Call towlos Support) */
.crisp-ai-chat-pair { display: flex; flex-wrap: wrap; gap: 15px; }
.crisp-ai-chat-pair .crisp-ai-chat-btn--lg { width: 206px; }
.crisp-ai-chat-pair--sm { gap: 12px; }
.crisp-ai-chat-pair--sm .crisp-ai-chat-btn--sm { width: 161px; }

/* "What is Toby?" helper (row 0 tooltip) */
.crisp-ai-chat-whatis { position: relative; display: inline-block; }
.crisp-ai-chat-whatis__btn {
  display: inline-flex; align-items: center; gap: 10px; height: 30px; padding: 0;
  background: none; border: 0; color: var(--blue); font-size: 12px; font-weight: 700;
  text-decoration: underline; cursor: pointer;
}
.crisp-ai-chat-whatis__btn img { width: 16px; height: 16px; }
.crisp-ai-chat-whatis__tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 250px; padding: 12px; border-radius: 4px; background: var(--bs-info, #17A2B8);
  color: #fff; font-size: 15px; font-weight: 700; line-height: 1.35; text-align: center;
  z-index: 20; box-shadow: 0 4px 12px rgba(43, 50, 82, .18);
  pointer-events: none; /* sits over the buttons above it; taps go through */
}
.crisp-ai-chat-whatis__tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: -8px;
  border: 8px solid transparent; border-top-color: var(--bs-info, #17A2B8); border-bottom: 0;
}
.crisp-ai-chat-whatis__tip[hidden] { display: none; }

/* Floating launcher (row 1) is crisp-ai-chat-launcher.js (Matt's animated Toby); it carries its own styles. */

/* ---------- Search card + trailer page banner (rows 2 and 3): white buttons on red ---------- */
@media (min-width: 768px) {
  .crisp-ai-chat-search-card .crisp-ai-chat-pair { flex: 0 0 auto; flex-wrap: nowrap; gap: 12px; }
}
@media (max-width: 767.98px) {
  .crisp-ai-chat-banner { width: 100%; flex-wrap: nowrap; gap: 12px; }
  .crisp-ai-chat-banner .crisp-ai-chat-btn { flex: 1 1 0; width: auto; min-width: 0; height: 30px; padding: 0 10px; gap: 8px; font-size: 12px; }
  .crisp-ai-chat-banner .crisp-ai-chat-icon,
  .crisp-ai-chat-banner .svg-icon { width: 16px; height: 16px; }
  .crisp-ai-chat-banner .crisp-ai-chat-pill { padding: 3px 6px; }
}

/* ---------- Guest HQ, Host HQ, Become a Host, Contact Us: full-width stacked pair on phones (rows 6 to 9) ---------- */
@media (max-width: 767.98px) {
  .crisp-ai-chat-pair--stack-mobile { flex-direction: column; gap: 12px; width: 100%; }
  .crisp-ai-chat-pair--stack-mobile .crisp-ai-chat-btn { width: 100%; }
}

/* ---------- Contact Us (row 6) ---------- */
.crisp-ai-chat-contact-title { margin: 0 0 20px; font-size: 25px; font-weight: 800; line-height: 1.35; color: var(--blue); }
.crisp-ai-chat-contact-intro { margin: 0 0 20px; font-size: 15px; font-weight: 500; color: rgba(43, 50, 82, .75); }
.crisp-ai-chat-card {
  display: flex; flex-direction: column; gap: 12px; align-items: flex-start;
  padding: 24px; margin-bottom: 20px; border: 1px solid rgba(43, 50, 82, .25); border-radius: 12px; background: #fff;
}
.crisp-ai-chat-card__title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--blue); }
.crisp-ai-chat-card__text { margin: 0 0 4px; font-size: 15px; font-weight: 500; line-height: 1.35; color: rgba(43, 50, 82, .75); }
.crisp-ai-chat-contact-email { font-size: 12px; font-weight: 500; color: rgba(43, 50, 82, .5); }
.crisp-ai-chat-contact-email a { color: inherit; }
@media (max-width: 767.98px) {
  .crisp-ai-chat-card .crisp-ai-chat-btn { width: 100%; }
}

/* ---------- Rental record "Still have questions?" (row 5) ---------- */
.crisp-ai-chat-rr-card {
  display: flex; gap: 32px; align-items: center; justify-content: center;
  padding: 20px; margin-top: 24px; border-radius: 12px; background: rgba(43, 50, 82, .05);
}
.crisp-ai-chat-rr-card__team { position: relative; flex: 0 0 184px; height: 74px; }
.crisp-ai-chat-rr-card__avatar {
  position: absolute; top: 9px; width: 64px; height: 64px; overflow: hidden; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 5px rgba(43, 50, 82, .15);
}
.crisp-ai-chat-rr-card__avatar img { position: absolute; max-width: none; }
.crisp-ai-chat-rr-card__avatar--jeff { left: 0; background: var(--red); }
.crisp-ai-chat-rr-card__avatar--jeff img { width: 137.5%; height: 183.33%; left: -11.4%; top: -37.26%; }
.crisp-ai-chat-rr-card__avatar--maggie { left: 120px; background: #FAD744; }
.crisp-ai-chat-rr-card__avatar--maggie img { width: 112.7%; height: 150.26%; left: 0; top: -9.19%; }
.crisp-ai-chat-rr-card__avatar--matt { left: 56px; top: 1px; width: 72px; height: 72px; background: #3772FF; z-index: 1; }
.crisp-ai-chat-rr-card__avatar--matt img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crisp-ai-chat-rr-card__body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.crisp-ai-chat-rr-card__title { margin: 0 0 12px; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--blue); }
.crisp-ai-chat-rr-card__text { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.35; color: rgba(43, 50, 82, .75); }
.crisp-ai-chat-rr-card .crisp-ai-chat-pair { width: 100%; justify-content: center; gap: 16px; }
@media (max-width: 767.98px) {
  .crisp-ai-chat-rr-card { flex-direction: column; gap: 24px; padding: 24px 0; background: none; text-align: center; }
  .crisp-ai-chat-rr-card__team { flex-basis: 74px; width: 185px; }
  .crisp-ai-chat-rr-card__body { align-items: center; gap: 16px; }
  .crisp-ai-chat-rr-card .crisp-ai-chat-pair { flex-direction: column; align-items: center; }
  .crisp-ai-chat-rr-card .crisp-ai-chat-pair .crisp-ai-chat-btn { width: 206px; height: 40px; padding: 0 12px; gap: 12px; font-size: 15px; }
  .crisp-ai-chat-rr-card .crisp-ai-chat-pair .crisp-ai-chat-icon,
  .crisp-ai-chat-rr-card .crisp-ai-chat-pair .svg-icon { width: 24px; height: 24px; }
  .crisp-ai-chat-rr-card .crisp-ai-chat-pair .crisp-ai-chat-pill { padding: 4px 8px; }
}

/* ---------- Trailer page "Have more questions?" (row 4) ---------- */
.crisp-ai-chat-questions-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 40px;
  padding: 0 12px; border: 1.5px solid var(--red); border-radius: 8px; background: #fff;
  color: var(--blue); font-size: 15px; font-weight: 700;
}
.crisp-ai-chat-questions-btn:hover { background: rgba(239, 84, 85, .05); }
.crisp-ai-chat-questions-btn .svg-icon { width: 24px; height: 24px; }
@media (min-width: 768px) {
  .crisp-ai-chat-questions-btn { width: auto; display: inline-flex; }
}

.crisp-ai-chat-questions-modal .modal-dialog { max-width: 480px; }
.crisp-ai-chat-questions-modal .modal-content {
  position: relative; padding: 36px 32px 32px; border: 0; border-radius: 20px;
  box-shadow: 0 12px 40px rgba(43, 50, 82, .25);
}
.crisp-ai-chat-questions-modal__close {
  position: absolute; top: 24px; right: 24px; width: 20px; height: 20px; padding: 0;
  border: 0; background: none; color: var(--blue);
}
.crisp-ai-chat-questions-modal__close img { display: block; width: 20px; height: 20px; }
.crisp-ai-chat-questions-modal__handle { display: none; }
.crisp-ai-chat-questions-modal__title { margin: 0 40px 20px 0; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--blue); }
.crisp-ai-chat-questions-modal__list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.crisp-ai-chat-questions-modal__list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--blue); }
.crisp-ai-chat-questions-modal__list li > img { flex: 0 0 20px; width: 20px; height: 20px; object-fit: contain; }
.crisp-ai-chat-questions-modal__list b { font-weight: 700; }
.crisp-ai-chat-questions-modal__policy { padding-left: 30px; font-size: 12px; font-weight: 700; color: var(--blue); text-decoration: underline; }
.crisp-ai-chat-questions-modal__actions { display: flex; flex-direction: column; gap: 10px; }
.crisp-ai-chat-questions-modal__actions .crisp-ai-chat-btn,
.crisp-ai-chat-questions-modal__actions .btn { width: 100%; }
.crisp-ai-chat-questions-modal__continue {
  display: flex; align-items: center; justify-content: center; height: 40px; border: 0; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 700;
}
.crisp-ai-chat-questions-modal__continue:hover { background: #e03e40; color: #fff; }

/* Phones: bottom sheet instead of the 480 dialog */
@media (max-width: 767.98px) {
  .crisp-ai-chat-questions-modal .modal-dialog.modal-dialog-centered {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; display: block; margin: 0; padding: 0; width: auto; max-width: none;
    min-height: 0; transform: translateY(100%); transition: transform .25s ease-out;
  }
  .crisp-ai-chat-questions-modal.show .modal-dialog.modal-dialog-centered { transform: none; }
  .crisp-ai-chat-questions-modal .modal-content { padding: 10px 24px 28px; border-radius: 20px 20px 0 0; }
  .crisp-ai-chat-questions-modal__handle { display: block; width: 40px; height: 4px; margin: 0 auto 28px; border-radius: 2px; background: rgba(43, 50, 82, .25); }
  .crisp-ai-chat-questions-modal__close { top: 20px; }
}

/* ---------- Crisp's own chatbox ---------- */
/* Our buttons are the launchers, so Crisp's bubble never shows while the chat is minimized (it
   used to flash for a moment on open). Once the chat is open on desktop it is the close (X)
   button and stays. Hooks are Crisp's id and data attributes, not its generated classes. */
#crisp-chatbox [role="button"][data-maximized="false"] { visibility: hidden !important; }
/* Phones: the chat window has its own close (X) in its header. */
#crisp-chatbox[data-mobile-view="true"] [role="button"][data-maximized] { display: none !important; }

/* Phones: dimmed page behind the chat drawer (crisp-ai-chat.js sizes the window to 85%). */
.crisp-ai-chat-scrim { display: none; }
.crisp-ai-chat-drawer-open .crisp-ai-chat-scrim {
  display: block; position: fixed; inset: 0; z-index: 1000000; /* just under Crisp's window (1000002) */
  background: rgba(43, 50, 82, .5);
}
/* Crisp collapses html/body to 0 height while its chat is open on phones (to stop the page scrolling
   behind a full-screen chat), which leaves only a blank strip above the drawer. Keep the page's height
   so it shows dimmed behind the drawer; scrolling stays locked. */
html.crisp-ai-chat-drawer-open.crisp-ai-chat-drawer-open,
html.crisp-ai-chat-drawer-open.crisp-ai-chat-drawer-open body { height: auto !important; overflow: hidden !important; }
