/* ==========================================================================
   Surmountor AI Assistant widget
   ========================================================================== */

/* --- Floating launcher (bottom-left pill) --- */
.saw-launcher {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9998;
  width: 56px;
  height: 84px;
  border-radius: 28px;
  background: #0a0a0a;
  border: 1px solid rgba(34,197,94,0.35);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45), 0 0 0 2px rgba(34,197,94,0.15);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0;
  transition: transform .18s ease, box-shadow .18s ease;
  user-select: none;
}
.saw-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 0 0 3px rgba(34,197,94,0.28);
}
.saw-launcher__icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,#22c55e,#3b82f6,#a855f7,#22c55e);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.35);
}
.saw-launcher__icon::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #0a0a0a;
  display: block;
  background-image:
    radial-gradient(circle at 34% 40%, #22c55e 0 3px, transparent 4px),
    radial-gradient(circle at 66% 40%, #22c55e 0 3px, transparent 4px);
}
.saw-launcher__label {
  color: #fff;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* --- Menu that pops next to the launcher on hover / click --- */
.saw-menu {
  position: fixed;
  left: 88px;
  bottom: 20px;
  z-index: 9998;
  min-width: 210px;
  background: #fff;
  color: #111;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  padding: 8px;
  display: none;
  font-family: "Inter", system-ui, sans-serif;
}
.saw-menu.is-open { display: block; }
.saw-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: #111;
  cursor: pointer;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background .15s;
}
.saw-menu__item:hover { background: rgba(34,197,94,0.10); color: #0a7f3f; }
.saw-menu__item svg { flex: 0 0 auto; }

/* --- Chat / results panel --- */
.saw-panel {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9999;
  width: min(400px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 40px));
  background: #0f1113;
  color: #fff;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: "Inter", system-ui, sans-serif;
}
.saw-panel.is-open { display: flex; }

.saw-panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(34,197,94,0.12), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.saw-panel__dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,#22c55e,#3b82f6,#a855f7,#22c55e);
  flex: 0 0 auto;
}
.saw-panel__title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
}
.saw-panel__subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
  line-height: 1;
}
.saw-panel__close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.saw-panel__close:hover { color: #fff; }

/* Tabs */
.saw-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.saw-tab {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font: 500 12px "Inter", sans-serif;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.saw-tab:hover { color: #fff; }
.saw-tab.is-active {
  color: #22c55e;
  border-bottom-color: #22c55e;
}

/* Body scroll area */
.saw-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scroll-behavior: smooth;
}
.saw-body::-webkit-scrollbar { width: 6px; }
.saw-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Message bubbles (chat mode) */
.saw-msg {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  word-wrap: break-word;
}
.saw-msg--bot {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.92);
  border-bottom-left-radius: 3px;
}
.saw-msg--user {
  background: #22c55e;
  color: #0a0a0a;
  margin-left: auto;
  border-bottom-right-radius: 3px;
  font-weight: 500;
}
.saw-msg a { color: #22c55e; text-decoration: underline; }
.saw-msg--user a { color: #052e16; }

/* Product cards inside chat */
.saw-cards {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.saw-card {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
  color: inherit;
  transition: background .15s, border-color .15s;
}
.saw-card:hover {
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.4);
}
.saw-card__img {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #1a1d20;
  flex: 0 0 auto;
}
.saw-card__body { flex: 1; min-width: 0; }
.saw-card__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  margin: 0 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.saw-card__spec {
  font-size: 11.5px;
  color: rgba(255,255,255,0.6);
  margin: 0 0 3px;
  line-height: 1.3;
}
.saw-card__meta {
  font-size: 10.5px;
  color: #22c55e;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Search input footer */
.saw-input {
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}
.saw-input input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  outline: 0;
}
.saw-input input:focus { border-color: rgba(34,197,94,0.6); }
.saw-input input::placeholder { color: rgba(255,255,255,0.4); }
.saw-input button {
  background: #22c55e;
  color: #052e16;
  border: 0;
  padding: 0 16px;
  border-radius: 10px;
  font: 500 13px "Inter", sans-serif;
  cursor: pointer;
  transition: background .15s;
}
.saw-input button:hover { background: #16a34a; color: #fff; }

/* Quick View: category grid */
.saw-catgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.saw-catgrid button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  padding: 14px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.saw-catgrid button:hover {
  background: rgba(34,197,94,0.10);
  border-color: rgba(34,197,94,0.4);
}
.saw-catgrid__name {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}
.saw-catgrid__n {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* Suggestion chips shown initially */
.saw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.saw-chip {
  background: rgba(34,197,94,0.10);
  border: 1px solid rgba(34,197,94,0.3);
  color: #a7f3c8;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.saw-chip:hover {
  background: rgba(34,197,94,0.2);
  color: #fff;
}

/* Mobile: full-screen panel */
@media (max-width: 480px) {
  .saw-panel {
    left: 0; bottom: 0; right: 0; top: 0;
    width: 100vw; height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .saw-menu { left: 88px; bottom: 20px; }
}

/* Hide on print */
@media print {
  .saw-launcher, .saw-menu, .saw-panel { display: none !important; }
}
