/* === CHAT WIDGET === */
.chat-widget-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #1a1a2e;
  border: none;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 16px rgba(26, 26, 46, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-widget-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 24px rgba(26, 26, 46, 0.45);
}

.chat-widget-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

.chat-widget-panel {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  max-height: 520px;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 12px 48px rgba(26, 26, 46, 0.2);
  display: none;
  flex-direction: column;
  z-index: 901;
  overflow: hidden;
}

.chat-widget-panel.open {
  display: flex;
  animation: chatSlideUp 0.3s ease forwards;
}

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

/* Header */
.chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: #1a1a2e;
  color: #fff;
}

.chat-widget-header-info {
  display: flex;
  flex-direction: column;
}

.chat-widget-header-name {
  font-family: var(--ff-display, Georgia, serif);
  font-size: 1rem;
  font-weight: 600;
}

.chat-widget-header-status {
  font-size: 0.7rem;
  opacity: 0.7;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.chat-close:hover { opacity: 1; }

/* Messages */
.chat-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  background: #f7f7fa;
}

.bubble {
  max-width: 82%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.45;
  word-wrap: break-word;
}

.bubble-bot {
  align-self: flex-start;
  background: #1a1a2e;
  color: #fff;
  border-radius: 1rem 1rem 1rem 0;
}

.bubble-user {
  align-self: flex-end;
  background: #ede3d3;
  color: #1c1410;
  border-radius: 1rem 1rem 0 1rem;
}

.bubble-bot .service-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bubble-bot .service-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8125rem;
}

.bubble-bot .service-list li:last-child { border-bottom: none; }

.bubble-bot .service-list .svc-price {
  font-weight: 600;
  white-space: nowrap;
}

/* Quick-reply buttons */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.quick-reply-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.quick-reply-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* Footer / input */
.chat-widget-footer {
  display: flex;
  padding: 0.625rem;
  border-top: 1px solid #eee;
  background: #fff;
}

.chat-widget-footer input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.chat-widget-footer input:focus {
  border-color: #1a1a2e;
}

.chat-widget-footer button {
  margin-left: 0.375rem;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s;
}

.chat-widget-footer button:hover {
  background: #2d2d4e;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.625rem 0.875rem;
  align-self: flex-start;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #1a1a2e;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Responsive */
@media (max-width: 480px) {
  .chat-widget-panel {
    right: 5vw;
    bottom: 5rem;
    width: 90vw;
    max-height: 70vh;
  }

  .chat-widget-btn {
    bottom: 1rem;
    right: 1rem;
    width: 52px;
    height: 52px;
  }

  .chat-widget-btn svg {
    width: 24px;
    height: 24px;
  }
}
