#juns-ai-chatbox .chat-input { align-items: center; display: flex; }
#juns-ai-chatbox .chat-input button#juns-send { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
#juns-ai-chatbox .chat-input textarea { width: 100%; min-height: 40px; max-height: 120px; resize: none; border: 2px solid #e0e0e0; border-radius: 24px; padding: 10px 14px; }
/* JUN'S AI Chatbot Styles */
#juns-ai-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 2147483647;
}

#chat-circle {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #000000, #333333);
  color: white;
  border-radius: 50%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  animation: pulse 2s infinite;
}

#chat-circle .bubble-title { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; transform: none; }
#chat-circle .bubble-title .brand { font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; font-size: 11px; font-weight: 800; letter-spacing: 0.4px; }
#chat-circle .bubble-title .sub { font-size: 9px; opacity: 0.95; font-weight: 700; }

#chat-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
}

@keyframes pulse {
  0% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5); }
  100% { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3); }
}

#juns-ai-chatbox {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  right: 16px;
  width: min(420px, 92vw);
  max-height: 70vh;
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483647;
  border: 1px solid #e0e0e0;
  font-family: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

#juns-ai-chatbox * { box-sizing: border-box; }

.chat-header {
  background: linear-gradient(135deg, #000000, #333333);
  color: white;
  text-align: center;
  padding: 16px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#juns-close {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.chat-title-line { font-size: 18px; font-weight: 800; letter-spacing: 0.5px; font-family: 'Playfair Display', Georgia, 'Times New Roman', serif; }

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
  line-height: 1.6;
}

.chat-input-container {
  display: flex;
  padding: 16px;
  border-top: 1px solid #e0e0e0;
  background: white;
  gap: 10px;
}

.chat-input-container input, .chat-input input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid #e0e0e0;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input-container input:focus {
  border-color: #000000;
}

.chat-input-container button, .chat-input button#juns-send {
  background: linear-gradient(135deg, #000000, #333333);
  color: white;
  border: none;
  padding: 0 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.chat-input-container button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#juns-ai-chatbox.kbd-open { border-radius: 16px 16px 0 0; }

#juns-ai-chatbox .bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 20px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.6;
  font-size: 14px;
  animation: fadeIn 0.3s ease;
  margin: 4px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#juns-ai-chatbox .bubble.user {
  background: linear-gradient(135deg, #000000, #333333);
  color: white;
  align-self: flex-end;
  border-top-right-radius: 8px;
}

#juns-ai-chatbox .bubble.ai {
  background: white;
  color: #333;
  align-self: flex-start;
  border-top-left-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#juns-ai-chatbox .bubble.ai a { color: #5b3df5; text-decoration: underline; }
#juns-ai-chatbox .bubble.ai br { line-height: 10px; }

#juns-ai-chatbox .bubble.system {
  background: #f0f0f0;
  color: #666;
  align-self: center;
  border-radius: 15px;
  font-style: italic;
  font-size: 13px;
}

/* Product recommendation cards inside chat (scoped to chat only) */
#juns-ai-chatbox .product-grid { 
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 10px; 
  margin-top: 8px; 
}
#juns-ai-chatbox .product-card { 
  background: #fff; 
  border: 1px solid #eee; 
  border-radius: 10px; 
  overflow: hidden; 
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
#juns-ai-chatbox .product-card a { color: inherit; text-decoration: none; display: block; }
#juns-ai-chatbox .product-card img { width: 100%; height: 140px; object-fit: cover; display: block; }
#juns-ai-chatbox .product-card .pc-title { font-size: 12px; font-weight: 600; padding: 8px 10px 2px; }
#juns-ai-chatbox .product-card .pc-price { font-size: 12px; color: #444; padding: 0 10px 10px; }

.bubble.loading {
  font-style: italic;
  opacity: 0.6;
  align-self: center;
}

/* Language Selector Styles */
.language-selector {
  background: white;
  border-radius: 15px;
  padding: 16px;
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-title {
  text-align: center;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  font-size: 14px;
}

.language-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.lang-btn {
  padding: 8px 16px;
  border: 2px solid #e0e0e0;
  background: white;
  color: #666;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
  font-weight: 500;
}

.lang-btn:hover {
  border-color: #000000;
  color: #000000;
}

.lang-btn.active {
  background: #000000;
  color: white;
  border-color: #000000;
}

/* Responsive Design */
@media screen and (max-width: 500px) {
  #juns-ai-chatbox { width: auto; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px); max-height: clamp(420px, 80dvh, calc(100dvh - 24px)); }

  #chat-circle {
    width: 56px;
    height: 56px;
    font-size: 11px;
    line-height: 56px;
  }

  .chat-messages { max-height: 56dvh; }

  .language-buttons {
    flex-direction: column;
    gap: 8px;
  }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
