/* Happy Day chat widget — matches the happy-day theme (navy / pink, asymmetric corners, offset pink shadow). */
.hdc-root {
  --hdc-navy: #253d78;
  --hdc-pink: #f17ca4;
  --hdc-rose: #fff3f6;
  --hdc-ink: #26314b;
  --hdc-muted: #68718a;
  --hdc-line: #f5c9d8;
  --hdc-grad: linear-gradient(135deg, #253f7c 0%, #4a407b 60%, #76497d 100%);
  --hdc-serif: Georgia, "Times New Roman", serif;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--hdc-ink);
  position: fixed;
  bottom: 28px;
  z-index: 99998;
}
.hdc-root { right: 28px; }                        /* default: bottom right */
.hdc-root.hdc-left { left: 28px; right: auto; }
.hdc-root.hdc-right { right: 28px; }
.hdc-root *, .hdc-root *::before, .hdc-root *::after { box-sizing: border-box; }

/* ---------- Launcher (same family as .hd-floating-cart) ---------- */
.hdc-launcher {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px;
  min-height: 66px; padding: 10px 20px 10px 10px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px 34px 18px 18px;
  background: var(--hdc-grad); color: #fff;
  box-shadow: 8px 9px 0 rgba(241,124,164,.72), 0 20px 45px rgba(27,37,79,.25);
  cursor: pointer; text-align: left; font: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: hdc-arrive .35s ease both;
}
.hdc-launcher:hover { transform: translateY(-3px); box-shadow: 9px 12px 0 rgba(241,124,164,.82), 0 25px 52px rgba(27,37,79,.31); }
.hdc-launcher:active { transform: translateY(0) scale(.98); }
.hdc-launcher-icon {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.14); display: grid; place-items: center;
}
.hdc-launcher-icon svg { width: 24px; height: 24px; }
.hdc-launcher-text strong { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.hdc-launcher-text small { display: block; font-size: 12px; opacity: .8; line-height: 1.3; margin-top: 2px; }
.hdc-root.hdc-open .hdc-launcher { display: none; }

/* ---------- Panel (same family as the mini-cart) ---------- */
.hdc-panel {
  position: absolute; bottom: 0;
  width: min(390px, calc(100vw - 36px)); height: 600px; max-height: calc(100vh - 60px);
  background: #fff;
  border: 1px solid rgba(37,61,120,.09);
  border-radius: 22px 58px 22px 22px;
  box-shadow: 11px 13px 0 rgba(241,124,164,.2), 0 30px 75px rgba(24,34,76,.26);
  overflow: hidden;
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(14px) scale(.98); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.hdc-left .hdc-panel { left: 0; transform-origin: bottom left; }
.hdc-right .hdc-panel { right: 0; transform-origin: bottom right; }
.hdc-root.hdc-open .hdc-panel { opacity: 1; transform: none; pointer-events: auto; }

.hdc-header {
  background: var(--hdc-grad); color: #fff;
  padding: 18px 22px 18px 18px; display: flex; align-items: center; gap: 12px;
  position: relative;
}
.hdc-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--hdc-pink); color: #fff;
  display: grid; place-items: center;
  font-family: var(--hdc-serif); font-weight: 700; font-size: 20px;
  box-shadow: 0 0 0 3px rgba(255,255,255,.22);
  flex: none; position: relative;
}
.hdc-avatar::after {
  content: ""; position: absolute; right: 0; bottom: 1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #4ade80; border: 2px solid #3a3f7b;
}
.hdc-title { font-family: var(--hdc-serif); font-size: 19px; font-weight: 700; line-height: 1.2; }
.hdc-subtitle { font-size: 12px; opacity: .8; }
.hdc-close {
  margin-left: auto; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.14); border: 0; color: #fff; cursor: pointer;
  font-size: 20px; line-height: 1; display: grid; place-items: center;
  transition: background .2s;
}
.hdc-close:hover { background: rgba(255,255,255,.26); }

.hdc-messages {
  flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px;
  background: #fff;
}
.hdc-msg {
  max-width: 86%; padding: 10px 14px; word-wrap: break-word;
  animation: hdc-in .22s ease;
}
.hdc-msg p { margin: 0 0 6px; } .hdc-msg p:last-child { margin: 0; }
.hdc-msg ul, .hdc-msg ol { margin: 4px 0 6px; padding-left: 20px; }
.hdc-msg strong { color: var(--hdc-navy); }
.hdc-msg a { color: var(--hdc-pink); font-weight: 700; text-decoration: underline; }
.hdc-bot {
  align-self: flex-start;
  background: var(--hdc-rose); border: 1px solid var(--hdc-line);
  border-radius: 6px 18px 18px 18px;
}
.hdc-user {
  align-self: flex-end;
  background: var(--hdc-navy); color: #fff;
  border-radius: 18px 6px 18px 18px;
}
.hdc-user strong, .hdc-user a { color: #fff; }
.hdc-error { align-self: center; color: #b4234f; font-size: 13px; text-align: center; max-width: 100%; }

.hdc-typing { display: inline-flex; gap: 5px; padding: 13px 16px; }
.hdc-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--hdc-pink);
  animation: hdc-blink 1.2s infinite ease-in-out;
}
.hdc-typing span:nth-child(2) { animation-delay: .15s; }
.hdc-typing span:nth-child(3) { animation-delay: .3s; }

.hdc-form {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 14px 14px; border-top: 1px solid #f5e7ec; background: #fff;
}
.hdc-input {
  flex: 1; resize: none; border: 1px solid var(--hdc-line); border-radius: 14px;
  padding: 10px 14px; font: inherit; color: var(--hdc-ink); background: #fff;
  max-height: 110px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.hdc-input::placeholder { color: var(--hdc-muted); }
.hdc-input:focus { border-color: var(--hdc-pink); box-shadow: 0 0 0 3px rgba(241,124,164,.15); }
.hdc-send {
  height: 44px; border: 0; border-radius: 5px; background: var(--hdc-pink); color: #fff;
  padding: 0 18px; cursor: pointer; font: inherit; font-weight: 800;
  transition: transform .2s, box-shadow .2s;
}
.hdc-send:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(241,124,164,.3); }
.hdc-send:disabled { opacity: .5; cursor: default; }

@keyframes hdc-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes hdc-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes hdc-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Mobile: compact square launcher (like the cart on mobile), fullscreen panel */
@media (max-width: 600px) {
  .hdc-root { bottom: 18px; }
  .hdc-root, .hdc-root.hdc-right { right: 17px; }
  .hdc-root.hdc-left { left: 17px; right: auto; }
  .hdc-launcher {
    grid-template-columns: 1fr; width: 60px; min-height: 60px; padding: 7px;
    border-radius: 17px 27px 17px 17px;
    box-shadow: 6px 7px 0 rgba(241,124,164,.74), 0 16px 34px rgba(27,37,79,.26);
  }
  .hdc-launcher-text { display: none; }
  /* Full screen. Height follows the part of the screen above the keyboard (set by widget.js from
     visualViewport); 100dvh is the fallback. */
  .hdc-panel {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto;
    width: 100%; height: 100vh; height: 100dvh; height: var(--hdc-vh, 100dvh); max-height: none;
    border-radius: 0; border: 0; box-shadow: none;
  }
  .hdc-root.hdc-open .hdc-panel { transform: none; }
  .hdc-header { padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: 14px; flex: none; }
  .hdc-messages { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .hdc-form { flex: none; padding-bottom: 10px; }
  .hdc-legal { flex: none; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* 16px+ text in the input: otherwise iPhone zooms the whole page in when you tap it */
  .hdc-root .hdc-input { font-size: 16px !important; min-width: 0; }
  .hdc-send { flex: none; padding: 0 16px; }
}
/* While the chat is open on a phone, the page behind it doesn't scroll */
html.hdc-lock, html.hdc-lock body { overflow: hidden !important; overscroll-behavior: none; }
@media (prefers-reduced-motion: reduce) {
  .hdc-panel, .hdc-msg, .hdc-launcher { transition: none; animation: none; }
}

/* ---------- Avatar photo ---------- */
.hdc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hdc-launcher-icon.hdc-has-photo { position: relative; padding: 0; background: none; }
.hdc-launcher-icon.hdc-has-photo img {
  width: 46px; height: 46px; border-radius: 14px; object-fit: cover; display: block;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}
.hdc-launcher-icon.hdc-has-photo::after {
  content: ""; position: absolute; right: -3px; bottom: -3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #4ade80; border: 2px solid #3d4079;
}
@media (max-width: 600px) {
  .hdc-launcher-icon.hdc-has-photo, .hdc-launcher-icon.hdc-has-photo img { width: 100%; height: 100%; }
}

/* ---------- Proactive bubble ("Can I help?") ---------- */
.hdc-nudge {
  position: absolute; bottom: calc(100% + 20px);
  width: 270px; padding: 14px 34px 14px 16px;
  background: #fff; color: var(--hdc-ink);
  border: 1px solid var(--hdc-line);
  box-shadow: 7px 8px 0 rgba(241,124,164,.25), 0 18px 40px rgba(24,34,76,.18);
  cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}
.hdc-right .hdc-nudge { right: 0; border-radius: 18px 18px 6px 18px; transform-origin: bottom right; }
.hdc-left .hdc-nudge { left: 0; border-radius: 18px 18px 18px 6px; transform-origin: bottom left; }
.hdc-nudge.hdc-nudge-show { opacity: 1; transform: none; }
.hdc-nudge:hover { transform: translateY(-2px); }
.hdc-nudge-name { font-family: var(--hdc-serif); font-weight: 700; color: var(--hdc-navy); font-size: 15px; margin-bottom: 2px; }
.hdc-nudge-text { font-size: 14px; line-height: 1.45; min-height: 20px; }
.hdc-nudge-close {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: var(--hdc-rose); color: var(--hdc-muted);
  font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.hdc-nudge-close:hover { background: var(--hdc-line); color: var(--hdc-ink); }
.hdc-root.hdc-open .hdc-nudge { display: none; }
.hdc-typing-inline { padding: 4px 0; animation: none; }

/* Unread badge on the launcher */
.hdc-launcher { position: relative; }
.hdc-badge {
  position: absolute; top: -7px; right: -7px; z-index: 1;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #e11d48; color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center;
  box-shadow: 0 0 0 2px #fff;
  animation: hdc-pop .35s cubic-bezier(.34,1.56,.64,1) both;
}
.hdc-badge[hidden], .hdc-nudge[hidden] { display: none; }
@keyframes hdc-pop { from { transform: scale(0); } to { transform: scale(1); } }

@media (max-width: 600px) {
  .hdc-nudge { width: min(260px, calc(100vw - 40px)); bottom: calc(100% + 16px); }
}
@media (prefers-reduced-motion: reduce) {
  .hdc-nudge, .hdc-badge { transition: none; animation: none; }
}
.hdc-input:disabled { background: var(--hdc-rose); cursor: not-allowed; }

/* ---------- Returning visitors ---------- */
.hdc-divider {
  align-self: center; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--hdc-muted); display: flex; align-items: center; gap: 10px; width: 100%; margin: 4px 0;
}
.hdc-divider::before, .hdc-divider::after { content: ""; flex: 1; height: 1px; background: #f5e7ec; }

/* Consent line under the input */
.hdc-legal { padding: 0 14px 10px; margin-top: -4px; background: #fff; text-align: center; font-size: 11px; color: var(--hdc-muted); }
.hdc-legal a { color: var(--hdc-muted); text-decoration: underline; }
.hdc-legal a:hover { color: var(--hdc-pink); }
.hdc-legal[hidden] { display: none; }
