/* AI Consultant widget — минимальные стили, без зависимостей */

#ai-consultant-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0066ff;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(0, 102, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999998;
  transition: transform 0.2s ease;
}

#ai-consultant-fab:hover {
  transform: scale(1.05);
}

#ai-consultant-window {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ai-consultant-window.open {
  display: flex;
}

#ai-consultant-header {
  background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
}

#ai-consultant-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

#ai-consultant-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

#ai-consultant-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.7;
}

#ai-consultant-close:hover { opacity: 1; }

#ai-consultant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-msg.assistant {
  background: white;
  color: #1d1d1f;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ai-msg.user {
  background: #0066ff;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-msg.typing {
  background: white;
  color: #888;
  font-style: italic;
}

#ai-consultant-input-area {
  padding: 12px;
  border-top: 1px solid #e5e5ea;
  background: white;
  display: flex;
  gap: 8px;
}

#ai-consultant-input {
  flex: 1;
  border: 1px solid #d1d1d6;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  resize: none;
  font-family: inherit;
  max-height: 100px;
}

#ai-consultant-input:focus {
  border-color: #0066ff;
}

#ai-consultant-send {
  background: #0066ff;
  color: white;
  border: none;
  border-radius: 20px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

#ai-consultant-send:disabled {
  background: #c7c7cc;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  #ai-consultant-fab {
    /* Поднимаем выше нижнего sticky-меню сайта (на мобиле перекрывало
       последний пункт). 88px = типовая высота bottom-bar + запас. */
    bottom: 88px;
  }
  #ai-consultant-window {
    right: 8px;
    bottom: 160px;
    width: calc(100vw - 16px);
    height: calc(100vh - 180px);
  }
}
