/* Store AI Assistant & Mascot Styles */

.store-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* Floating Launch Button with Mascot sitting/peeking above */
.chat-launch {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.18));
}

.chat-launch:hover {
  transform: translateY(-4px) scale(1.02);
}

.mascot-peeking {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid #10b981;
  box-shadow: 0 4px 16px rgba(6, 95, 70, 0.35), 0 0 0 3px rgba(16, 185, 129, 0.2);
  overflow: hidden;
  background: #044e39;
  margin-bottom: -12px;
  z-index: 2;
  transition: transform 0.3s ease;
  animation: floatMascot 3.2s ease-in-out infinite;
}

.chat-launch:hover .mascot-peeking {
  transform: scale(1.08) rotate(-3deg);
}

@keyframes floatMascot {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.mascot-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-launch-label {
  background: linear-gradient(135deg, #065f46 0%, #044e39 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px 9px;
  border-radius: 9999px;
  border: 1.5px solid #10b981;
  box-shadow: 0 4px 14px rgba(6, 95, 70, 0.3);
  z-index: 1;
  white-space: nowrap;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Chat Box / Dialog */
.chat-box {
  width: min(390px, calc(100vw - 28px));
  height: min(600px, 84vh);
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 24px;
  box-shadow: 0 20px 45px -5px rgba(15, 23, 42, 0.25), 0 10px 18px -6px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpChat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpChat {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-box[hidden], .chat-launch[hidden] {
  display: none !important;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #10b981;
  overflow: hidden;
  background: #044e39;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-header strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.chat-header span {
  display: block;
  font-size: 11px;
  color: #a7f3d0;
  margin-top: 2px;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  background: #f8fafc;
}

.chat-message-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 90%;
}

.chat-message-row.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.chat-message-row.assistant {
  align-self: flex-start;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  object-fit: cover;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.chat-message {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.chat-message.assistant {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-message.user {
  background: #065f46;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.25);
}

.chat-status {
  font-size: 11px;
  font-weight: 600;
  color: #059669;
  padding: 0 16px;
  margin: 0 0 6px;
  min-height: 16px;
}

.chat-disclaimer {
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
  margin: 0 16px 8px;
}

.chat-sellers {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
}

.chat-sellers a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11px;
  font-weight: 700;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
}

.chat-sellers a:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

/* Chat Input Form */
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  padding: 10px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.chat-form input:focus {
  border-color: #065f46;
  background: #ffffff;
}

.chat-form button {
  background: #065f46;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 6px rgba(6, 95, 70, 0.25);
}

.chat-form button:hover {
  background: #047857;
}

.chat-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 560px) {
  .store-chat {
    right: 16px;
    bottom: 16px;
  }
  .mascot-peeking {
    width: 58px;
    height: 58px;
    margin-bottom: -10px;
  }
  .chat-launch-label {
    font-size: 12px;
    padding: 8px 14px 7px;
  }
  .chat-box {
    width: calc(100vw - 24px);
    height: min(580px, 85vh);
    border-radius: 20px;
  }
}
