/* 기존 스타일 유지 및 로딩 스타일 추가 */
.namu-chatbot {
  position: fixed;
  right: 20px;
  bottom: 85px;
  width: 100%;
  max-width: 350px;
  height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-family: 'Noto Sans KR', sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  transition: all 0.3s ease;
}

.namu-chatbot.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(20px);
}

.namu-chatbot .chat-header {
  background: #2f9e44;
  color: #fff;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.namu-chatbot .chat-header h3 { margin: 0; font-size: 16px; font-weight: 500; }
.namu-chatbot .chat-header .close-btn { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; }

.namu-chatbot .chat-log { flex: 1; padding: 16px; overflow-y: auto; background: #fafafa; display: flex; flex-direction: column; }
.namu-chatbot .chat-log > div { margin-bottom: 12px; max-width: 85%; line-height: 1.5; font-size: 14px; padding: 10px 12px; border-radius: 8px; word-break: break-word; }

.namu-chatbot .chat-log .user { margin-left: auto; background: #2f9e44; color: #fff; border-bottom-right-radius: 2px; }
.namu-chatbot .chat-log .bot { margin-right: auto; background: #e9ecef; color: #222; border-bottom-left-radius: 2px; }

/* [추가] 로딩 메시지 스타일 */
.namu-chatbot .chat-log .bot.loading {
  background: #eee;
  color: #777;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* [추가] 점 애니메이션 */
.dot-ani::after {
  content: '.';
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60% { content: '...'; }
  80%, 100% { content: ''; }
}

/* 입력창 및 버튼 비활성화 시 스타일 */
.namu-chatbot input:disabled { background: #f5f5f5; cursor: not-allowed; }
.namu-chatbot button:disabled { opacity: 0.6; cursor: not-allowed; }

.namu-chatbot .chat-input-wrap { display: flex; padding: 12px; gap: 8px; background: #fff; border-top: 1px solid #eee; }
.namu-chatbot input[type="text"] { flex: 1; height: 40px; padding: 0 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.namu-chatbot input[type="text"]:focus { outline: none; border-color: #2f9e44; }
.namu-chatbot button.send-btn { width: 60px; background: #2f9e44; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }

.chatbot-toggle-btn {
  position: fixed; right: 20px; bottom: 20px; width: 50px; height: 50px; border-radius: 50%;
  background: #2f9e44; color: #fff; border: none; font-size: 24px; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2); z-index: 9999; display: flex; align-items: center; justify-content: center;
}

/* 제품 상세보기 링크 버튼 스타일 */
.namu-chatbot .chat-link {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fff;
    color: #2f9e44 !important;
    border: 1px solid #2f9e44;
    border-radius: 6px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.namu-chatbot .chat-link:hover {
    background-color: #2f9e44;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 챗봇 내 이미지 스타일 보완 */
.namu-chatbot .bot img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
    display: block;
    border: 1px solid #eee;
}

/* 에러 메시지 내 로그인 링크 등 일반 링크 스타일 */
.namu-chatbot .bot a:not(.chat-link) {
    color: #2f9e44;
    text-decoration: underline;
    font-weight: bold;
}

/* 주의 문구 스타일 */
.namu-chatbot .chat-notice {
    padding: 6px 12px;
    background: #fffbe6; /* 연한 노란색 배경 (경고/알림용) */
    color: #856404;      /* 짙은 갈색 텍스트 */
    font-size: 11px;
    text-align: center;
    border-top: 1px solid #ffe58f;
    border-bottom: 1px solid #ffe58f;
    line-height: 1.4;
}

/* 대화창 영역이 공지사항 때문에 가려지지 않도록 높이 조절 */
.namu-chatbot .chat-log {
    flex: 1;
    /* 스크롤바와 공지 사이의 여백 유지 */
}