/* Smart search */
.mocbt-ai-search-wrap {
  position: relative;
}

.mocbt-ai-search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 1050;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.16);
  padding: 16px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
}

.mocbt-ai-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.mocbt-ai-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.mocbt-ai-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.14);
}

.mocbt-ai-card-img {
  height: 96px;
  background-size: cover;
  background-position: center;
}

.mocbt-ai-card-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0f2fe, #e0e7ff);
  font-size: 2rem;
  color: #0ea5e9;
}

.mocbt-ai-card-body {
  padding: 12px;
}

.mocbt-ai-cat {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
}

.mocbt-ai-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 4px 0;
}

.mocbt-ai-price {
  font-weight: 700;
  color: #0ea5e9;
  font-size: 0.85rem;
}

.mocbt-ai-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* Floating assistant */
.mocbt-ai-root {
  position: fixed;
  z-index: 1060;
  right: 20px;
  bottom: 88px;
  font-family: inherit;
}

.mocbt-ai-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0284c7 0%, #6366f1 55%, #8b5cf6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mocbt-ai-fab:hover {
  transform: scale(1.04);
  box-shadow: 0 16px 44px rgba(99, 102, 241, 0.55);
}

.mocbt-ai-fab-glow {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: inherit;
  filter: blur(12px);
  opacity: 0.5;
  z-index: -1;
  animation: mocbt-ai-pulse 2.5s ease-in-out infinite;
}

@keyframes mocbt-ai-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.06);
  }
}

.mocbt-ai-fab-open {
  transform: scale(0.95);
}

.mocbt-ai-panel {
  position: fixed;
  right: 20px;
  bottom: 160px;
  width: min(400px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 180px));
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 20px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  animation: mocbt-ai-slide-up 0.35s ease;
}

@keyframes mocbt-ai-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mocbt-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  background: linear-gradient(135deg, #0b1220, #1e293b);
  color: #fff;
  cursor: move;
}

.mocbt-ai-kicker {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  margin: 0;
}

.mocbt-ai-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 2px 0 0;
}

.mocbt-ai-icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-left: 4px;
  cursor: pointer;
}

.mocbt-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  min-height: 200px;
  max-height: 320px;
}

.mocbt-ai-msg {
  margin-bottom: 12px;
  animation: mocbt-ai-fade 0.3s ease;
}

@keyframes mocbt-ai-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mocbt-ai-msg-user {
  text-align: right;
}

.mocbt-ai-msg-user .mocbt-ai-bubble {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #fff;
  margin-left: auto;
}

.mocbt-ai-msg-assistant .mocbt-ai-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}

.mocbt-ai-h {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
  color: #0f172a;
}

.mocbt-ai-bubble {
  display: inline-block;
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
}

.mocbt-ai-msg-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mocbt-ai-typing {
  padding: 0 16px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: #64748b;
}

.mocbt-ai-typing-label {
  font-weight: 600;
  color: #475569;
}

.mocbt-ai-typing-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #e2e8f0;
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: mocbt-ai-spin 0.75s linear infinite;
  flex-shrink: 0;
}

.mocbt-ai-typing-processing .mocbt-ai-typing-spinner {
  border-top-color: #7c3aed;
}

.mocbt-ai-typing-dots {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.mocbt-ai-typing-dots span {
  width: 6px;
  height: 6px;
  background: #94a3b8;
  border-radius: 50%;
  animation: mocbt-ai-dot 1s infinite;
}

.mocbt-ai-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.mocbt-ai-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes mocbt-ai-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mocbt-ai-dot {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.mocbt-ai-quick {
  padding: 0 12px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 108px;
  overflow-y: auto;
}

.mocbt-ai-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.mocbt-ai-chip:hover {
  background: #e0f2fe;
  border-color: #0ea5e9;
}

.mocbt-ai-chip-live {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  color: #fff;
  border-color: transparent;
}

.mocbt-ai-chip-live:hover {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #fff;
}

.mocbt-ai-info-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px 4px;
}

.mocbt-ai-info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc, #fff);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.mocbt-ai-info-card strong {
  display: block;
  font-size: 0.85rem;
}

.mocbt-ai-info-card small {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 2px;
}

.mocbt-ai-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: rgba(248, 250, 252, 0.9);
}

.mocbt-ai-compose textarea {
  resize: none;
  border-radius: 12px;
  font-size: 0.88rem;
}

.mocbt-rich-link,
.mocbt-rich-email {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(2, 132, 199, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.mocbt-rich-link:hover,
.mocbt-rich-email:hover {
  color: #0369a1;
  border-bottom-color: #0369a1;
}
.mocbt-lc-bubble .mocbt-rich-link,
.mocbt-lc-bubble .mocbt-rich-email {
  color: #0369a1;
}

.mocbt-ai-pay-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px 4px;
}
.mocbt-ai-pay-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.mocbt-ai-pay-card:hover {
  border-color: #0ea5e9;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.15);
  transform: translateY(-2px);
}
.mocbt-ai-pay-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e0f2fe, #ede9fe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0369a1;
  flex-shrink: 0;
}
.mocbt-ai-pay-card strong {
  display: block;
  font-size: 0.88rem;
  color: #0f172a;
}
.mocbt-ai-pay-card small {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
}

.mocbt-ai-foot {
  font-size: 0.65rem;
  text-align: center;
  color: #94a3b8;
  margin: 0;
  padding: 0 12px 10px;
}

.mocbt-ai-trigger-toast {
  position: fixed;
  right: 20px;
  bottom: 168px;
  width: min(340px, calc(100vw - 40px));
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(14, 165, 233, 0.2);
  z-index: 1055;
  animation: mocbt-ai-slide-up 0.4s ease;
}

.mocbt-ai-trigger-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 1.25rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
}

.mocbt-ai-trigger-text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  padding-right: 20px;
}

.mocbt-reason-tips {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}

.mocbt-reason-tips li {
  padding: 6px 10px;
  margin-bottom: 6px;
  background: rgba(14, 165, 233, 0.06);
  border-radius: 8px;
  font-size: 0.85rem;
}

.mocbt-reason-tips li::before {
  content: '✓ ';
  color: #0ea5e9;
  font-weight: 700;
}

@media (max-width: 576px) {
  .mocbt-ai-root {
    right: 12px;
    bottom: 76px;
  }
  .mocbt-ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 140px;
  }
  .mocbt-ai-fab-label {
    display: none;
  }
  .mocbt-ai-search-grid {
    grid-template-columns: 1fr;
  }
}

/* Offset when live chat FAB present */
.mocbt-lc-root ~ .mocbt-ai-root,
body:has(.mocbt-lc-root) .mocbt-ai-root {
  bottom: 100px;
}

/* AI thinking state */
.mocbt-ai-typing-thinking .mocbt-ai-typing-spinner {
  border-top-color: #6366f1;
  animation: mocbt-ai-spin 0.75s linear infinite, mocbt-ai-pulse 1.2s ease-in-out infinite;
}

@keyframes mocbt-ai-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0);
  }
}

/* Smart reply suggestions after assistant messages */
.mocbt-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 4px 12px;
  margin-top: 4px;
}

.mocbt-ai-suggestion-chip {
  border: 1px dashed #94a3b8;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.72rem;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mocbt-ai-suggestion-chip:hover {
  background: #eef2ff;
  border-color: #6366f1;
  color: #4338ca;
}

.mocbt-ai-msg-assistant .mocbt-ai-bubble {
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
