/*
 * WhatsApp chat button (2026-11-26) -- see
 * src/_includes/partials/whatsapp-chat.njk. Loaded by base.njk on every
 * page except those with `hideWhatsApp: true`.
 *
 * Colours are fixed to the AFP palette (forest green #1F3D2B, brass
 * #B08D57, cream) rather than the page's CSS variables, so the button
 * looks the same on the few pages not yet on the Brand Refresh.
 * z-index sits above the sticky header (200).
 */

.wa-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  font-family: var(--font-body, "Open Sans", Helvetica, Arial, sans-serif);
}

.wa-chat__toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 22px 0 16px;
  background: #1F3D2B;
  color: #FAF8F2;
  border: 2px solid #B08D57;
  border-radius: 999px;
  font-family: var(--font-heading, "Asap", Helvetica, Arial, sans-serif);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(31, 61, 43, 0.28);
}
.wa-chat__toggle svg { color: #B08D57; flex-shrink: 0; }
.wa-chat__toggle:hover { background: #2A5039; }
.wa-chat__toggle:focus-visible,
.wa-chat__close:focus-visible,
.wa-chat__start:focus-visible {
  outline: 3px solid #B08D57;
  outline-offset: 3px;
}

.wa-chat__panel {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(31, 61, 43, 0.22);
  overflow: hidden;
  color: #1F3D2B;
}
.wa-chat__panel[hidden] { display: none; }

.wa-chat__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 12px 16px 20px;
  background: #1F3D2B;
  color: #FAF8F2;
}
.wa-chat__avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #B08D57;
  color: #1F3D2B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading, "Asap", Helvetica, Arial, sans-serif);
  font-weight: 700;
  font-size: 15px;
}
.wa-chat__who { flex-grow: 1; min-width: 0; }
.wa-chat__name {
  margin: 0;
  font-family: var(--font-heading, "Asap", Helvetica, Arial, sans-serif);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}
.wa-chat__hours { margin: 2px 0 0; font-size: 13px; color: #E8DFC9; line-height: 1.3; }
.wa-chat__close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: #FAF8F2;
  cursor: pointer;
}

.wa-chat__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: #F7F3EA;
}
.wa-chat__bubble {
  margin: 0;
  max-width: 290px;
  padding: 12px 14px;
  background: #FFFFFF;
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 15px;
  line-height: 1.45;
}
.wa-chat__warning {
  margin: 0;
  padding: 9px 12px;
  background: #EFE6D2;
  border-radius: 8px;
  color: #5A4A2A;
  font-size: 13px;
  line-height: 1.4;
}

.wa-chat__foot { padding: 16px 20px 18px; }
.wa-chat__start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: #1F3D2B;
  color: #FAF8F2 !important;
  border-radius: 8px;
  text-decoration: none !important;
  font-family: var(--font-heading, "Asap", Helvetica, Arial, sans-serif);
  font-size: 16px;
  font-weight: 700;
}
.wa-chat__start svg { color: #B08D57; }
.wa-chat__start:hover { background: #2A5039; }
.wa-chat__note { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: #5E6E64; }

/* Phones: round icon-only button, pop-up nearly full width. */
@media (max-width: 600px) {
  .wa-chat { right: 16px; bottom: 16px; left: 16px; }
  .wa-chat__toggle { width: 58px; height: 58px; padding: 0; justify-content: center; }
  .wa-chat__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .wa-chat__panel { width: 100%; max-width: none; }
  .wa-chat { pointer-events: none; }
  .wa-chat > * { pointer-events: auto; }
}

@media print {
  .wa-chat { display: none; }
}
