/* Pool Robots chat — the Service Hub widget (loaded at the end of base.njk) and
   the site's own launcher card (built by assets/js/pr-chat.js). Loaded on every
   page after style.css; tokens (--ink, --accent, --border …) come from there. */

/* The widget host: its offsets are read through the widget's shadow root. */
[data-shp-chat] { --shp-bottom: 20px; --shp-side: 20px; }
@media (max-width: 599.98px) {
  [data-shp-chat] { --shp-bottom: 16px; --shp-side: 12px; }
}
/* Out of the way while the phone menu or the cart drawer is open. */
body.menu-open [data-shp-chat],
body.menu-open .pr-chat-launcher,
body:has(#cart-drawer.active) [data-shp-chat],
body:has(#cart-drawer.active) .pr-chat-launcher { display: none; }

/* The launcher card: the first expert's photo, the label, the chat button — in the header's dark glass. */
.pr-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147482000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 9px 12px 9px 9px;
  border-radius: 999px;
  background: rgba(14, 14, 16, 0.95);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.18);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}
.pr-chat-launcher.is-in { opacity: 1; transform: none; }
.pr-chat-launcher:hover,
.pr-chat-launcher:focus-visible {
  background: rgba(24, 24, 27, 0.97);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36), 0 2px 6px rgba(0, 0, 0, 0.18);
  transform: translateY(-2px);
  outline: none;
}
.pr-chat-launcher__photo { position: relative; flex: none; width: 48px; height: 48px; }
.pr-chat-launcher__photo img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 28%;
  background: #2a2a2e;
  border: 2px solid rgba(255, 255, 255, 0.16);
  box-sizing: border-box;
}
.pr-chat-launcher__dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #30d158;
  border: 2px solid #0e0e10;
  box-sizing: border-box;
}
.pr-chat-launcher__text { display: grid; gap: 2px; min-width: 0; padding-right: 4px; }
.pr-chat-launcher__text strong { font-size: 15px; font-weight: 700; line-height: 1.2; color: #fff; white-space: nowrap; letter-spacing: -0.01em; }
.pr-chat-launcher__text small { font-size: 12.5px; line-height: 1.2; color: rgba(255, 255, 255, 0.62); white-space: nowrap; }
.pr-chat-launcher__go {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent, #0071e3);
  color: #fff;
  display: grid;
  place-items: center;
}
.pr-chat-launcher__go svg { width: 20px; height: 20px; }
@media (max-width: 599.98px) {
  .pr-chat-launcher { right: 12px; bottom: 16px; gap: 10px; padding: 7px 10px 7px 7px; }
  .pr-chat-launcher__photo, .pr-chat-launcher__photo img { width: 42px; height: 42px; }
  .pr-chat-launcher__text strong { font-size: 14px; }
  .pr-chat-launcher__text small { font-size: 12px; }
  .pr-chat-launcher__go { width: 34px; height: 34px; }
}

/* Header: a round chat button next to Find My Robot (icon only — the nav is content-width
   with nowrap links, so the actions box has ~287px at 1280 and a labelled button never fits;
   the words live in the title, the mega / phone menus, the footer and the launcher card).
   Shown from 1280px up; below that .header-actions would overflow to the LEFT over the nav. */
.header-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-chat:hover,
.header-chat:focus-visible { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: #fff; outline: none; }
.header-chat svg { flex-shrink: 0; width: 18px; height: 18px; }
.header-chat span { display: none; }
@media (max-width: 1279.98px) {
  .header-chat { display: none; }
}

/* Product pages: the "Need help?" card under the buy box (products/product.njk, affiliate-product.njk) —
   the first expert's face + one line, the whole card opens the chat. Grey, like the Dolphin site's. */
.pp-help-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 18px 10px 10px;
  border-radius: 16px;
  background: #eceef1;
  border: 1px solid var(--border, #e8e8ed);
  color: var(--ink, #1d1d1f);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.pp-help-cta:hover,
.pp-help-cta:focus-visible {
  transform: translateY(-1px);
  background: #e4e7eb;
  border-color: rgba(0, 113, 227, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  color: var(--ink, #1d1d1f);
  text-decoration: none;
  outline: none;
}
.pp-help-cta .pp-help-face,
.pp-help-cta picture,
.pp-help-cta picture img {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 28%;
  border: 2px solid #fff;
  background: var(--surface-alt, #f5f5f7);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.pp-help-text { min-width: 0; }
.pp-help-text strong { font-weight: 600; }
.pp-help-arrow { color: var(--accent, #0071e3); font-weight: 600; margin-left: 2px; }
