/* Shopify-storefront-safe variant of chat-widget.css.
   Difference from the standalone demo version: no global `*`/`body` reset,
   no .hero* rules (product-page mockup, unused on the real store), and every
   selector is scoped under #eva-widget-root so nothing bleeds into the theme. */

#eva-widget-root {
  --eb-primary: #256198;
  --eb-primary-dark: #1c4c78;
  --eb-accent-green: #82b69c;
  --eb-accent-olive: #97ae7c;
  --eb-accent-gold: #d2ad7b;
  --eb-text: #2e2e2e;
  --eb-bg: #ffffff;
  --eb-bg-soft: #f7f9fb;
  font-family: 'Montserrat', sans-serif;
}

#eva-widget-root, #eva-widget-root * { box-sizing: border-box; }

/* ── Chat Bubble ── lifted above 28px so it clears the theme's own floating
   basket/cart icon in the same corner, rather than overlapping it. */
#eva-widget-root #chat-bubble {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 60px;
  height: 60px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: var(--eb-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(37, 97, 152, 0.45);
  transition: transform 0.2s;
  z-index: 1000;
  border: none;
}
#eva-widget-root #chat-bubble:hover { transform: scale(1.08); }
#eva-widget-root #chat-bubble svg { width: 28px; height: 28px; fill: white; }

/* ── Backdrop ── unused in the corner-anchored layout (a typical storefront
   widget doesn't dim the page behind it) — kept in the DOM since chat-widget.js
   still toggles its class, but it never renders anything. */
#eva-widget-root #chat-backdrop {
  display: none;
}

/* ── Chat Window ── anchored bottom-right above the bubble, like a standard
   storefront chat widget (Intercom/Chatwoot default), not a centered modal. */
#eva-widget-root #chat-window {
  position: fixed;
  bottom: 172px;
  right: 28px;
  margin: 0;
  width: min(380px, calc(100vw - 48px));
  height: min(600px, calc(100vh - 140px));
  background: var(--eb-bg);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999;
  transform-origin: bottom right;
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}
#eva-widget-root #chat-window.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
@media (max-width: 640px) {
  #eva-widget-root #chat-window {
    width: calc(100vw - 24px);
    right: 12px;
  }
}

#eva-widget-root .chat-header {
  background: var(--eb-primary);
  padding: 16px 18px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#eva-widget-root .avatar {
  width: 40px; height: 40px;
  margin: 0;
  border-radius: 50%;
  background: var(--eb-accent-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
#eva-widget-root .header-info { flex: 1; margin: 0; padding: 0; }
#eva-widget-root .header-info .name { color: white; font-weight: 600; font-size: 1.15rem; margin: 0; }
#eva-widget-root .header-info .status { color: #d8e6f0; font-size: 0.85rem; margin: 0; }
#eva-widget-root .online-dot {
  width: 8px; height: 8px;
  margin: 0 5px 0 0;
  background: #5dde7e;
  border-radius: 50%;
  display: inline-block;
}
#eva-widget-root .close-btn {
  background: none; border: none; color: white;
  font-size: 1.3rem; cursor: pointer; opacity: 0.8;
  margin: 0; padding: 0;
}
#eva-widget-root .close-btn:hover { opacity: 1; }

#eva-widget-root .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--eb-bg-soft);
  list-style: none;
}
#eva-widget-root .chat-messages::-webkit-scrollbar { width: 4px; }
#eva-widget-root .chat-messages::-webkit-scrollbar-thumb { background: #d4dee8; border-radius: 4px; }

#eva-widget-root .msg-wrap { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; max-width: 88%; margin: 0; padding: 0; }
#eva-widget-root .msg-wrap.user { align-self: flex-end; }

#eva-widget-root .msg {
  padding: 10px 14px;
  margin: 0;
  border-radius: 18px;
  font-size: 1.15rem;
  line-height: 1.5;
  animation: eva-fadeUp 0.25s ease;
  white-space: pre-wrap;
}
@keyframes eva-fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#eva-widget-root .msg.bot {
  background: white;
  color: var(--eb-text);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
#eva-widget-root .msg.user {
  background: var(--eb-primary);
  color: white;
  border-bottom-right-radius: 6px;
}
#eva-widget-root .msg.agent {
  background: #eef2ff;
  color: var(--eb-text);
  border-bottom-left-radius: 6px;
  border: 1px solid #c7d2fe;
}

/* Approval status tag — internal QA aid. Consider hiding on the live store
   (see chat note in the handoff) since customers don't need to see it. */
#eva-widget-root .approval-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  margin: 0;
  border-radius: 10px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}
#eva-widget-root .approval-tag.approved { background: #e3f5ea; color: #1c7a43; }
#eva-widget-root .approval-tag.pending_reviewer { background: #fdf1e0; color: #a3620a; }
#eva-widget-root .approval-tag.unreviewed { background: #fdf6d8; color: #8a7300; }
#eva-widget-root .approval-tag.empty { background: #f0f0f0; color: #888; }
#eva-widget-root .approval-tag.agent { background: #e0e7ff; color: #3730a3; }
#eva-widget-root .approval-tag[data-claim="true"] { border: 1px dashed currentColor; }
#eva-widget-root .approval-tag .claim-note {
  display: none;
  position: absolute;
  max-width: 260px;
  margin-top: 24px;
  background: #2e2e2e;
  color: #fff;
  font-weight: 400;
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 8px;
  z-index: 10;
}
#eva-widget-root .approval-tag[data-claim="true"]:hover .claim-note { display: block; }

#eva-widget-root .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  align-self: flex-start;
  animation: eva-fadeUp 0.25s ease;
}
#eva-widget-root .chip {
  background: white;
  border: 1.5px solid var(--eb-primary);
  color: var(--eb-primary);
  border-radius: 20px;
  padding: 6px 14px;
  margin: 0;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  font-family: inherit;
}
#eva-widget-root .chip:hover { background: var(--eb-primary); color: white; }

/* ── Product cards + real Add-to-cart ── */
#eva-widget-root .product-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  align-self: stretch;
  animation: eva-fadeUp 0.25s ease;
}
#eva-widget-root .product-card {
  display: flex;
  gap: 10px;
  background: white;
  border: 1px solid #e6edf3;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
#eva-widget-root .product-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--eb-bg-soft);
}
#eva-widget-root .product-card-body { flex: 1; min-width: 0; margin: 0; padding: 0; }
#eva-widget-root .product-line {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--eb-accent-olive);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 2px;
}
#eva-widget-root .product-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--eb-text);
  line-height: 1.3;
  margin: 0 0 2px;
}
#eva-widget-root .product-meta {
  font-size: 0.76rem;
  color: #667;
  margin: 0 0 8px;
}
#eva-widget-root .product-cta {
  background: var(--eb-primary);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
#eva-widget-root .product-cta:hover:not(:disabled) { background: var(--eb-primary-dark); }
#eva-widget-root .product-cta:disabled { cursor: default; opacity: 0.6; }
#eva-widget-root .product-cta.added { background: #1c7a43; }
#eva-widget-root .cart-error {
  font-size: 0.72rem;
  color: #b3261e;
  margin-top: 6px;
}

#eva-widget-root .typing {
  display: flex; gap: 4px; padding: 12px 14px; margin: 0;
  background: white; border-radius: 18px; border-bottom-left-radius: 6px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
  animation: eva-fadeUp 0.2s ease;
}
#eva-widget-root .typing span {
  width: 7px; height: 7px;
  margin: 0;
  background: #c3d3e0;
  border-radius: 50%;
  animation: eva-bounce 1.2s infinite;
}
#eva-widget-root .typing span:nth-child(2) { animation-delay: 0.2s; }
#eva-widget-root .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes eva-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

#eva-widget-root .chat-input-area {
  padding: 12px;
  margin: 0;
  border-top: 1px solid #eef2f5;
  display: flex;
  gap: 8px;
  background: white;
  flex-shrink: 0;
}
#eva-widget-root #user-input {
  flex: 1;
  border: 1.5px solid #d4e2ec;
  border-radius: 22px;
  padding: 9px 15px;
  margin: 0;
  font-size: 1.15rem;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
  color: var(--eb-text);
  background: white;
}
#eva-widget-root #user-input:focus { border-color: var(--eb-primary); }
#eva-widget-root #send-btn {
  width: 40px; height: 40px;
  margin: 0;
  border-radius: 50%;
  background: var(--eb-primary);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
#eva-widget-root #send-btn:hover { background: var(--eb-primary-dark); }
#eva-widget-root #send-btn svg { width: 18px; height: 18px; fill: white; }

#eva-widget-root .powered {
  text-align: center;
  font-size: 0.7rem;
  color: #a8b8c6;
  padding: 6px;
  margin: 0;
  background: white;
  flex-shrink: 0;
}
