/* Buckley product chat agent — compact storefront bubble */
.bls-chat {
  --bls-chat-bg: #0f3d1f;
  --bls-chat-accent: #c8a84b;
  --bls-chat-panel: #ffffff;
  --bls-chat-text: #1a1a1a;
  --bls-chat-muted: #5c5c5c;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99980;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.4;
}

.bls-chat__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  background: var(--bls-chat-bg);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.bls-chat__toggle:hover,
.bls-chat__toggle:focus-visible {
  background: #14522a;
  outline: 2px solid var(--bls-chat-accent);
  outline-offset: 2px;
}

.bls-chat__toggle-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.bls-chat__panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 28px));
  height: min(520px, calc(100vh - 100px));
  margin-bottom: 0.75rem;
  background: var(--bls-chat-panel);
  color: var(--bls-chat-text);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(15, 61, 31, 0.12);
}

.bls-chat--open .bls-chat__panel {
  display: flex;
}

.bls-chat--open .bls-chat__toggle-label-closed {
  display: none;
}

.bls-chat:not(.bls-chat--open) .bls-chat__toggle-label-open {
  display: none;
}

.bls-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bls-chat-bg);
  color: #fff;
  flex: 0 0 auto;
}

.bls-chat__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bls-chat__sub {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
  font-family: system-ui, sans-serif;
}

.bls-chat__close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.bls-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  background: #f6f4ef;
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 0.92rem;
}

.bls-chat__msg {
  max-width: 92%;
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bls-chat__msg--bot {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--bls-chat-text);
}

.bls-chat__msg--typing::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 0.12em;
  vertical-align: -0.12em;
  background: var(--bls-chat-accent, #c8a84b);
  animation: bls-chat-caret 0.65s steps(1, end) infinite;
}

@keyframes bls-chat-caret {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.bls-chat__msg--user {
  margin-left: auto;
  background: var(--bls-chat-bg);
  color: #fff;
}

.bls-chat__msg a {
  color: #0f3d1f;
  font-weight: 600;
}

.bls-chat__msg--user a {
  color: #ffe9a8;
}

.bls-chat__msg--error {
  background: #fde8e8;
  border-color: #f0b4b4;
  color: #7a1f1f;
}

.bls-chat__products {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.bls-chat__product-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.bls-chat__product {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #f0f5f1;
  color: #0f3d1f;
  text-decoration: none;
  font-size: 0.85rem;
}

.bls-chat__product:hover {
  background: #e2ecE5;
}

.bls-chat__product--active {
  background: #d4e8da;
  box-shadow: inset 0 0 0 2px #0f3d1f;
  font-weight: 600;
}

.bls-chat__product-price {
  display: block;
  color: var(--bls-chat-muted);
  font-size: 0.8rem;
}

.bls-chat__product-status {
  margin: 0 0.15rem 0.1rem;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #2f6b3c;
  font-family: system-ui, sans-serif;
  font-weight: 600;
}

.bls-chat__msg-footer {
  margin-top: 0.65rem;
  font-size: 0.9em;
  line-height: 1.45;
}

.bls-chat__msg-depot {
  margin-top: 0.65rem;
  font-size: 0.9em;
  line-height: 1.45;
}

.bls-chat__order-lines {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.bls-chat__order-line {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bls-chat__order-line-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.bls-chat__tracking--disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
  background: #eef1ef;
  color: #5a6a5e;
}

.bls-chat__quotes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.65rem;
}

.bls-chat__quote {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: #eef5f0;
  font-size: 0.86rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bls-chat__quote:hover,
.bls-chat__quote:focus-visible {
  background: #e0ece4;
  border-color: rgba(15, 61, 31, 0.25);
  outline: none;
}

.bls-chat__quote--active {
  background: #d4e8da;
  border-color: #0f3d1f;
  box-shadow: inset 0 0 0 1px #0f3d1f;
}

.bls-chat__quote-date {
  font-weight: 600;
  color: #0f3d1f;
}

.bls-chat__quote-total {
  font-weight: 700;
  color: #0f3d1f;
  justify-self: end;
}

.bls-chat__quote-status {
  grid-column: 1 / -1;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.3;
  color: #2f6b3c;
  font-family: system-ui, sans-serif;
  font-weight: 600;
}

.bls-chat__quote-delivery {
  grid-column: 1 / -1;
  color: var(--bls-chat-muted);
  font-size: 0.78rem;
}

.bls-chat__form {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  flex: 0 0 auto;
}

.bls-chat__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  font-family: system-ui, sans-serif;
}

.bls-chat__send {
  flex: 0 0 auto;
  align-self: stretch;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: var(--bls-chat-accent);
  color: #1a1a1a;
  font-weight: 700;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  white-space: nowrap;
}

.bls-chat__send:disabled {
  opacity: 0.55;
  cursor: wait;
}

.bls-chat__hint {
  margin: 0;
  padding: 0 0.75rem 0.55rem;
  font-size: 0.72rem;
  color: var(--bls-chat-muted);
  font-family: system-ui, sans-serif;
  background: #fff;
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .bls-chat {
    right: 12px;
    bottom: 12px;
  }
  .bls-chat__panel {
    width: calc(100vw - 24px);
    height: min(70vh, 560px);
  }
}
