/* Pawlie's On-Site-Chat-Widget, aeussere Huelle (deep-chat-Innenleben via JS-Props). */

.pw-chat-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  /* verhindert, dass mobile Browser Text in den Bloecken automatisch vergroessern */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Bubble */
.pw-chat-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: #354c84;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(53, 76, 132, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.pw-chat-bubble:hover {
  background: #e6425b;
  transform: translateY(-2px) scale(1.04);
}
.pw-chat-root.pw-open .pw-chat-bubble {
  background: #e6425b;
}

/* Panel */
.pw-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #fbf3eb;
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(46, 46, 46, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pw-chat-in 0.18s ease;
}
@keyframes pw-chat-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.pw-chat-header {
  background: #354c84;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.pw-chat-title {
  font-family: "Lora", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-chat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7a9e7e; /* brand-sage = "online" */
  box-shadow: 0 0 0 3px rgba(122, 158, 126, 0.25);
}
.pw-chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
  padding: 0 4px;
}
.pw-chat-close:hover { opacity: 1; }

/* Body (deep-chat fuellt den Rest) */
.pw-chat-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.pw-chat-body deep-chat {
  flex: 1 1 auto;
}

/* Consent-Hinweis (Cloud-Aufzeichnung) */
.pw-chat-consent {
  flex: 0 0 auto;
  background: #fbf3eb;
  color: #888888;
  font-family: "Nunito", sans-serif;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  padding: 7px 14px 9px;
  border-top: 1px solid #ecddcb;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.pw-chat-consent a { color: #354c84; text-decoration: underline; }

/* Ladezustand */
.pw-chat-loading {
  margin: auto;
  padding: 24px;
  color: #888888;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  text-align: center;
}

/* Mobile: echtes Vollbild-Panel (dvh statt vh wegen Browser-Toolbar/Tastatur) */
@media (max-width: 640px) {
  .pw-chat-panel {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    max-width: none;
    height: 100vh;        /* Fallback */
    height: 100dvh;       /* schrumpft bei eingeblendeter Tastatur/Toolbar */
    max-height: none;
    border-radius: 0;
  }
  /* Bubble ausblenden, solange der Chat offen ist (sonst ueberlappt sie den Seiteninhalt) */
  .pw-chat-root.pw-open .pw-chat-bubble { display: none; }
  .pw-chat-root { right: 16px; bottom: 16px; }
}
