/* Perbaccowein KI-Einkaufsberater — Overlay (unten rechts) */

.pb-berater,
.pb-berater * { box-sizing: border-box; }

.pb-berater {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  position: fixed;
  z-index: 2147483000;
}

/* Launcher-Blase */
.pb-bubble {
  position: fixed;
  right: 20px;
  bottom: 20px;
  height: 62px;
  min-width: 62px;
  border-radius: 31px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, padding .3s ease;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
}
.pb-bubble:hover { transform: scale(1.06); }
.pb-bubble.pb-hidden { display: none; }

.pb-bubble-icon { flex: 0 0 auto; line-height: 1; }
.pb-bubble-label {
  flex: 0 0 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  margin-left: 0;
  transition: max-width .35s ease, opacity .35s ease, margin-left .35s ease;
}
/* Ausgeklappter Zustand (Intro) */
.pb-bubble.pb-expanded { padding: 0 22px 0 18px; }
.pb-bubble.pb-expanded .pb-bubble-label {
  max-width: 150px;
  opacity: 1;
  margin-left: 10px;
}

.pb-bubble-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2ecc71;
  border: 2px solid #fff;
}

/* Modus-Auswahl (Chat vs. Weinberater) */
.pb-mode-menu {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: 260px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 2147483001;
}
.pb-mode-menu.pb-open { display: flex; }
.pb-mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.pb-mode-btn:hover { background: #f7f2fa; }
.pb-mode-icon { font-size: 20px; flex: 0 0 auto; }
.pb-mode-title { font-weight: 700; font-size: 14px; color: #2a2a2a; }
.pb-mode-desc { font-size: 12px; color: #777; }

/* Panel */
.pb-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.pb-panel.pb-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Header */
.pb-header {
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.pb-title { font-size: 16px; font-weight: 700; }
.pb-subtitle { font-size: 12px; opacity: .85; margin-top: 2px; }
.pb-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.pb-close:hover { background: rgba(255,255,255,.32); }

.pb-head-actions { display: flex; align-items: center; gap: 8px; }
.pb-reset {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.pb-reset:hover { background: rgba(255,255,255,.32); }

/* Body */
.pb-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  background: #f7f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pb-msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.pb-msg-user {
  align-self: flex-end;
  background: #e6d6ef;
  color: #1f1f1f;
  border-bottom-right-radius: 4px;
}
.pb-msg-assistant {
  align-self: flex-start;
  background: #fff;
  color: #2a2a2a;
  border: 1px solid #eee;
  border-bottom-left-radius: 4px;
}
.pb-spacer { height: 6px; }

/* Tipp-Indikator */
.pb-typing { display: flex; gap: 4px; align-items: center; padding: 13px; }
.pb-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #b9a7c9; animation: pb-blink 1.2s infinite;
}
.pb-dot:nth-child(2) { animation-delay: .2s; }
.pb-dot:nth-child(3) { animation-delay: .4s; }
@keyframes pb-blink { 0%,60%,100% { opacity:.25; } 30% { opacity:1; } }

/* Produktkarten */
.pb-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
}
.pb-card {
  display: flex;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .12s ease;
}
.pb-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.12); }
.pb-card-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 6px;
  background: #faf7fc;
  flex: 0 0 auto;
}
.pb-card-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}
.pb-card-info { flex: 1 1 auto; min-width: 0; }
.pb-card-name { font-weight: 700; font-size: 13px; line-height: 1.3; }
.pb-card-sub { font-size: 12px; color: #777; margin-top: 2px; }
.pb-card-teaser { font-size: 12px; color: #666; line-height: 1.35; margin-top: 4px; }
.pb-card-price { font-size: 14px; font-weight: 700; color: #1f1f1f; margin-top: 4px; }
.pb-old-price { color: #999; font-weight: 400; text-decoration: line-through; margin-right: 5px; }
.pb-new-price { color: #b0253a; }

/* Fußzeile */
.pb-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}
.pb-input {
  flex: 1 1 auto;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  resize: none;
  height: 60px;
  outline: none;
}
.pb-input:focus { border-color: #c9a6e0; }
.pb-send {
  flex: 0 0 auto;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  cursor: pointer;
}
.pb-send:disabled { opacity: .55; cursor: default; }

/* Datenschutz-Hinweis (Footer, ganz unten) */
.pb-privacy {
  flex: 0 0 auto;
  padding: 5px 14px 8px;
  text-align: center;
  font-size: 11px;
  color: #9a9a9a;
  background: #fff;
}
.pb-privacy-link {
  color: #7a7a7a;
  text-decoration: underline;
  cursor: pointer;
}
.pb-privacy-link:hover { color: #444; }

@media (max-width: 480px) {
  .pb-panel { right: 8px; bottom: 8px; width: auto; left: 8px; }
  .pb-bubble { right: 12px; bottom: 12px; }
}
