:root {
  --bk-accent: #10a37f;
  --bk-accent-dark: #0d8a6c;
  --bk-bg: #ffffff;
  --bk-bg-subtle: #f7f7f8;
  --bk-border: #e5e5e8;
  --bk-text: #1a1a1a;
  --bk-text-muted: #6e6e80;
  --bk-radius: 16px;
  --bk-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
}

#bk-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bk-accent), var(--bk-accent-dark));
  box-shadow: 0 6px 20px rgba(16, 163, 127, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999998;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
}

#bk-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(16, 163, 127, 0.5);
}

#bk-chat-bubble .bk-bubble-icon {
  width: 30px;
  height: 30px;
  overflow: visible;
}

#bk-chat-bubble .bk-sparkle {
  transform-origin: center;
  animation: bk-sparkle-spin 4s linear infinite, bk-sparkle-pulse 2s ease-in-out infinite;
}

@keyframes bk-sparkle-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bk-sparkle-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

#bk-chat-bubble .bk-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 4px;
  background: #fff;
  color: var(--bk-accent-dark);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

#bk-chat-bubble .bk-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 22px;
  border: 6px solid transparent;
  border-top-color: #fff;
}

#bk-chat-bubble:hover .bk-tooltip {
  opacity: 1;
}

#bk-chat-overlay {
  position: fixed;
  inset: 16px;
  background: var(--bk-bg);
  border-radius: var(--bk-radius);
  box-shadow: var(--bk-shadow);
  z-index: 999999;
  display: none;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--bk-text);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

#bk-chat-overlay.bk-open {
  display: flex;
}

#bk-chat-overlay.bk-visible {
  opacity: 1;
  transform: translateY(0);
}

#bk-chat-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--bk-text-muted);
  cursor: pointer;
  z-index: 10;
  font-weight: 300;
  padding: 4px;
}

#bk-chat-close:hover {
  color: var(--bk-text);
}

.bk-chat-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px 14px;
  border-bottom: 1px solid var(--bk-border);
  flex-shrink: 0;
}

.bk-chat-logo {
  height: 32px;
  width: auto;
}

.bk-chat-trustpilot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--bk-text-muted);
  text-decoration: none;
}

.bk-chat-trustpilot:hover {
  text-decoration: underline;
}

.bk-chat-trustpilot .bk-stars {
  color: #00b67a;
  letter-spacing: 1px;
  font-size: 14px;
}

.bk-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.bk-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: bk-fade-in 0.2s ease;
}

@keyframes bk-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.bk-msg.bk-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bk-msg-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.bk-msg.bk-user .bk-msg-bubble {
  background: var(--bk-accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bk-msg.bk-assistant .bk-msg-bubble {
  background: var(--bk-bg-subtle);
  color: var(--bk-text);
  border-bottom-left-radius: 6px;
}

.bk-typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bk-text-muted);
  margin-right: 3px;
  animation: bk-blink 1.2s infinite ease-in-out;
}
.bk-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.bk-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bk-blink {
  0%, 80%, 100% { opacity: 0.25; }
  40% { opacity: 1; }
}

.bk-product-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  max-width: 720px;
  width: 100%;
  margin: -6px auto 0;
  scrollbar-width: thin;
}

.bk-product-card {
  flex: 0 0 auto;
  width: 178px;
  border: 1px solid var(--bk-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--bk-text);
  background: var(--bk-bg);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.bk-product-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.bk-product-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: var(--bk-bg-subtle);
  display: block;
}

.bk-product-card-body {
  padding: 8px 10px 10px;
}

.bk-product-card-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.bk-product-card-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--bk-accent-dark);
}

.bk-product-card-price .bk-was {
  font-weight: 400;
  color: var(--bk-text-muted);
  text-decoration: line-through;
  margin-left: 5px;
  font-size: 11.5px;
}

.bk-product-card-delivery {
  font-size: 11px;
  color: var(--bk-text-muted);
  margin-top: 5px;
}

.bk-suggestions-wrap {
  padding: 0 16px 10px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}

.bk-suggestions-label {
  font-size: 12.5px;
  color: var(--bk-text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.bk-suggestions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bk-chip {
  border: 1px solid var(--bk-border);
  background: var(--bk-bg);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--bk-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bk-chip:hover {
  background: var(--bk-bg-subtle);
  border-color: #c9c9cf;
}

.bk-chat-inputbar-wrap {
  flex-shrink: 0;
  padding: 10px 16px 6px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}

.bk-chat-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--bk-border);
  border-radius: 24px;
  padding: 8px 8px 8px 18px;
  background: var(--bk-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bk-chat-inputbar textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  font-family: inherit;
  max-height: 120px;
  line-height: 1.4;
  padding: 6px 0;
  color: var(--bk-text);
  background: transparent;
}

.bk-chat-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--bk-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.bk-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.bk-chat-send svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.bk-chat-poweredby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--bk-text-muted);
  padding: 4px 0 14px;
  flex-shrink: 0;
}

.bk-chatgpt-logo {
  width: 12px;
  height: 12px;
  fill: var(--bk-text-muted);
}

@media (max-width: 640px) {
  #bk-chat-overlay {
    inset: 0;
    border-radius: 0;
  }
  #bk-chat-bubble {
    bottom: 16px;
    right: 16px;
  }
  .bk-msg {
    max-width: 96%;
  }
}

@media (prefers-color-scheme: dark) {
  #bk-chat-overlay {
    --bk-bg: #212121;
    --bk-bg-subtle: #2f2f2f;
    --bk-border: #3d3d3f;
    --bk-text: #ececec;
    --bk-text-muted: #a0a0ab;
    --bk-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}
