/*
 * The ordering assistant's tab and panel.
 *
 * An "Ask" tab fixed to the right edge, and a panel that slides in from the
 * right with PIMento's chat in an iframe. A hidden checkbox and label siblings
 * do the opening and closing; there is no script in the open/close path.
 *
 * Self-contained on purpose: this site's stylesheet has no design tokens, so
 * the few values used are written here rather than borrowed. Navy is the
 * site's own (#172f81, the header's "My Account" colour).
 */

.chat-blade__toggle { position: absolute; opacity: 0; pointer-events: none; }

/* The tab. `top` is the default; chat-blade.js overwrites it inline once the
   shopper drags it, and remembers where. */
.chat-blade__tab {
  position: fixed;
  top: 58vh;
  right: 0;
  z-index: 1040;               /* above the sticky header, below Bootstrap modals (1055) */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 62px;
  padding: 18px 0;
  margin: 0;
  background: #172f81;
  color: #fff;
  border-radius: 10px 0 0 10px;
  box-shadow: 0 2px 6px rgb(23 47 129 / 18%), 0 12px 32px rgb(23 47 129 / 16%);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: background .12s, right .22s ease, box-shadow .12s;
}
.chat-blade__tab:hover { background: #0f2160; color: #fff; }
.chat-blade__tab:focus-visible { outline: 3px solid #f5a623; outline-offset: 2px; }
.chat-blade__tab.is-dragging {
  cursor: grabbing;
  box-shadow: 0 8px 28px rgb(23 47 129 / 34%);
  transition: background .12s, box-shadow .12s;   /* no `right` lag while dragging */
}
.chat-blade__tab-icon { width: 30px; height: 30px; }
.chat-blade__tab-label {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1;
}
/* A grip, so it reads as draggable rather than merely clickable. */
.chat-blade__tab::after {
  content: "";
  width: 18px;
  height: 8px;
  opacity: .55;
  background-image: radial-gradient(currentColor 1px, transparent 1px);
  background-size: 6px 4px;
}

.chat-blade {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1050;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid #dfe3ec;
  box-shadow: 0 2px 6px rgb(0 0 0 / 10%), 0 12px 32px rgb(0 0 0 / 12%);
  transform: translateX(100%);
  transition: transform .22s ease;
}

.chat-blade__scrim {
  position: fixed;
  inset: 0;
  z-index: 1045;
  margin: 0;
  background: rgb(15 25 55 / 42%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

/* Open state. */
.chat-blade__toggle:checked ~ .chat-blade { transform: translateX(0); }
.chat-blade__toggle:checked ~ .chat-blade__scrim { opacity: 1; pointer-events: auto; }
.chat-blade__toggle:checked ~ .chat-blade__tab { right: min(400px, 92vw); }

.chat-blade__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #dfe3ec;
}
.chat-blade__head h2 { margin: 0; font-size: 1.05rem; font-weight: 700; color: #172f81; }
.chat-blade__close {
  font-size: 1.6rem;
  line-height: 1;
  color: #6d7688;
  cursor: pointer;
  padding: 0 4px;
  margin: 0;
}
.chat-blade__close:hover { color: #172f81; }

.chat-blade__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-blade__body iframe {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 0;
}
.chat-blade__status {
  margin: 0;
  padding: 24px 18px;
  color: #6d7688;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .chat-blade,
  .chat-blade__scrim,
  .chat-blade__tab { transition: none; }
}
