/* ============================= */
/* CHAT WIDGET */
/* ============================= */

.mywp-chat-widget {
  position: fixed;
  bottom: 90px; 
  right: 20px;

  width: 340px;
  height: 420px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  z-index: 9999;

  /* СКРЫТО */
  opacity: 0;
  transform: translateY(200px);
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.mywp-chat-widget.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ============================= */
/* HEADER */
/* ============================= */

.mywp-chat-header {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
}

/* ============================= */
/* MESSAGES */
/* ============================= */

.mywp-chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #f9fafb;
  font-size: 14px;
}

/* ============================= */
/* INPUT */
/* ============================= */

.mywp-chat-input {
  display: flex;
  border-top: 1px solid #e5e7eb;
}

.mywp-chat-input input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 14px;
  outline: none;
}

.mywp-chat-input button {
  background: #4f46e5;
  color: #fff;
  border: none;
  padding: 0 18px;
  cursor: pointer;
}

/* ============================= */
/* TOGGLE BUTTON */
/* ============================= */

.mywp-chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;

  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);

  color: #fff;
  font-size: 26px;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  z-index: 10000;
}
/* ============================= */
/* CHAT BUBBLES */
/* ============================= */

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  margin-bottom: 14px; 
  line-height: 1.45;
  font-size: 14px;
  word-wrap: break-word;
}
.msg.user + .msg.bot,
.msg.bot + .msg.user {
  margin-top: 6px;
}
/* USER */
.msg.user {
  background: #4f46e5;
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

/* AI */
.msg.bot {
  background: #e5e7eb;
  color: #111;
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
@media (max-width: 768px) {

  .mywp-chat-widget {
    width: 100%;
    height: 70vh;
    right: 0;
    left: 0;
    bottom: 0;
    border-radius: 12px 12px 0 0;
  }

  .mywp-chat-toggle {
    right: 15px;
    bottom: 15px;
  }

  .mywp-chat-messages {
    max-height: calc(70vh - 110px);
  }
}
