/* Dead Brands lead-chatbot widget — v1 (2026-09-24).
 * Bright pop theme: cream (#fff8ef), red (#e63946 / #c1121f), ink (#221610).
 * Mobile-friendly. Sits bottom-right; JS raises it above the cookie banner
 * via --db-chat-bottom-offset when the banner is visible.
 */

:root {
  --db-chat-bottom-offset: 0px;
}

.db-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--db-chat-bottom-offset));
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: #e63946;
  color: #fff8ef;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.45), 0 2px 6px rgba(34, 22, 16, 0.25);
  z-index: 10000;
  transition: transform 0.15s ease, background 0.15s ease;
}
.db-chat-launcher:hover {
  transform: scale(1.07);
  background: #c1121f;
}
.db-chat-launcher.db-chat-hidden {
  display: none;
}

.db-chat-panel {
  position: fixed;
  right: 20px;
  bottom: calc(96px + var(--db-chat-bottom-offset));
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 140px));
  min-height: 380px;
  background: #fff8ef;
  border: 2px solid #ecdcc4;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(34, 22, 16, 0.28);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  color: #221610;
}
.db-chat-panel.db-chat-open {
  display: flex;
}

.db-chat-header {
  background: #c1121f;
  color: #fff8ef;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.db-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff8ef;
  color: #c1121f;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.db-chat-who {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.db-chat-name {
  font-size: 16px;
}
.db-chat-sub {
  font-size: 12px;
  opacity: 0.85;
}
.db-chat-close {
  background: transparent;
  border: 0;
  color: #fff8ef;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.db-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff8ef;
}
.db-chat-msg {
  display: flex;
}
.db-chat-bot {
  justify-content: flex-start;
}
.db-chat-user {
  justify-content: flex-end;
}
.db-chat-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: break-word;
}
.db-chat-bot .db-chat-bubble {
  background: #ffffff;
  border: 1px solid #ecdcc4;
  border-bottom-left-radius: 4px;
  color: #221610;
}
.db-chat-user .db-chat-bubble {
  background: #e63946;
  color: #fff8ef;
  border-bottom-right-radius: 4px;
}
.db-chat-bubble a {
  color: #c1121f;
  font-weight: 600;
  text-decoration: underline;
}
.db-chat-user .db-chat-bubble a {
  color: #fff8ef;
}

.db-chat-typing {
  padding: 0 18px 8px;
  display: flex;
  gap: 4px;
}
.db-chat-typing[hidden] {
  display: none;
}
.db-chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e63946;
  opacity: 0.5;
  animation: db-chat-blink 1s infinite;
}
.db-chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.db-chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes db-chat-blink {
  50% {
    opacity: 1;
  }
}

.db-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #ecdcc4;
  background: #ffffff;
}
.db-chat-input {
  flex: 1;
  border: 1px solid #ecdcc4;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  background: #fff8ef;
  color: #221610;
}
.db-chat-input:focus {
  outline: 2px solid #e63946;
  outline-offset: -1px;
}
.db-chat-send {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #e63946;
  color: #fff8ef;
  font-size: 18px;
  cursor: pointer;
  flex: 0 0 auto;
}
.db-chat-send:hover {
  background: #c1121f;
}

@media (max-width: 480px) {
  .db-chat-launcher {
    right: 14px;
  }
  .db-chat-panel {
    right: 14px;
    width: calc(100vw - 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .db-chat-typing span {
    animation: none;
  }
  .db-chat-launcher {
    transition: none;
  }
}
