/* ============================================================
   widgets.css — the contact layer, on every page.

   Network layout law: direct-text channels bottom-LEFT,
   live chat bottom-RIGHT. They never stack.

   Avatar art direction for this site is deliberately unlike its
   siblings' clipped circles: SQUARE frames with the hard offset
   shadow this site already uses everywhere. Same grammar as the
   decks and buttons, so the widget belongs to the page.
   ============================================================ */

.wx { position: fixed; z-index: 90; }
.wx button, .wx a { font-family: var(--text, sans-serif); }

/* ---------- bottom-left: direct text channels ---------- */

.wx-left { left: clamp(.75rem, 2.5vw, 1.5rem); bottom: clamp(.75rem, 2.5vw, 1.5rem); display: grid; gap: .55rem; }
.wx-left a {
  display: flex; align-items: center; gap: .6rem; text-decoration: none;
  min-height: 48px; padding: .6rem .95rem .6rem .7rem;
  font-weight: 700; font-size: .92rem; color: #fff;
  border: 2px solid var(--black, #0F0D08);
  box-shadow: 4px 4px 0 var(--black, #0F0D08);
  transition: transform .14s ease, box-shadow .14s ease;
}
.wx-left a:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--black, #0F0D08); }
.wx-wa { background: #1FA855; }
.wx-sms { background: #2B6CB0; }
.wx-left svg { width: 20px; height: 20px; flex: none; }

/* ---------- bottom-right: the chat launcher ---------- */

.wx-right { right: clamp(.75rem, 2.5vw, 1.5rem); bottom: clamp(.75rem, 2.5vw, 1.5rem); }

.wx-fab {
  display: flex; align-items: center; gap: .7rem; cursor: pointer;
  background: var(--paper, #fff); border: 2px solid var(--black, #0F0D08);
  box-shadow: 5px 5px 0 var(--gold, #C9A24B);
  padding: .5rem 1rem .5rem .5rem; min-height: 56px;
  transition: transform .14s ease, box-shadow .14s ease;
}
.wx-fab:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--gold, #C9A24B); }
.wx-fab img, .wx-fab svg { width: 40px; height: 40px; flex: none; display: block; }
.wx-fab span { display: grid; text-align: left; }
.wx-fab b { font-family: var(--disp, sans-serif); font-weight: 800; font-size: .92rem; letter-spacing: -.02em; color: var(--ink, #17140D); }
.wx-fab i { font-style: normal; font-size: .78rem; color: var(--quiet, #6B6350); }
.wx-dot { width: 8px; height: 8px; background: #1FA855; border-radius: 50%; display: inline-block; margin-right: .32rem; }

/* the proactive nudge that appears above the launcher */
.wx-nudge {
  position: absolute; right: 0; bottom: calc(100% + .6rem); width: min(19rem, calc(100vw - 2rem));
  background: var(--paper, #fff); border: 2px solid var(--black, #0F0D08);
  box-shadow: 5px 5px 0 var(--black, #0F0D08); padding: .95rem 1.1rem; text-align: left;
}
.wx-nudge p { font-size: .92rem; line-height: 1.45; color: var(--ink, #17140D); margin: 0; }
.wx-nudge button {
  position: absolute; top: -.7rem; right: -.7rem; width: 1.6rem; height: 1.6rem; line-height: 1;
  background: var(--black, #0F0D08); color: #fff; border: 0; cursor: pointer; font-size: .95rem;
}
.wx-nudge[hidden] { display: none; }

/* ---------- the chat panel ---------- */

.wx-panel {
  position: fixed; right: clamp(.75rem, 2.5vw, 1.5rem); bottom: clamp(.75rem, 2.5vw, 1.5rem);
  z-index: 95; width: min(23rem, calc(100vw - 1.5rem));
  height: clamp(460px, 72vh, 580px);
  background: var(--paper, #fff); border: 3px solid var(--black, #0F0D08);
  box-shadow: 8px 8px 0 var(--gold, #C9A24B);
  display: none; grid-template-rows: auto 1fr auto;
}
.wx-panel[data-open="1"] { display: grid; }

.wx-head { background: var(--black, #0F0D08); color: var(--ivory, #FAF6ED); padding: .85rem 1rem; display: flex; align-items: center; gap: .7rem; }
.wx-head svg { width: 38px; height: 38px; flex: none; }
.wx-head div { display: grid; flex: 1; }
.wx-head b { font-family: var(--disp, sans-serif); font-weight: 800; font-size: .95rem; letter-spacing: -.02em; }
.wx-head span { font-size: .78rem; opacity: .78; }
.wx-head button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: .3rem; min-width: 44px; min-height: 44px; }

.wx-log { overflow-y: auto; padding: 1rem; display: grid; gap: .7rem; align-content: start; background: var(--ivory, #FAF6ED); }
.wx-msg { max-width: 85%; padding: .65rem .85rem; font-size: .93rem; line-height: 1.45; border: 1.5px solid var(--line-2, #CFC4A5); }
.wx-msg.them { background: var(--paper, #fff); justify-self: start; }
.wx-msg.me { background: var(--gold-soft, #F4E9CE); justify-self: end; border-color: var(--gold-deep, #A87F2A); }
.wx-note { font-size: .78rem; color: var(--quiet, #6B6350); text-align: center; }

.wx-compose { display: flex; gap: .4rem; padding: .65rem; border-top: 2px solid var(--black, #0F0D08); background: var(--paper, #fff); }
.wx-compose input {
  flex: 1; font-family: var(--text, sans-serif); font-size: 16px; /* under 16px iOS zooms the page */
  padding: .7rem .8rem; border: 1.5px solid var(--line-2, #CFC4A5); background: var(--ivory, #FAF6ED); color: var(--ink, #17140D);
}
.wx-compose button {
  font-family: var(--disp, sans-serif); font-weight: 800; font-size: .9rem;
  background: var(--black, #0F0D08); color: var(--ivory, #FAF6ED); border: 0; padding: 0 1.1rem; min-height: 44px; cursor: pointer;
}

/* ---------- the seasonal prompt: a centre modal, never a corner toast ---------- */

.wx-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(15,13,8,.6); display: none; place-items: center; padding: 1rem; }
.wx-scrim[data-open="1"] { display: grid; }

.wx-modal {
  width: min(30rem, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--paper, #fff); border: 3px solid var(--black, #0F0D08);
  box-shadow: 10px 10px 0 var(--gold, #C9A24B); padding: clamp(1.4rem, 4vw, 2.1rem); position: relative;
}
.wx-modal h2 { font-family: var(--disp, sans-serif); font-weight: 900; font-size: clamp(1.4rem, 4vw, 1.9rem); letter-spacing: -.038em; margin: 0 0 .7rem; color: var(--ink, #17140D); }
.wx-modal > p { font-size: 1rem; line-height: 1.55; color: var(--body, #3B362A); margin: 0 0 1.1rem; }
.wx-modal form { display: grid; gap: .7rem; }
.wx-modal label { font-size: .86rem; font-weight: 600; color: var(--body, #3B362A); display: grid; gap: .25rem; }
.wx-modal input {
  font-family: var(--text, sans-serif); font-size: 16px; padding: .75rem .85rem;
  border: 1.5px solid var(--line-2, #CFC4A5); background: var(--ivory, #FAF6ED); color: var(--ink, #17140D); width: 100%;
}
.wx-modal .wx-go {
  font-family: var(--disp, sans-serif); font-weight: 800; font-size: 1rem; min-height: 50px;
  background: var(--black, #0F0D08); color: var(--ivory, #FAF6ED); border: 0; cursor: pointer;
  box-shadow: 5px 5px 0 var(--gold, #C9A24B); transition: transform .14s ease, box-shadow .14s ease;
}
.wx-modal .wx-go:hover { transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--gold, #C9A24B); }
.wx-modal small { font-size: .8rem; color: var(--quiet, #6B6350); line-height: 1.45; }
.wx-close {
  position: absolute; top: -.9rem; right: -.9rem; width: 2.2rem; height: 2.2rem;
  background: var(--black, #0F0D08); color: #fff; border: 2px solid var(--paper, #fff); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.wx-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- mobile: chat takes the screen, everything else stands down ---------- */

@media (max-width: 640px) {
  .wx-fab span { display: none; }
  .wx-fab { padding: .45rem; }
  .wx-left a span { display: none; }
  .wx-left a { padding: .6rem; justify-content: center; width: 48px; }

  .wx-panel[data-open="1"] {
    inset: 0; width: 100%; height: 100%; max-height: none;
    border: 0; box-shadow: none;
    grid-template-rows: auto 1fr auto;
  }
  body[data-chat="open"] .wx-left,
  body[data-chat="open"] .wx-right { display: none; }
  .wx-compose { padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { .wx * { transition: none !important; } }
