/* ===========================================================
   PakRobots · shared widgets: chat assistant + cart badge
   Used by concept-5/index.html and concept-5/cart.html
   =========================================================== */

.pr-chat {
  --ink: #101014;
  --y: #FFD400;
  --y-deep: #F2B000;
  --line: #ECE4D2;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 400;
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

.pr-chat-fab {
  position: relative;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--y);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(16, 16, 20, .18);
  transition: scale .2s, box-shadow .2s, background .2s;
}
.pr-chat-fab img { width: 34px; height: 34px; object-fit: contain; }
.pr-chat-fab:hover { scale: 1.05; box-shadow: 0 14px 32px rgba(16, 16, 20, .24); }
.pr-chat-fab:active { scale: .97; }
.pr-chat-dot {
  position: absolute;
  top: 3px; right: 3px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #2BB673;
  border: 2px solid #fff;
}
.pr-chat.is-open .pr-chat-fab { background: var(--ink); border-color: var(--ink); }
.pr-chat.is-open .pr-chat-fab img { filter: none; }
.pr-chat.is-open .pr-chat-dot { display: none; }

/* ---------- panel ---------- */
.pr-chat-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: 356px;
  max-height: min(560px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(16, 16, 20, .22);
  overflow: hidden;
  opacity: 0;
  translate: 0 14px;
  scale: .98;
  pointer-events: none;
  transition: opacity .24s ease, translate .28s cubic-bezier(.2,.7,.2,1), scale .28s cubic-bezier(.2,.7,.2,1);
}
.pr-chat.is-open .pr-chat-panel { opacity: 1; translate: 0 0; scale: 1; pointer-events: auto; }

.pr-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--ink);
  color: #FFFCF4;
}
.pr-chat-ava {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--y);
  flex: none;
}
.pr-chat-ava img { width: 24px; height: 24px; object-fit: contain; }
.pr-chat-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.pr-chat-id strong { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.pr-chat-id span { font-size: 10.5px; color: #A9A59A; }
.pr-chat-x {
  margin-left: auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #FFFCF4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.pr-chat-x:hover { background: rgba(255, 255, 255, .18); }

.pr-chat-log {
  flex: 1;
  min-height: 140px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  background: #FFFCF4;
  scrollbar-width: thin;
}
.pr-msg {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.55;
  animation: pr-msg-in .32s cubic-bezier(.2,.7,.2,1) both;
}
.pr-msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; color: #35322A; }
.pr-msg--me { align-self: flex-end; background: var(--ink); color: #FFFCF4; border-bottom-right-radius: 5px; }
.pr-msg--typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.pr-msg--typing i { width: 5px; height: 5px; border-radius: 50%; background: #B6AF9C; animation: pr-blink 1s infinite; }
.pr-msg--typing i:nth-child(2) { animation-delay: .15s; }
.pr-msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pr-msg-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes pr-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.pr-chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; background: #FFFCF4; }
.pr-quick {
  border: 1px solid #E6DECB;
  background: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: #4A4639;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}
.pr-quick:hover { background: var(--y); border-color: var(--y-deep); }

.pr-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.pr-chat-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1.5px solid #E6DECB;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 12.5px;
  outline: 0;
  background: #FFFCF4;
}
.pr-chat-form input:focus { border-color: var(--y-deep); box-shadow: 0 0 0 3px rgba(255, 212, 0, .25); }
.pr-chat-send {
  width: 40px; height: 40px;
  flex: none;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--y);
  cursor: pointer;
}
.pr-chat-send svg { width: 16px; height: 16px; }
.pr-chat-send:disabled { opacity: .45; cursor: default; }

@media (max-width: 640px) {
  .pr-chat { right: 14px; bottom: 14px; }
  .pr-chat-fab { width: 52px; height: 52px; }
  .pr-chat-fab img { width: 30px; height: 30px; }
  .pr-chat-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 78px;
    width: auto;
    max-height: calc(100dvh - 110px);
    border-radius: 16px;
  }
  .pr-msg { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pr-chat-panel, .pr-msg { transition: none; animation: none; }
}

/* ===========================================================
   Signed-in account chip + dropdown (header)
   Injected by assets/js/auth.js when a session exists.
   =========================================================== */
.acct { position: relative; display: none; }
.acct.is-on { display: block; }

.acct-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 12px 6px;
  background: var(--y);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), translate .18s var(--ease);
}
/* no hard ring on the chip: killing the UA focus outline, keeping a soft
   indicator for keyboard users only */
.acct-btn:focus,
.acct-btn:focus-visible {
  outline: 0;
}
.acct-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(16,16,20,.14);
}
.acct-btn:hover {
  background: rgba(16,16,20,.07);
  translate: 0 -1px;
  box-shadow: 0 8px 18px rgba(16,16,20,.12);
}
.acct.open .acct-btn { background: rgba(16,16,20,.1); }

.acct-ava {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--y);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .03em;
  line-height: 1;
  text-transform: uppercase;
}

.acct-name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 140;
  width: 274px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16,16,20,.2), 0 2px 8px rgba(16,16,20,.06);
  opacity: 0;
  visibility: hidden;
  translate: 0 -6px;
  scale: .98;
  transform-origin: top right;
  transition: opacity .16s var(--ease), translate .16s var(--ease), scale .16s var(--ease), visibility .16s;
}
.acct.open .acct-pop {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  scale: 1;
}

.acct-id {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.acct-id .acct-ava {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 12px;
}
.acct-id-txt { min-width: 0; }
.acct-id-txt strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-id-txt span {
  display: block;
  font-size: 11.5px;
  color: var(--mut);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acct-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  transition: background .15s var(--ease);
}
.acct-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--mut);
  transition: color .15s var(--ease);
}
.acct-item:hover { background: var(--paper-2); }
.acct-item:hover svg { color: var(--ink); }

.acct-sep {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}

.acct-out {
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
  color: #8C1D18;
  cursor: pointer;
  font: inherit;
}
.acct-out svg { color: #8C1D18; }
.acct-out:hover { background: #FDF0EF; }
.acct-out:hover svg { color: #8C1D18; }

@media (max-width: 900px) {
  .acct-btn { padding: 5px 8px 6px; border-radius: 12px; }
  .acct-ava { width: 24px; height: 24px; flex-basis: 24px; font-size: 9.5px; }
  .acct-name { font-size: 10.5px; max-width: 74px; }
  .acct-pop { width: 258px; }
}
