/* 有限会社イーコム サイト案内AI */

.ecom-chatbot {
  position: fixed;
  right: 22px;
  bottom: 104px;
  width: min(380px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 150px));
  background: #ffffff;
  border: 1px solid rgba(20, 72, 130, 0.12);
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(10, 35, 70, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: inherit;
}

.ecom-chatbot.is-open {
  display: flex;
}

.ecom-chatbot__header {
  background: linear-gradient(135deg, #005bd6 0%, #00aa96 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ecom-chatbot__title {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.4;
}

.ecom-chatbot__subtitle {
  font-size: 0.78rem;
  opacity: 0.9;
  margin-top: 2px;
}

.ecom-chatbot__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ecom-chatbot__messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f7fbff;
}

.ecom-chatbot__message {
  display: flex;
  margin-bottom: 12px;
}

.ecom-chatbot__message--user {
  justify-content: flex-end;
}

.ecom-chatbot__bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.ecom-chatbot__message--bot .ecom-chatbot__bubble {
  background: #ffffff;
  color: #243044;
  border: 1px solid rgba(20, 72, 130, 0.08);
  border-top-left-radius: 6px;
}

.ecom-chatbot__message--user .ecom-chatbot__bubble {
  background: #005bd6;
  color: #ffffff;
  border-top-right-radius: 6px;
}

.ecom-chatbot__bubble a {
  color: #005bd6;
  font-weight: 800;
  text-decoration: underline;
}

.ecom-chatbot__message--user .ecom-chatbot__bubble a {
  color: #ffffff;
}

.ecom-chatbot__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 14px;
  background: #f7fbff;
}

.ecom-chatbot__quick button {
  border: 1px solid rgba(0, 91, 214, 0.20);
  background: #ffffff;
  color: #184f96;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ecom-chatbot__quick button:hover {
  background: #eef6ff;
}

.ecom-chatbot__form {
  padding: 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(20, 72, 130, 0.08);
  background: #ffffff;
}

.ecom-chatbot__input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(20, 72, 130, 0.16);
  border-radius: 999px;
  padding: 11px 13px;
  font-size: 0.92rem;
  outline: none;
}

.ecom-chatbot__input:focus {
  border-color: #005bd6;
  box-shadow: 0 0 0 3px rgba(0, 91, 214, 0.10);
}

.ecom-chatbot__send {
  border: 0;
  border-radius: 999px;
  background: #005bd6;
  color: #ffffff;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

.ecom-chatbot__send:disabled,
.ecom-chatbot__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ecom-chatbot__typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ecom-chatbot__typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #8da2bd;
  animation: ecom-chatbot-dot 1s infinite ease-in-out;
}

.ecom-chatbot__typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ecom-chatbot__typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ecom-chatbot-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 767px) {
  .ecom-chatbot {
    right: 12px;
    left: 12px;
    bottom: 90px;
    width: auto;
    height: min(620px, calc(100vh - 118px));
    border-radius: 20px;
  }

  .chatbot-fab-wrap {
    right: 16px;
    bottom: 18px;
  }
}
