/* Built-in AI consultant widget. Uses a neutral slate accent (independent of the storefront --brand)
   so the chat reads as calm/assistive rather than promotional. Shadows still follow the site tokens. */
.na-chat-launcher,
.na-chat-panel {
  --na-accent: #334155;
  --na-accent-hover: #1e293b;
  --na-accent-ink: #fff;
}
.na-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 50%;
  background: var(--na-accent);
  color: var(--na-accent-ink);
  cursor: pointer;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, .25));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
}
.na-chat-launcher:hover { transform: scale(1.06); }
.na-chat-launcher svg { width: 28px; height: 28px; }

.na-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0, 0, 0, .28));
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.na-chat-panel.na-open { display: flex; }

.na-chat-head {
  background: var(--na-accent);
  color: var(--na-accent-ink);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}
.na-chat-head-actions { display: flex; align-items: center; gap: 4px; }
.na-chat-close,
.na-chat-new {
  background: transparent;
  border: 0;
  color: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}
.na-chat-close { font-size: 22px; }
.na-chat-new {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}
.na-chat-new svg { width: 18px; height: 18px; }
.na-chat-close:hover,
.na-chat-new:hover { opacity: 1; }

.na-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f6f7f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.na-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 14px;
  line-height: 1.4;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.na-msg-user {
  align-self: flex-end;
  background: var(--na-accent);
  color: var(--na-accent-ink);
  border-bottom-right-radius: 4px;
}
.na-msg-bot {
  align-self: flex-start;
  background: #fff;
  color: #1f2430;
  border: 1px solid #e6e8ec;
  border-bottom-left-radius: 4px;
}

.na-cards { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; max-width: 85%; }
.na-card {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: #1f2430;
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 8px;
}
.na-card:hover { border-color: var(--na-accent); }
.na-card img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #eef0f3; }
.na-card > div { min-width: 0; }
.na-card-name { font-size: 13px; font-weight: 600; }
.na-card-meta { font-size: 12px; color: #6b7280; margin-top: 2px; }
.na-card-price { font-size: 13px; font-weight: 700; color: #1f2430; margin-top: 2px; }

.na-typing { font-size: 13px; color: #6b7280; align-self: flex-start; padding: 4px 6px; }

.na-chat-foot {
  border-top: 1px solid #e6e8ec;
  padding: 10px;
  display: flex;
  gap: 8px;
  background: #fff;
}
.na-chat-input {
  flex: 1;
  resize: none;
  border: 1px solid #d6d9de;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  max-height: 96px;
}
.na-chat-input:focus { outline: none; border-color: var(--na-accent); }
.na-chat-send {
  border: 0;
  border-radius: 10px;
  background: var(--na-accent);
  color: var(--na-accent-ink);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
}
.na-chat-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 767px) {
  .na-chat-launcher {
    right: 16px;
    bottom: 16px;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
  }

  .na-chat-launcher svg {
    width: 26px;
    height: 26px;
  }

  .na-chat-panel {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }

  @supports (height: 100dvh) {
    .na-chat-panel {
      height: 100dvh;
    }
  }

  .na-chat-head {
    min-height: 56px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  }

  .na-chat-close,
  .na-chat-new {
    min-width: 36px;
    min-height: 36px;
  }

  .na-chat-body {
    padding: 12px;
    gap: 9px;
  }

  .na-msg,
  .na-cards {
    max-width: 100%;
  }

  .na-msg {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .na-card {
    align-items: flex-start;
    gap: 9px;
  }

  .na-card-name,
  .na-card-meta,
  .na-card-price {
    overflow-wrap: anywhere;
  }

  .na-chat-foot {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .na-chat-input {
    min-width: 0;
    font-size: 16px;
  }

  .na-chat-send {
    min-width: 44px;
    padding: 0 13px;
  }
}
