/* ── Glory Bee's Live Chat Widget ── */
:root {
  --gb-color: #b5451b;
  --gb-radius: 16px;
  --gb-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

/* LAUNCHER BUTTON */
#gbchat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gb-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--gb-shadow);
  z-index: 99999;
  transition: transform .2s, box-shadow .2s;
}
#gbchat-launcher:hover { transform: scale(1.08); box-shadow: 0 12px 40px rgba(0,0,0,0.22); }

#gbchat-unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53935;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
}

/* CHAT WINDOW */
#gbchat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 520px;
  max-height: calc(100vh - 120px);
  border-radius: var(--gb-radius);
  background: #fff;
  box-shadow: var(--gb-shadow);
  display: flex;
  flex-direction: column;
  z-index: 99998;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: gbchat-pop .2s ease;
}

@keyframes gbchat-pop {
  from { opacity:0; transform: scale(.92) translateY(16px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}

/* HEADER */
#gbchat-header {
  background: var(--gb-color);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#gbchat-header-info { display: flex; align-items: center; gap: 10px; }
#gbchat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
#gbchat-header-name  { font-weight: 700; font-size: 15px; }
#gbchat-header-status { font-size: 12px; opacity: .85; display:flex; align-items:center; gap:5px; margin-top:2px; }
.gbchat-dot { width:7px; height:7px; border-radius:50%; background:#7fffb2; display:inline-block; }

#gbchat-close {
  background: transparent; border: none; color: #fff;
  font-size: 18px; cursor: pointer; opacity: .8; line-height:1;
  padding: 0;
}
#gbchat-close:hover { opacity: 1; }

/* MESSAGES */
#gbchat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f9f6f3;
}
#gbchat-messages::-webkit-scrollbar { width: 4px; }
#gbchat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.gbchat-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.gbchat-msg.bot {
  background: #fff;
  color: #222;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.gbchat-msg.user {
  background: var(--gb-color);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.gbchat-msg.agent {
  background: #e8f5e9;
  color: #1b5e20;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 3px solid #43a047;
}
.gbchat-msg-label {
  font-size: 10px;
  color: #aaa;
  margin-bottom: 2px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* AGENT BANNER */
#gbchat-agent-banner {
  background: #e8f5e9;
  color: #2e7d32;
  text-align: center;
  font-size: 13px;
  padding: 8px;
  font-weight: 600;
  flex-shrink: 0;
}

/* TYPING */
#gbchat-typing {
  padding: 10px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  background: #f9f6f3;
}
#gbchat-typing span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #bbb;
  animation: gbchat-bounce 1.2s infinite;
}
#gbchat-typing span:nth-child(2) { animation-delay: .2s; }
#gbchat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gbchat-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity:.5; }
  40%           { transform: scale(1);  opacity:1; }
}

/* INPUT AREA */
#gbchat-input-area {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid #eee;
  gap: 8px;
  background: #fff;
  flex-shrink: 0;
}
#gbchat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
#gbchat-input:focus { border-color: var(--gb-color); }

#gbchat-send {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gb-color);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  padding: 0;
  line-height: 1;
}
#gbchat-send svg { display:block; flex-shrink:0; }
#gbchat-send svg path { fill: #ffffff !important; }
#gbchat-send:hover { filter: brightness(1.1); }

/* FOOTER */
#gbchat-footer {
  text-align: center;
  font-size: 11px;
  color: #bbb;
  padding: 6px;
  background: #fff;
  flex-shrink: 0;
}

/* QUICK REPLIES */
.gbchat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
  background: #f9f6f3;
}
.gbchat-qr-btn {
  background: #fff;
  border: 1px solid var(--gb-color);
  color: var(--gb-color);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.gbchat-qr-btn:hover { background: var(--gb-color); color: #fff; }

@media (max-width: 420px) {
  #gbchat-window { right: 0; bottom: 0; width: 100vw; max-width:100vw; height: 100vh; max-height:100vh; border-radius: 0; }
  #gbchat-launcher { bottom: 16px; right: 16px; }
}

/* ── VISITOR INFO FORM ── */
#gbchat-visitor-form {
  background: #fff;
  border: 1px solid var(--gb-color);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gbchat-form-title {
  font-size: 13px;
  font-weight: 600;
  color: #444;
}
#gbchat-visitor-form input {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
#gbchat-visitor-form input:focus { border-color: var(--gb-color); }
#gbchat-form-submit {
  background: var(--gb-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter .2s;
}
#gbchat-form-submit:hover { filter: brightness(1.1); }

/* ── MARKDOWN RENDERING ── */
.gbchat-msg.bot a.gbchat-link,
.gbchat-msg.agent a.gbchat-link {
  color: var(--gb-color);
  text-decoration: underline;
  font-weight: 600;
  word-break: break-all;
}
.gbchat-msg.bot a.gbchat-link:hover,
.gbchat-msg.agent a.gbchat-link:hover { opacity: .8; }
.gbchat-bullet { padding: 2px 0 2px 4px; }
.gbchat-msg.bot strong { font-weight: 700; }

/* ── PRODUCT CARD LIST ── */
.gbchat-product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0;
}

/* ── INDIVIDUAL PRODUCT CARD ── */
a.gbchat-product-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e8e2dc;
  border-radius: 12px;
  padding: 10px;
  text-decoration: none !important;
  color: inherit !important;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}
a.gbchat-product-card:hover {
  border-color: var(--gb-color);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  transform: translateY(-1px);
}
a.gbchat-product-card:focus {
  outline: 2px solid var(--gb-color);
  outline-offset: 2px;
}
/* Children are not clickable — the <a> tag handles all navigation */
a.gbchat-product-card * {
  pointer-events: none;
}

/* Product image */
.gbpc-img-wrap {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f0ec;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* .gbpc-img removed — images now use background-image on .gbpc-img-wrap */
.gbpc-img-placeholder {
  font-size: 26px;
  opacity: .4;
}

/* Product info */
.gbpc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.gbpc-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gbpc-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--gb-color);
}
.gbpc-stock {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.gbpc-stock.in  { color: #2e7d32; }
.gbpc-stock.out { color: #c62828; }
.gbpc-stock span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 9px;
  color: #fff;
  flex-shrink: 0;
}
.gbpc-stock.in  span { background: #2e7d32; }
.gbpc-stock.out span { background: #c62828; }
.gbpc-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--gb-color);
  margin-top: 2px;
  letter-spacing: .2px;
}

/* ── CLASS DATE STYLE ── */
.gbpc-date {
  font-size: 11px;
  color: #5c6bc0;
  font-weight: 600;
  margin-top: 1px;
}

/* ── END CHAT BUTTON ── */
.gbchat-end-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 8px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #888;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  flex-shrink: 0;
}
.gbchat-end-btn:hover {
  background: #fff0ee;
  border-color: #c62828;
  color: #c62828;
}

/* ── RESUME OPTIONS (shown when restoring prior session) ── */
.gbchat-quick-replies .gbchat-resume-label {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #aaa;
  margin-bottom: 4px;
}
