/* AI shopping assistant chat box (includes/shopping-assistant.html) */
/* --vv-right and --vv-bottom (shopping-assistant.js): how much of .assistant-layer is off the visible screen, as when
   the keyboard is open; --vv-low: how much further down the screen goes than the layer, once the toolbars are hidden */
.assistant-dock {
  position: fixed; right: calc(1.25rem + var(--vv-right, 0px)); bottom: calc(1.25rem + var(--vv-bottom, 0px)); z-index: 1030;
}
/* a round button; while the box is open above it, a down arrow that closes it */
.assistant-launch {
  position: relative; display: block; width: 3rem; height: 3rem; padding: 0; border-radius: 50%; background: #fff;
  border: 0; color: #344767; box-shadow: 0 0 0 1px #e9ecef, 0 4px 14px rgba(52, 71, 103, 0.22); transition: transform 0.15s ease;
}
.assistant-launch:active { transform: scale(0.92); }
.assistant-launch-icon, .assistant-launch-close {
  position: absolute; inset: 0; display: flex !important; align-items: center; justify-content: center; line-height: 1;
  transition: opacity 0.15s ease, transform 0.2s ease;
}
/* fills the button to its edge */
.assistant-launch-icon img { width: 100%; height: 100%; border-radius: 50%; }
.assistant-launch-close { font-size: 1rem; opacity: 0; transform: rotate(-30deg); }
.assistant-dock.is-open .assistant-launch-icon { opacity: 0; transform: scale(0.5); }
.assistant-dock.is-open .assistant-launch-close { opacity: 1; transform: none; }
/* Phones lay a fixed box out against the page's frame, which can be wider and taller than the screen (something on the
   page sticks out) or reach under the browser's toolbar. This layer is the screen itself: 100svh is its height with the
   toolbars showing. Its boxes are placed inside it. */
@media (max-width: 767.98px) and (pointer: coarse) {
  .assistant-layer {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100%; height: 100svh; z-index: 1035; pointer-events: none;
  }
  .assistant-layer > * { position: absolute !important; pointer-events: auto; }
}
/* the header's ... menu */
.assistant-menu {
  position: absolute; top: calc(100% + 0.25rem); right: 0; z-index: 2; white-space: nowrap; min-width: 10.5rem; padding: 0.375rem; background: #fff;
  border: 1px solid #e9ecef; border-radius: 0.75rem; box-shadow: 0 8px 24px rgba(52, 71, 103, 0.2);
}
.assistant-menu[hidden] { display: none; }
.assistant-menu button {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.75rem; padding: 0 0.75rem; border: 0;
  border-radius: 0.5rem; background: none; color: #344767; font-size: 0.875rem; text-align: left;
}
.assistant-menu button[hidden] { display: none; }
.assistant-menu button:hover, .assistant-menu button:focus-visible { background: #f4f5f8; }
.assistant-tab {
  position: fixed; right: var(--vv-right, 0px); bottom: calc(1.25rem + var(--vv-bottom, 0px) - var(--vv-low, 0px)); z-index: 1030;
  width: 0.875rem; height: 2.75rem; padding: 0; border: 1px solid #dee2e6; border-right: 0; border-radius: 0.5rem 0 0 0.5rem;
  background: #fff; color: #67748e; font-size: 0.5625rem; box-shadow: -1px 1px 6px rgba(52, 71, 103, 0.14);
}
/* slim to look at, wide enough to tap */
.assistant-tab::before { content: ''; position: absolute; top: -0.375rem; right: 0; bottom: -0.375rem; width: 2.25rem; }
.assistant-tab:hover, .assistant-tab:focus-visible { color: #cb0c9f; border-color: #cb0c9f; }
.assistant-dock[hidden], .assistant-tab[hidden] { display: none; }
.assistant-dock.is-arriving { animation: assistant-arrive 0.25s ease; }
@keyframes assistant-arrive { from { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .assistant-dock.is-arriving { animation: none; } }
.assistant-launch:hover, .assistant-launch:focus { background: #fff; border-color: #cb0c9f; color: #cb0c9f; }
@media (prefers-reduced-motion: reduce) {
  .assistant-launch, .assistant-launch-icon, .assistant-launch-close, .assistant-panel { transition: none; animation: none !important; }
}
/* above the button, its right edge in line with it */
.assistant-panel {
  position: fixed; right: calc(1.25rem + var(--vv-right, 0px)); bottom: calc(5.25rem + var(--vv-bottom, 0px)); z-index: 1040;
  width: 400px; height: min(680px, calc(100vh - 6.75rem)); display: flex; flex-direction: column; border-radius: 1.25rem;
  overflow: hidden; border: 1px solid #dee2e6; box-shadow: 0 16px 48px rgba(20, 23, 39, 0.28) !important;
  transform-origin: bottom right; animation: assistant-open 0.2s ease;
}
@keyframes assistant-open { from { opacity: 0; transform: scale(0.9) translateY(1rem); } }
.assistant-header { flex: 0 0 auto; background: #fff; border-bottom: 1px solid #e9ecef; }
.assistant-name { margin: 0; font-size: 0.875rem; font-weight: 700; line-height: 1.3; color: #344767; }
.assistant-tagline { margin: 0; font-size: 0.75rem; line-height: 1.3; color: #67748e; }
.assistant-panel[hidden] { display: none; }
/* tinted, with white bubbles and cards on it: reads as a window of its own over the white page */
.assistant-log { flex: 1 1 auto; overflow-y: auto; min-height: 120px; padding-top: 0.75rem; background: #f4f5f8; border-bottom: 1px solid #e9ecef; }
.assistant-bubble {
  width: fit-content; max-width: 90%; margin: 0 0 0.5rem; padding: 0.5rem 0.75rem; border-radius: 0.75rem;
  background: #fff; color: #344767; box-shadow: 0 1px 2px rgba(52, 71, 103, 0.1); font-size: 0.875rem; overflow-wrap: anywhere;
  white-space: pre-line;
}
.assistant-mine { margin-left: auto; color: #fff; background: #cb0c9f; }
/* the cards under an answer: light, with one bold thing each (a product's price, a store's name) */
.assistant-card {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; padding: 0.625rem 0.75rem;
  border: 1px solid #edf0f3; border-radius: 0.75rem; background: #fff;
}
.assistant-card img {
  flex: 0 0 44px; width: 44px; height: 44px; object-fit: contain; border-radius: 0.5rem; background: #fff;
}
.assistant-card-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.assistant-card-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: #344767; font-size: 0.8125rem; font-weight: 600;
}
.assistant-card-name.is-item { font-weight: 400; }
.assistant-card-name:hover { color: #cb0c9f; }
.assistant-card-price { display: block; margin-top: 0.125rem; color: #344767; font-size: 0.875rem; font-weight: 700; }
.assistant-card-was { margin-left: 0.375rem; color: #8392ab; font-size: 0.75rem; font-weight: 400; }
.assistant-card-meta, .assistant-card-offer { display: block; color: #67748e; font-size: 0.75rem; }
.assistant-card-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assistant-card-rate { color: #cb0c9f; font-size: 0.75rem; font-weight: 600; }
.assistant-card-text > .assistant-card-rate { display: block; margin-top: 0.125rem; }
.assistant-card-code {
  display: inline-block; margin-top: 0.25rem; padding: 0.0625rem 0.375rem; border-radius: 0.25rem; background: #f4f5f8;
  color: #344767; font-size: 0.6875rem; font-weight: 600;
}
.assistant-card .btn { flex: 0 0 auto; padding: 0.375rem 0.75rem; font-size: 0.75rem; text-transform: none; }
/* outlined: a row of solid pink buttons is what made the cards feel loud. Solid on hover, and for Join */
.assistant-card:not(.assistant-join) .btn.assistant-btn { background: #fff; color: #cb0c9f; box-shadow: inset 0 0 0 1px #cb0c9f; }
.assistant-card:not(.assistant-join) .btn.assistant-btn:hover,
.assistant-card:not(.assistant-join) .btn.assistant-btn:focus-visible { background: #cb0c9f; color: #fff; }
.assistant-card-offer { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* on phones the box is the whole screen, closed from its header, and the button is raised only when the page has a bar
   or button of its own at the bottom (category pages' Join bar, the store page's Shop pill) */
@media (max-width: 767.98px) {
  .assistant-dock {
    right: calc(1rem + var(--vv-right, 0px)); bottom: calc(1rem + var(--vv-bottom, 0px) - var(--vv-low, 0px) + env(safe-area-inset-bottom, 0px));
    transition: bottom 0.25s ease, transform 0.25s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .assistant-dock.is-open { display: none; }
  .assistant-dock.is-away:not(:has(:focus-visible)) { transform: translateY(200%); opacity: 0; visibility: hidden; }
  body:has(.fixed-bottom.d-md-none) .assistant-dock, body:has(.floating-cta:not(.is-hidden)) .assistant-dock,
  body:has(.fixed-bottom.d-md-none) .assistant-tab, body:has(.floating-cta:not(.is-hidden)) .assistant-tab {
    bottom: calc(4.5rem + var(--vv-bottom, 0px) - var(--vv-low, 0px) + env(safe-area-inset-bottom, 0px));
  }
  .assistant-panel {
    top: 0; left: 0; right: var(--vv-right, 0px); bottom: calc(var(--vv-bottom, 0px) - var(--vv-low, 0px)); z-index: 1060; width: auto; height: auto;
    border: 0; border-radius: 0;
  }
  /* above the page's sticky header; the page behind stays where it is */
  body.assistant-showing .assistant-layer { z-index: 1060; }
  body.assistant-showing { overflow: hidden; }
  /* a smaller font makes iOS zoom in when the field is tapped */
  .assistant-panel #assistantInput { font-size: 1rem; }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) { .assistant-dock { transition: none; } }
.assistant-info { display: block; line-height: 1.4; }
.assistant-info .assistant-card-name { display: block; -webkit-line-clamp: none; margin-bottom: 0.125rem; font-weight: 700; }
.assistant-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.assistant-actions .btn { padding: 0.5rem 0.875rem; text-transform: none; }
.assistant-action, .assistant-action:hover {
  padding: 0.4375rem 0.875rem; border: 1px solid #dee2e6; border-radius: 0.5rem; background: #fff; color: #344767;
  font-size: 0.75rem; font-weight: 600;
}
.assistant-action:hover { border-color: #cb0c9f; color: #cb0c9f; }
.assistant-join { border-color: #f5c6e7; background: #fdf2fa; }
.assistant-join .btn { margin-top: 0.5rem; }
.assistant-store-link, .assistant-store-link:hover { color: inherit; font-weight: inherit; text-decoration: underline; }
.assistant-presets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.assistant-presets[hidden] { display: none; }
.assistant-preset {
  min-height: 2.25rem; padding: 0.25rem 0.75rem; border: 1px solid #cb0c9f; border-radius: 1.125rem; background: #fff;
  color: #cb0c9f; font-size: 0.8125rem; font-weight: 600; text-align: left; overflow-wrap: anywhere;
}
.assistant-preset:hover, .assistant-preset:focus { background: #fdf2fa; }
/* the theme's primary pink, plain: no gradient in the box */
.assistant-btn, .assistant-btn:hover, .assistant-btn:focus {
  color: #fff; background: #cb0c9f;
}
.assistant-avatar {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px #e9ecef; font-size: 1.125rem;
  display: flex; align-items: center; justify-content: center;
}
/* under each of Bucky's messages: who, that it's an AI, and when */
.assistant-meta { margin: 0 0 0.75rem 0.25rem; font-size: 0.6875rem; line-height: 1.3; color: #67748e; }
.assistant-composer {
  display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 1rem 0.5rem; padding: 0.375rem 0.375rem 0.375rem 1rem;
  border: 1px solid #dee2e6; border-radius: 1.5rem; background: #fff;
}
.assistant-composer:focus-within { border-color: #cb0c9f; }
.assistant-input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: none; font-size: 0.875rem; color: #344767; }
.assistant-send {
  flex: 0 0 auto; width: 2.25rem; height: 2.25rem; padding: 0; border: 0; border-radius: 50%; background: #cb0c9f; color: #fff;
  font-size: 0.875rem; transition: background-color 0.15s ease;
}
.assistant-send:disabled { background: #e9ecef; color: #8392ab; }
/* the answer being worked out: three dots, then a word on what is going on */
.assistant-typing { display: flex; align-items: center; gap: 0.5rem; min-height: 2.25rem; }
.assistant-dots, .assistant-dots::before, .assistant-dots::after {
  width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: #8392ab; animation: assistant-dot 1.2s infinite ease-in-out;
}
.assistant-dots { position: relative; margin: 0 0.75rem; animation-delay: 0.15s; }
.assistant-dots::before, .assistant-dots::after { content: ''; position: absolute; top: 0; }
.assistant-dots::before { left: -0.75rem; animation-delay: 0s; }
.assistant-dots::after { left: 0.75rem; animation-delay: 0.3s; }
.assistant-typing-text { color: #67748e; font-size: 0.8125rem; }
@keyframes assistant-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .assistant-dots, .assistant-dots::before, .assistant-dots::after { animation: none; } }
