/* LONGA Chat-Berater Widget — nutzt bestehende Design-Tokens aus style.css (--color-*, --font-*, --radius-*) */

.chat-launcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full, 9999px);
  padding: 0.85rem 1.3rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(61, 110, 82, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 999;
}
.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(61, 110, 82, 0.42);
}
.chat-launcher svg { flex-shrink: 0; }
.chat-launcher.is-hidden { display: none; }

.chat-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100vh - 3rem);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 1.25rem);
  box-shadow: 0 24px 64px rgba(35, 41, 31, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  animation: chatIn 0.25s ease;
}
.chat-panel.is-open { display: flex; }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
  background: var(--color-primary);
  color: #fff;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.chat-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.chat-header__text { flex: 1; min-width: 0; }
.chat-header__title { font-weight: 600; font-size: 0.95rem; line-height: 1.2; }
.chat-header__subtitle { font-size: 0.78rem; opacity: 0.85; display: flex; align-items: center; gap: 0.35rem; }
.chat-header__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #7ED99A; display: inline-block;
}
.chat-header__close {
  background: none; border: none; color: #fff; opacity: 0.8;
  cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0.3rem;
}
.chat-header__close:hover { opacity: 1; }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  background: var(--color-bg);
}

.chat-body .msg {
  max-width: 85%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md, 0.75rem);
  font-size: 0.88rem;
  line-height: 1.5;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-body .msg--bot {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm, 0.4rem);
}
.chat-body .msg--user {
  background: var(--color-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm, 0.4rem);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-self: flex-start;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 0.75rem);
  padding: 0.7rem 0.9rem;
}
.typing-indicator span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-faint);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.package-card {
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-md, 0.75rem);
  padding: 0.9rem 1rem;
  align-self: flex-start;
  max-width: 90%;
  width: 100%;
}
.package-card__kicker {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}
.package-card__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.package-card__desc {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0.7rem;
}
.package-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.package-card__price {
  font-weight: 700;
  font-size: 1rem;
}
.package-card__cta {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full, 9999px);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.package-card__cta:hover { background: var(--color-primary-hover); }

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
}
.chat-input-row input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full, 9999px);
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: 0.86rem;
  background: var(--color-bg);
  color: var(--color-text);
}
.chat-input-row input:focus { outline: none; border-color: var(--color-primary); }
.chat-input-row input:disabled { opacity: 0.6; }
.chat-input-row button {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full, 9999px);
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-input-row button:hover { background: var(--color-primary-hover); }
.chat-input-row button:disabled { opacity: 0.5; cursor: default; }

.chat-footer {
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: 0.72rem;
  color: var(--color-text-faint);
  text-align: center;
}

.chat-body .msg-error {
  align-self: center;
  font-size: 0.8rem;
  color: var(--color-error, #A13544);
  background: rgba(161, 53, 68, 0.08);
  border: 1px solid rgba(161, 53, 68, 0.25);
  border-radius: var(--radius-md, 0.75rem);
  padding: 0.5rem 0.8rem;
  text-align: center;
}

@media (max-width: 480px) {
  .chat-panel {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    width: auto;
  }
  .chat-launcher {
    right: 1rem;
    bottom: 1rem;
  }
}
