/* Contextual AI suggestion bubble — sits above the chat FAB */

.davar-context-bubble {
  position: fixed;
  z-index: 1102;
  inset-inline-end: 20px;
  bottom: calc(var(--bottom-nav-h, 68px) + env(safe-area-inset-bottom, 0px) + 20px + 56px + 12px);
  width: min(320px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

body:has(.whatsapp-fab) .davar-context-bubble {
  bottom: calc(var(--bottom-nav-h, 68px) + env(safe-area-inset-bottom, 0px) + 20px + 56px + 12px + 56px + 12px);
}

@media (min-width: 768px) {
  .davar-context-bubble {
    bottom: calc(24px + 56px + 12px);
    width: min(340px, calc(100vw - 32px));
  }
  body:has(.whatsapp-fab) .davar-context-bubble {
    bottom: calc(24px + 56px + 12px + 56px + 12px);
  }
}

.davar-context-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.davar-context-bubble[hidden] {
  display: none !important;
}

.davar-context-bubble.is-hiding {
  opacity: 0;
  transform: translateY(4px);
  transition-duration: 180ms;
}

.davar-context-bubble__inner {
  background: #fff;
  border: 1px solid #E4E7EC;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
  padding: 14px 16px;
  cursor: pointer;
  outline: none;
}

.davar-context-bubble__inner:focus-visible {
  box-shadow: 0 0 0 3px rgba(34, 156, 144, 0.35), 0 12px 32px rgba(16, 24, 40, 0.14);
}

.davar-context-bubble__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.davar-context-bubble__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.davar-context-bubble__brand img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
}

.davar-context-bubble__brand strong {
  font-size: 13px;
  font-weight: 700;
  color: #0B5F58;
}

.davar-context-bubble__close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #667085;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.davar-context-bubble__close:hover {
  background: #F2F4F7;
  color: #101828;
}

.davar-context-bubble__text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #344054;
}

.davar-context-bubble__ref {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #229C90;
}

.davar-context-bubble__cta {
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  color: #0B5F58;
}

.davar-context-bubble__tail {
  display: block;
  width: 14px;
  height: 14px;
  margin: -7px 22px 0 auto;
  background: #fff;
  border-inline-end: 1px solid #E4E7EC;
  border-bottom: 1px solid #E4E7EC;
  transform: rotate(45deg);
}

[dir="rtl"] .davar-context-bubble__tail {
  margin-inline-start: 22px;
  margin-inline-end: auto;
}

/* Prompt chips inside existing chat panel */
.wc-context-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 0;
}

.wc-context-chip {
  appearance: none;
  border: 1px solid #D0D5DD;
  background: #F8FAFC;
  color: #0B5F58;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wc-context-chip:hover {
  border-color: #229C90;
  background: #E8F6F4;
}

@media (prefers-reduced-motion: reduce) {
  .davar-context-bubble {
    transition: none;
  }
}

body.wc-home-active .davar-context-bubble {
  display: none !important;
}
