:root {
  --cb-primary: #e54d26;
  --cb-primary-dark: #c03b1b;
  --cb-panel-width: 360px;
  --cb-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  --cb-border: #e5e7eb;
  --cb-muted: #6b7280;
  --cb-body: #f7f8fb;
}

body.cb-no-scroll,
html.cb-no-scroll {
  overflow: hidden;
}

.cb-widget {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1000001;
}

.cb-bubble {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dark));
  color: #fff;
  box-shadow: var(--cb-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  margin-left: auto;
}

.cb-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  filter: brightness(1.05);
}

.cb-bubble img {
  width: 34px;
  height: 34px;
  filter: brightness(100);
}

.cb-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: var(--cb-panel-width);
  max-width: calc(100vw - 32px);
  height: 530px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--cb-shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cb-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cb-panel-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--cb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--cb-primary);
  color: #fff;
}

.cb-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  color: inherit;
}

.cb-panel-header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.cb-header-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cb-header-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.cb-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cb-header-text h3,
.cb-header-text p {
  margin: 0;
}

.cb-header-text p {
  margin-top: 4px;
}

.cb-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: #fff;
  transition: background 0.2s ease;
}

.cb-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.cb-panel-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  background: var(--cb-body);
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
}

.cb-scroll {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100% - 10px);
  padding-right: 4px;
  min-height: 0;
}

.cb-scroll::-webkit-scrollbar,
.cb-suboptions::-webkit-scrollbar,
.cb-chat::-webkit-scrollbar {
  width: 6px;
}

.cb-scroll::-webkit-scrollbar-thumb,
.cb-suboptions::-webkit-scrollbar-thumb,
.cb-chat::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.cb-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 85%;
  border-radius: 22px;
  padding: 12px 14px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  background: #fff;
  font-size: 0.92rem;
  line-height: 1.4;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  word-break: break-word;
}

.chat-bubble.bot {
  align-self: flex-start;
  border: 1px solid var(--cb-border);
}

.chat-bubble.user {
  align-self: flex-end;
  background: var(--cb-primary);
  color: #fff;
  flex-direction: row-reverse;
}

.chat-author {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cb-muted);
}

.chat-bubble.user .chat-author {
  color: rgba(255, 255, 255, 0.85);
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--cb-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.chat-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.chat-content {
  flex: 1;
  min-width: 160px;
}

.chat-bubble.user .chat-avatar {
  display: none;
}

.cb-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cb-options button {
  border: 1px solid transparent;
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease, border 0.2s ease;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.cb-options button:hover {
  border-color: var(--cb-primary);
  color: var(--cb-primary);
}

.cb-suboptions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.cb-suboptions button {
  border: 1px solid var(--cb-border);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.cb-suboptions button:hover {
  border-color: var(--cb-primary);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.cb-contact {
  border: 1px solid var(--cb-border);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.cb-contact form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cb-contact-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--cb-muted);
}

.cb-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cb-field-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cb-muted);
}

.cb-field-input {
  border: 1px solid var(--cb-border);
  border-radius: 12px;
  padding: 10px;
  font-size: 0.9rem;
}

.cb-contact button[type="submit"] {
  border: none;
  background: var(--cb-primary);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cb-contact button[type="submit"]:hover:enabled {
  background: var(--cb-primary-dark);
}

.cb-contact button[type="submit"]:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cb-contact-status {
  min-height: 18px;
  margin: 0;
  font-size: 0.82rem;
  color: var(--cb-muted);
}

.cb-contact-status.is-success {
  color: #047857;
}

.cb-contact-status.is-error {
  color: #b91c1c;
}

.cb-input {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.cb-input input {
  flex: 1;
  border: 1px solid var(--cb-border);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.9rem;
}

.cb-input button {
  border: none;
  background: var(--cb-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cb-input button:hover {
  background: var(--cb-primary-dark);
}

@media (max-width: 768px) {
  .cb-widget {
    right: 12px;
    bottom: 96px;
  }

  .cb-panel {
    width: calc(100vw - 24px);
    bottom: 80px;
    right: 0;
  }
}
