/* Help widget (inc/help.php): bubble, greeting nudge, chat-style panel with preset answers and the message form. */

.grc-help { position: fixed; right: 24px; bottom: 24px; z-index: 85; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-size: 14px; transition: bottom .2s ease; }
/* above the phone buy bar while it shows; out of the way while a drawer is open */
body:has(.grc-buybar.is-shown) .grc-help { bottom: calc(88px + env(safe-area-inset-bottom)); }
.grc-drawer-open .grc-help, .store-cart-drawer-open .grc-help { visibility: hidden; }

.grc-help__fab {
  position: relative; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; background: var(--grc-ink); color: #FFFFFF;
  box-shadow: 0 0 0 2px #FFFFFF, 0 10px 28px rgba(11, 13, 18, .28); transition: transform .2s ease, background-color .15s ease; /* white ring: still visible over the black footer */
}
.grc-help__fab::after { content: ""; position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 999px; background: var(--grc-volt); border: 2px solid var(--grc-ink); }
.grc-help__fab:hover { transform: translateY(-2px); background: #2A2E37; }
.grc-help__fab:focus-visible { outline: 3px solid var(--grc-volt); outline-offset: 3px; }
.grc-help__ico-close, .grc-help.is-open .grc-help__ico-chat { display: none; }
.grc-help.is-open .grc-help__ico-close { display: block; }
.grc-help.is-open .grc-help__fab::after { display: none; }

.grc-help__nudge { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border-radius: 999px; background: #FFFFFF; border: 1px solid var(--grc-line); box-shadow: 0 10px 28px rgba(11, 13, 18, .14); animation: grc-help-in .35s cubic-bezier(.2, .7, .2, 1) both; }
.grc-help__nudge[hidden], .grc-help.is-open .grc-help__nudge { display: none; }
.grc-help__nudge-text { padding: 6px 0; border: 0; background: none; font: 600 14px/1.2 var(--wp--preset--font-family--body); color: var(--grc-ink); cursor: pointer; }
.grc-help__nudge-text::after { content: " 👋"; }
.grc-help__nudge-x { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--grc-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.grc-help__nudge-x:hover { background: var(--grc-tile); color: var(--grc-ink); }
.grc-help__nudge-x .grc-ico { width: 16px; height: 16px; }

.grc-help__panel {
  display: flex; flex-direction: column; width: 380px; height: min(620px, calc(100vh - 200px)); /* clear of the sticky header */ overflow: hidden;
  border-radius: 24px; background: #FFFFFF; border: 1px solid var(--grc-line); box-shadow: 0 24px 60px rgba(11, 13, 18, .2);
  transform-origin: bottom right; animation: grc-help-in .25s cubic-bezier(.2, .7, .2, 1) both;
}
.grc-help__panel[hidden] { display: none; }
@keyframes grc-help-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

.grc-help__head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 16px 16px; background: var(--grc-ink); color: #FFFFFF; }
.grc-help__head img { flex: 0 0 40px; border-radius: 12px; }
.grc-help__head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.grc-help__head b { font-family: var(--grc-head); font-size: 17px; letter-spacing: -0.01em; }
.grc-help__head span { font-size: 12px; color: #A9AFBC; }
.grc-help__close { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: none; color: #FFFFFF; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.grc-help__close:hover { background: #262A33; }
.grc-help__close:focus-visible { outline: 2px solid var(--grc-volt); outline-offset: -2px; }

.grc-help__body { position: relative; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: #FAFAFB; }
.grc-help__log { display: flex; flex-direction: column; gap: 10px; }
.grc-help__log[hidden], .grc-help__chips[hidden] { display: none; }
.grc-help__msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; color: var(--grc-body); animation: grc-help-in .25s ease both; }
.grc-help__msg p { margin: 0; }
.grc-help__msg p + p, .grc-help__msg ul + p, .grc-help__msg p + ul { margin-top: 8px; }
.grc-help__msg ul { margin: 0; padding-left: 18px; }
.grc-help__msg a { color: var(--grc-ink); font-weight: 600; }
.grc-help__msg--bot { align-self: flex-start; background: #FFFFFF; border: 1px solid var(--grc-line); border-bottom-left-radius: 6px; }
.grc-help__msg--me { align-self: flex-end; background: var(--grc-ink); color: #FFFFFF; border-bottom-right-radius: 6px; }
.grc-help__msg--typing { display: inline-flex; gap: 4px; padding: 14px; }
.grc-help__msg--typing i { width: 6px; height: 6px; border-radius: 999px; background: #A9AFBC; animation: grc-help-dot 1s infinite ease-in-out; }
.grc-help__msg--typing i:nth-child(2) { animation-delay: .15s; }
.grc-help__msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes grc-help-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.grc-help__inline { margin-top: 10px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--grc-ink); background: #FFFFFF; font: 600 13px/1 var(--wp--preset--font-family--body); color: var(--grc-ink); cursor: pointer; }
.grc-help__inline:hover { background: var(--grc-ink); color: #FFFFFF; }

.grc-help__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.grc-help__chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid #DADDE3; background: #FFFFFF; font: 600 13px/1.25 var(--wp--preset--font-family--body); color: var(--grc-ink); text-align: left; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
.grc-help__chip:hover { border-color: var(--grc-ink); }
.grc-help__chip:focus-visible, .grc-help__inline:focus-visible, .grc-help__back:focus-visible { outline: 2px solid var(--grc-ink); outline-offset: 2px; }

.grc-help__form { display: flex; flex-direction: column; gap: 12px; }
.grc-help__form[hidden] { display: none; }
.grc-help__lead { margin: 0; line-height: 1.5; color: var(--grc-body); }
.grc-help__form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--grc-ink); }
.grc-help__form label span { font-weight: 400; color: var(--grc-muted); }
.grc-help__form input, .grc-help__form textarea, .grc-help__form select {
  box-sizing: border-box; width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid #DADDE3; background: #FFFFFF;
  font: 400 16px/1.4 var(--wp--preset--font-family--body); color: var(--grc-ink);
}
.grc-help__form textarea { resize: vertical; min-height: 96px; }
.grc-help__form input:focus, .grc-help__form textarea:focus, .grc-help__form select:focus { outline: none; border-color: var(--grc-ink); box-shadow: 0 0 0 3px rgba(11, 13, 18, .08); }
.grc-help__form [aria-invalid="true"] { border-color: #C4320A; }
.grc-help__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.grc-help__error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FEF3F2; color: #B42318; font-size: 13px; }
.grc-help__error[hidden] { display: none; }
.grc-help__form .grc-btn { min-height: 48px; width: 100%; }
.grc-help__form .grc-btn[disabled] { opacity: .6; cursor: wait; }
.grc-help__fine { margin: 0; font-size: 12px; color: var(--grc-muted); }
.grc-help__fine a { color: inherit; }
.grc-help__back { align-self: flex-start; min-height: 40px; padding: 0; border: 0; background: none; font: 600 13px var(--wp--preset--font-family--body); color: var(--grc-ink); cursor: pointer; }

.grc-help__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--grc-line); background: #FFFFFF; }
.grc-help__foot .grc-btn { min-height: 44px; padding: 0 18px; font-size: 14px; }
.grc-help.is-form .grc-help__foot .grc-btn { visibility: hidden; }
.grc-help__call { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; font-size: 13px; color: var(--grc-ink); text-decoration: none; white-space: nowrap; }
.grc-help__call .grc-ico { width: 18px; height: 18px; }

@media (max-width: 689px) {
  .grc-help { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); }
  .grc-help__fab { width: 54px; height: 54px; }
  .grc-help.is-open, body:has(.grc-buybar.is-shown) .grc-help.is-open { left: 0; right: 0; bottom: 0; top: 0; gap: 0; z-index: 100; } /* full screen, over the buy bar */
  .grc-help.is-open .grc-help__fab { display: none; }
  .grc-help__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
  .grc-help__nudge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .grc-help__panel, .grc-help__nudge, .grc-help__msg { animation: none; }
  .grc-help__msg--typing i { animation: none; opacity: .6; }
}
