/* 361 Degrees chat widget.
   Namespaced under .sh-chat and deliberately NOT inside .shx, so the
   .shx specificity trap documented in claude/payment-options-panel.md
   cannot reach it. Every colour, font-size and background is stated
   explicitly for the same reason. */

.sh-chat {
  --shc-accent: #0f8a5f;
  --shc-accent-dark: #0b6b49;
  --shc-accent-tint: #e6f4ee;
  --shc-navy: #17324d;
  --shc-ink: #14202b;
  --shc-muted: #62717f;
  --shc-faint: #98a4ae;
  --shc-line: #e3e8ec;
  --shc-bg: #ffffff;
  --shc-bg-2: #f6f8fa;
  --shc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9998;
  font-family: var(--shc-font);
  -webkit-font-smoothing: antialiased;
}

.sh-chat *, .sh-chat *::before, .sh-chat *::after { box-sizing: border-box; }

/* ---------- launcher ---------- */
.sh-chat .sh-chat-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #17a874, var(--shc-accent-dark));
  color: #ffffff;
  font-family: var(--shc-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px -8px rgba(15, 138, 95, 0.65), 0 2px 6px rgba(20, 32, 43, 0.12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.sh-chat .sh-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgba(15, 138, 95, 0.7), 0 2px 6px rgba(20, 32, 43, 0.12); }
.sh-chat .sh-chat-fab:focus-visible { outline: 3px solid var(--shc-accent); outline-offset: 3px; }
.sh-chat .sh-chat-fab-icon { display: flex; color: #ffffff; }
.sh-chat .sh-chat-fab-pulse {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7);
  animation: sh-chat-pulse 2.2s ease-out infinite;
}
@keyframes sh-chat-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 209, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0); }
}
.sh-chat[data-sh-open="1"] .sh-chat-fab,
.sh-chat[data-sh-open="1"] .sh-chat-tease { display: none; }

/* The little hello above the launcher */
.sh-chat .sh-chat-tease {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: 260px;
  padding: 12px 34px 12px 14px;
  background: var(--shc-bg);
  color: var(--shc-ink);
  font-size: 13.5px;
  line-height: 1.45;
  border-radius: 14px 14px 4px 14px;
  border: 1px solid var(--shc-line);
  box-shadow: 0 14px 34px -14px rgba(20, 32, 43, 0.35);
  animation: sh-chat-rise .35s ease-out;
}
.sh-chat .sh-chat-tease[hidden] { display: none; }
.sh-chat .sh-chat-tease-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--shc-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}
.sh-chat .sh-chat-tease-close:hover { color: var(--shc-ink); }
@keyframes sh-chat-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- panel ---------- */
.sh-chat .sh-chat-panel {
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 60px);
  background: var(--shc-bg);
  border: 1px solid var(--shc-line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(20, 32, 43, 0.45), 0 2px 8px rgba(20, 32, 43, 0.08);
  animation: sh-chat-rise .25s ease-out;
}
.sh-chat .sh-chat-panel[hidden] { display: none; }

.sh-chat .sh-chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  background:
    radial-gradient(420px 160px at 90% -40%, rgba(255, 255, 255, 0.22), transparent 60%),
    linear-gradient(135deg, #17a874, var(--shc-accent-dark));
  color: #ffffff;
}
.sh-chat .sh-chat-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
}
.sh-chat .sh-chat-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7ef0b0;
  border: 2px solid var(--shc-accent-dark);
}
.sh-chat .sh-chat-head-text { flex: 1 1 auto; min-width: 0; }
.sh-chat .sh-chat-head strong { display: block; font-size: 15px; font-weight: 700; color: #ffffff; letter-spacing: -0.01em; }
.sh-chat .sh-chat-sub { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.82); margin-top: 2px; }
.sh-chat .sh-chat-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease;
}
.sh-chat .sh-chat-close:hover { background: rgba(255, 255, 255, 0.26); }
.sh-chat .sh-chat-close:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

/* ---------- log ---------- */
.sh-chat .sh-chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(600px 220px at 50% -120px, rgba(15, 138, 95, 0.07), transparent),
    var(--shc-bg-2);
  scroll-behavior: smooth;
}
.sh-chat .sh-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: sh-chat-rise .2s ease-out;
}
.sh-chat .sh-msg-bot {
  align-self: flex-start;
  background: var(--shc-bg);
  color: var(--shc-ink);
  border: 1px solid var(--shc-line);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(20, 32, 43, 0.05);
}
.sh-chat .sh-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #17a874, var(--shc-accent-dark));
  color: #ffffff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 6px 16px -8px rgba(15, 138, 95, 0.8);
}
.sh-chat .sh-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sh-chat .sh-msg strong { font-weight: 700; }

.sh-chat .sh-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--shc-bg);
  border: 1px solid var(--shc-line);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
}
.sh-chat .sh-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--shc-faint);
  animation: sh-chat-blink 1.2s infinite ease-in-out;
}
.sh-chat .sh-typing i:nth-child(2) { animation-delay: .15s; }
.sh-chat .sh-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sh-chat-blink {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- quick replies ---------- */
.sh-chat .sh-chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 14px 12px;
  background: var(--shc-bg-2);
}
.sh-chat .sh-chat-quick[hidden] { display: none; }
.sh-chat .sh-quick {
  border: 1px solid rgba(15, 138, 95, 0.4);
  background: var(--shc-bg);
  color: var(--shc-accent-dark);
  font-family: var(--shc-font);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.sh-chat .sh-quick:hover { background: var(--shc-accent-tint); border-color: var(--shc-accent); transform: translateY(-1px); }

/* ---------- composer ---------- */
.sh-chat .sh-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 10px;
  border-top: 1px solid var(--shc-line);
  background: var(--shc-bg);
}
.sh-chat .sh-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  font-family: var(--shc-font);
  font-size: 16px; /* 16px or more, or iPhone Safari zooms the page on focus */
  color: var(--shc-ink);
  background: var(--shc-bg-2);
  border: 1px solid var(--shc-line);
  border-radius: 999px;
  outline: none;
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sh-chat .sh-chat-input::placeholder { color: var(--shc-faint); }
.sh-chat .sh-chat-input:focus {
  background: var(--shc-bg);
  border-color: var(--shc-accent);
  box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.18);
}
.sh-chat .sh-chat-send {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--shc-accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.sh-chat .sh-chat-send:hover { background: var(--shc-accent-dark); transform: scale(1.04); }
.sh-chat .sh-chat-send:disabled { opacity: .5; cursor: default; transform: none; }
.sh-chat .sh-chat-send:focus-visible { outline: 3px solid var(--shc-accent); outline-offset: 2px; }

.sh-chat .sh-chat-foot {
  padding: 8px 14px 11px;
  font-size: 12px;
  color: var(--shc-muted);
  text-align: center;
  background: var(--shc-bg);
}
.sh-chat .sh-chat-foot a { color: var(--shc-accent-dark); font-weight: 600; text-decoration: none; }
.sh-chat .sh-chat-foot a:hover { text-decoration: underline; }

/* Screen readers only */
.sh-chat .screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- phones ---------- */
@media (max-width: 480px) {
  .sh-chat { right: 12px; bottom: 12px; }
  .sh-chat .sh-chat-fab { padding: 12px 16px 12px 14px; font-size: 14px; }
  .sh-chat .sh-chat-tease { width: min(260px, calc(100vw - 40px)); }
  /* Open on a phone: pinned to all four edges, sized to the screen (100% not
     100vw, which includes the scrollbar and can overflow to the right). */
  .sh-chat[data-sh-open="1"] { top: 0; right: 0; bottom: 0; left: 0; width: 100%; max-width: 100%; z-index: 100000; }
  .sh-chat .sh-chat-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .sh-chat .sh-chat-log { overflow-x: hidden; }
  .sh-chat .sh-chat-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* Stop the page behind from scrolling sideways while the chat is open. */
  html:has(.sh-chat[data-sh-open="1"]),
  html:has(.sh-chat[data-sh-open="1"]) body { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .sh-chat .sh-chat-fab-pulse, .sh-chat .sh-typing i { animation: none; }
  .sh-chat .sh-chat-panel, .sh-chat .sh-msg, .sh-chat .sh-chat-tease { animation: none; }
  .sh-chat .sh-chat-log { scroll-behavior: auto; }
}

/* ------------------------------------------------------------------ */
/* Agentic search box, rendered by [sh_search]                         */
/* ------------------------------------------------------------------ */

.sh-search {
  max-width: 720px;
  margin: 0 0 28px;
  font-family: inherit;
}
.sh-search-form { display: flex; gap: 8px; }
.sh-search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 13px 16px;
  font-size: 16px;
  border: 1px solid #d3dae0;
  border-radius: 12px;
  background: #ffffff;
  color: #14202b;
  box-shadow: 0 1px 2px rgba(20, 32, 43, 0.04);
}
.sh-search-input:focus { outline: none; border-color: #0f8a5f; box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.18); }
.sh-search-go {
  flex: 0 0 auto;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #17a874, #0b6b49);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgba(15, 138, 95, 0.8);
}
.sh-search-go:hover { filter: brightness(1.05); }
.sh-search-note { margin: 10px 2px 0; font-size: 14px; color: #62717f; min-height: 1.2em; }
.sh-search-results { display: grid; gap: 8px; margin-top: 10px; }
.sh-search-hit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid #e3e8ec;
  border-radius: 12px;
  background: #ffffff;
  text-decoration: none;
  color: #14202b;
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.sh-search-hit:hover { border-color: #0f8a5f; transform: translateY(-1px); box-shadow: 0 10px 24px -16px rgba(20, 32, 43, 0.3); }
.sh-search-title { flex: 1 1 260px; font-weight: 600; }
.sh-search-price { font-variant-numeric: tabular-nums; color: #0b6b49; font-weight: 700; }
.sh-search-out { font-size: 13px; color: #c0392b; background: #fdecec; border-radius: 999px; padding: 2px 9px; }
@media (max-width: 520px) {
  .sh-search-form { flex-wrap: wrap; }
  .sh-search-go { width: 100%; }
}

/* ---------- product cards ---------- */
.sh-chat .sh-cards {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 2px 0 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; max-width: 100%;
  flex: 0 0 auto; /* the log is a flex column: never squash the cards */
}
.sh-chat .sh-chat-img { flex: 0 0 auto; }
.sh-chat .sh-card {
  flex: 0 0 176px; scroll-snap-align: start; display: flex; flex-direction: column;
  background: #ffffff; border: 1px solid var(--shc-line); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: var(--shc-ink); box-shadow: 0 1px 3px rgba(20, 32, 43, 0.06);
}
.sh-chat .sh-cards-one .sh-card { flex-basis: 220px; }
.sh-chat .sh-card:hover { border-color: var(--shc-accent); }
.sh-chat .sh-card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: #f3f5f7; }
.sh-chat .sh-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sh-chat .sh-card-tag { position: absolute; top: 8px; left: 8px; font-style: normal; font-size: 11px; font-weight: 600; color: #b32d2e; background: #fdecec; border-radius: 999px; padding: 2px 8px; }
.sh-chat .sh-card-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 11px 11px; }
.sh-chat .sh-card-title { font-size: 13px; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh-chat .sh-card-price { font-size: 13.5px; font-weight: 700; color: var(--shc-accent); }
.sh-chat .sh-card-price s { font-weight: 400; color: var(--shc-faint); font-size: 12px; margin-left: 4px; }
.sh-chat .sh-card-go { margin-top: 4px; font-size: 12.5px; font-weight: 600; text-align: center; color: #ffffff; background: var(--shc-accent); border-radius: 999px; padding: 7px 10px; }