/* Chat-style enquiry window (inc/chat-widget.php, assets/js/chat-widget.js). Scoped to .qc. */

/* the chat replaces the theme's scroll-to-top arrow in the same corner */
#scrollUp { display: none !important; }

.qc {
	--qc-accent: var(--primaryColor, #2b47f2);
	--qc-ink: #0b1437;
	--qc-muted: #5b6485;
	--qc-line: #dde3f5;
	--qc-tint: #f5f7ff;
	position: fixed; right: 24px; bottom: 24px; z-index: 99990;
	font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--qc-ink);
}
.qc:not(.qc-ready), .qc.is-boot .qc-launcher, .qc.is-boot .qc-window { display: none; }
.qc *, .qc *::before, .qc *::after { box-sizing: border-box; }
.qc h3, .qc p { margin: 0; }
.qc button { -webkit-appearance: none; appearance: none; margin: 0; font-family: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; cursor: pointer; }
.qc svg { display: block; flex: none; }

/* ---------- launcher (shown when minimised) ---------- */
.qc .qc-launcher {
	position: absolute; right: 0; bottom: 0; display: inline-flex; align-items: center; gap: 12px; height: 60px; padding: 0 24px 0 9px;
	border: 0; border-radius: 999px; color: #fff; white-space: nowrap;
	background: linear-gradient(135deg, #1f37d1, var(--qc-accent) 55%, #6f86ff);
	box-shadow: 0 14px 30px -10px rgba(43, 71, 242, .65);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, visibility 0s linear 0s, box-shadow .3s ease;
}
.qc .qc-launcher:hover, .qc .qc-launcher:focus-visible { color: #fff; transform: translateY(-3px); box-shadow: 0 20px 38px -10px rgba(43, 71, 242, .75); background: linear-gradient(135deg, #1f37d1, var(--qc-accent) 55%, #6f86ff); }
.qc .qc-launcher:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.qc-launcher__ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.qc-launcher__txt { font-size: 15px; font-weight: 700; }
.qc-launcher__ping { position: absolute; left: 39px; top: 37px; z-index: 1; width: 14px; height: 14px; border-radius: 50%; background: #34d399; border: 2.5px solid #2c43e6; box-sizing: border-box; }
.qc-launcher__ping::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #34d399; opacity: 0; animation: qc-ping 2.4s ease-out infinite; }
@keyframes qc-ping { 0% { transform: scale(.7); opacity: .85; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
.qc.is-open .qc-launcher { opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.6); transition-delay: 0s, 0s, .3s, 0s; }

/* ---------- window ---------- */
.qc-window {
	position: absolute; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(392px, calc(100vw - 32px)); height: min(590px, calc(100vh - 48px));
	overflow: hidden; border-radius: 26px; background: #fff;
	box-shadow: 0 44px 90px -30px rgba(10, 20, 90, .6), 0 0 0 1px rgba(18, 36, 120, .08);
	transform-origin: bottom right; transition: opacity .35s ease, transform .45s cubic-bezier(.2, .9, .25, 1.05), visibility 0s linear 0s;
}
.qc.is-min .qc-window { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(20px) scale(.9); transition-delay: 0s, 0s, .4s; }

.qc-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; color: #fff; background: linear-gradient(135deg, #1b31c9, var(--qc-accent) 60%, #6f86ff); }
.qc-head::after { content: ""; position: absolute; right: -30px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .12); pointer-events: none; }
.qc-avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; box-shadow: 0 8px 18px -8px rgba(0, 0, 40, .5); }
.qc-avatar img { width: 28px; height: 28px; object-fit: contain; display: block; }
.qc-avatar i { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #34d399; border: 2px solid #fff; }
.qc-head__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; position: relative; z-index: 1; }
.qc-head__txt strong { font-size: 16px; font-weight: 700; line-height: 1.25; color: #fff; }
.qc-head__txt span { font-size: 13px; line-height: 1.3; color: rgba(255, 255, 255, .85); }
.qc .qc-min { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .18); transition: background .2s ease, transform .2s ease; }
.qc .qc-min:hover, .qc .qc-min:focus-visible { color: #fff; background: rgba(255, 255, 255, .32); transform: translateY(2px); }
.qc .qc-min:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.qc-progress { display: flex; gap: 4px; padding: 12px 18px 0; background: var(--qc-tint); }
.qc-progress i { flex: 1; height: 4px; border-radius: 4px; background: #dfe5fb; transition: background .4s ease; }
.qc-progress i.is-done { background: var(--qc-accent); }
.qc-progress i.is-on { background: linear-gradient(90deg, var(--qc-accent) 0 45%, #dfe5fb 45%); }

/* ---------- conversation ---------- */
.qc-body { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 160px; overflow-y: auto; padding: 16px 18px 12px; background: var(--qc-tint); scrollbar-width: thin; }
.qc-msg { display: flex; align-items: flex-end; gap: 8px; animation: qc-pop .38s cubic-bezier(.2, .9, .25, 1.1) both; }
.qc-msg--user { justify-content: flex-end; }
.qc-mini { flex: none; width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--qc-accent), #7d92ff); box-shadow: 0 6px 12px -6px var(--qc-accent); position: relative; }
.qc-mini::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: rgba(255, 255, 255, .92); }
.qc-bubble { max-width: 82%; padding: 11px 15px; font-size: 15px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.qc-msg--bot .qc-bubble { color: var(--qc-ink); background: #fff; border: 1px solid #e3e8f8; border-radius: 18px 18px 18px 6px; box-shadow: 0 8px 18px -16px rgba(18, 36, 120, .5); }
.qc-msg--user .qc-bubble { color: #fff; background: linear-gradient(135deg, #2339d6, var(--qc-accent)); border-radius: 18px 18px 6px 18px; box-shadow: 0 10px 20px -12px var(--qc-accent); }
.qc-bubble a { color: var(--qc-accent); font-weight: 600; text-decoration: underline; }
.qc-typing .qc-bubble { display: inline-flex; gap: 5px; padding: 14px 16px; }
.qc-typing .qc-bubble i { width: 7px; height: 7px; border-radius: 50%; background: #9aa6d9; animation: qc-dot 1.1s ease-in-out infinite; }
.qc-typing .qc-bubble i:nth-child(2) { animation-delay: .15s; }
.qc-typing .qc-bubble i:nth-child(3) { animation-delay: .3s; }
@keyframes qc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes qc-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- answer area ---------- */
.qc-foot { min-height: 96px; padding: 14px 18px 14px; background: #fff; border-top: 1px solid #e8ecf8; }
.qc-foot.is-wait { opacity: .55; pointer-events: none; }
.qc-error { min-height: 18px; margin: 0 0 6px 6px; font-size: 13px; line-height: 1.3; color: #c0262d; }
.qc-field { display: flex; align-items: center; gap: 8px; }
.qc-field--area { flex-direction: column; align-items: stretch; gap: 0; }
.qc .qc-input {
	flex: 1; min-width: 0; height: 52px; margin: 0; padding: 0 20px; font-family: inherit; font-size: 16px; color: var(--qc-ink); background: #f8f9ff;
	border: 1.5px solid var(--qc-line); border-radius: 999px; box-shadow: none; outline: none; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.qc .qc-input::placeholder, .qc .qc-area::placeholder { color: #98a0bf; opacity: 1; }
.qc .qc-input:focus, .qc .qc-area:focus { background: #fff; border-color: var(--qc-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--qc-accent) 16%, transparent); outline: none; }
.qc .qc-go {
	display: inline-flex; align-items: center; justify-content: center; flex: none; width: 52px; height: 52px; padding: 0; color: #fff; border: 0; border-radius: 50%;
	background: linear-gradient(135deg, #2339d6, var(--qc-accent)); box-shadow: 0 12px 22px -10px var(--qc-accent); transition: transform .2s ease, box-shadow .2s ease;
}
.qc .qc-go:hover, .qc .qc-go:focus-visible { color: #fff; transform: translateX(3px); box-shadow: 0 16px 26px -10px var(--qc-accent); background: linear-gradient(135deg, #2339d6, var(--qc-accent)); }
.qc .qc-go:focus-visible, .qc .qc-sendtxt:focus-visible, .qc .qc-retry:focus-visible { outline: 3px solid color-mix(in srgb, var(--qc-accent) 45%, #fff); outline-offset: 2px; }
.qc .qc-area {
	display: block; width: 100%; min-height: 86px; margin: 0; padding: 13px 16px; font-family: inherit; font-size: 16px; line-height: 1.45; color: var(--qc-ink); background: #f8f9ff;
	border: 1.5px solid var(--qc-line); border-radius: 20px; box-shadow: none; outline: none; resize: none; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.qc-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.qc .qc-skip { padding: 10px 6px; font-size: 14px; font-weight: 600; color: var(--qc-muted); background: transparent; border: 0; box-shadow: none; transition: color .2s ease; }
.qc .qc-skip:hover, .qc .qc-skip:focus-visible { color: var(--qc-accent); background: transparent; }
.qc .qc-sendtxt, .qc .qc-retry {
	display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; font-size: 15px; font-weight: 700; line-height: 1.2; color: #fff; border: 0; border-radius: 999px;
	background: linear-gradient(135deg, #2339d6, var(--qc-accent)); box-shadow: 0 14px 26px -12px var(--qc-accent); transition: transform .2s ease, box-shadow .2s ease;
}
.qc .qc-sendtxt:hover, .qc .qc-sendtxt:focus-visible, .qc .qc-retry:hover, .qc .qc-retry:focus-visible { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 30px -12px var(--qc-accent); background: linear-gradient(135deg, #2339d6, var(--qc-accent)); }
.qc .qc-sendtxt svg, .qc .qc-retry svg { width: 18px; height: 18px; transition: transform .2s ease; }
.qc .qc-sendtxt:hover svg, .qc .qc-retry:hover svg { transform: translateX(4px); }
.qc .qc-retry { width: 100%; justify-content: center; }

.qc-field.is-shake { animation: qc-shake .4s ease; }
@keyframes qc-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* service choices */
.qc-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 188px; overflow-y: auto; padding: 2px 2px 6px; scrollbar-width: thin; -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(180deg, #000 calc(100% - 16px), transparent); }
.qc .qc-chip {
	display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 11px; text-align: left; font-size: 13.5px; font-weight: 600; line-height: 1.25; color: var(--qc-ink);
	background: #f8f9ff; border: 1.5px solid var(--qc-line); border-radius: 14px; box-shadow: none; animation: qc-pop .4s cubic-bezier(.2, .9, .25, 1.1) both;
	transition: transform .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.qc .qc-chip:hover, .qc .qc-chip:focus-visible { color: var(--qc-ink); transform: translateY(-2px); border-color: var(--qc-accent); background: color-mix(in srgb, var(--qc-accent) 8%, #fff); }
.qc .qc-chip:focus-visible { outline: 2px solid var(--qc-accent); outline-offset: 1px; }
.qc .qc-chip.is-picked { color: #fff; border-color: var(--qc-accent); background: var(--qc-accent); transform: scale(.97); }
.qc-chip__ic { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; border-radius: 50%; color: var(--qc-accent); background: color-mix(in srgb, var(--qc-accent) 12%, #fff); transition: background .2s ease, color .2s ease; }
.qc-chip__ic svg { width: 15px; height: 15px; }
.qc .qc-chip.is-picked .qc-chip__ic { color: var(--qc-accent); background: #fff; }
.qc-chip__tx { min-width: 0; overflow-wrap: anywhere; }
.qc .qc-chip--other { width: 100%; margin-top: 8px; justify-content: center; background: #fff; border-style: dashed; }

.qc-foot__row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; min-height: 28px; }
.qc .qc-back { display: inline-flex; align-items: center; gap: 4px; padding: 5px 4px; font-size: 13px; font-weight: 600; color: var(--qc-muted); background: transparent; border: 0; box-shadow: none; transition: color .2s ease; }
.qc .qc-back:hover, .qc .qc-back:focus-visible { color: var(--qc-accent); background: transparent; }
.qc-hint { font-size: 12px; color: #98a0bf; }

/* ---------- thank you ---------- */
.qc-done { display: flex; flex-direction: column; align-items: center; margin: auto; padding: 18px 8px; text-align: center; animation: qc-pop .5s cubic-bezier(.2, .9, .25, 1.1) both; }
.qc-done__ring { display: inline-flex; align-items: center; justify-content: center; width: 92px; height: 92px; margin-bottom: 18px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #10b981, #34d399); box-shadow: 0 0 0 10px rgba(16, 185, 129, .14), 0 22px 36px -14px rgba(16, 185, 129, .8); animation: qc-ring .6s cubic-bezier(.2, .9, .25, 1.2) both; }
.qc-tick { stroke-dasharray: 60; stroke-dashoffset: 60; animation: qc-draw .55s .35s ease forwards; }
@keyframes qc-ring { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes qc-draw { to { stroke-dashoffset: 0; } }
.qc-done h3 { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; color: var(--qc-ink); }
.qc-done p { max-width: 280px; margin-top: 10px; font-size: 16px; line-height: 1.55; color: var(--qc-muted); }
.qc-done__chip { display: inline-flex; flex-direction: column; gap: 2px; margin-top: 18px; padding: 10px 18px; border-radius: 16px; background: #fff; border: 1px solid #e3e8f8; }
.qc-done__chip span { font-size: 12px; color: #98a0bf; }
.qc-done__chip strong { font-size: 15px; color: var(--qc-accent); }
.qc .qc-again { width: 100%; padding: 14px 20px; font-size: 15px; font-weight: 700; color: var(--qc-accent); background: #fff; border: 1.5px solid var(--qc-accent); border-radius: 999px; box-shadow: none; transition: background .2s ease, color .2s ease; }
.qc .qc-again:hover, .qc .qc-again:focus-visible { color: #fff; background: var(--qc-accent); }
.qc .qc-again:focus-visible { outline: 3px solid color-mix(in srgb, var(--qc-accent) 40%, #fff); outline-offset: 2px; }

.qc-confetti { position: absolute; left: 50%; top: 42%; z-index: 6; width: 0; height: 0; pointer-events: none; }
.qc-confetti i { position: absolute; width: 8px; height: 13px; border-radius: 2px; opacity: 0; animation: qc-confetti 1.5s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes qc-confetti {
	0% { opacity: 1; transform: translate(0, 0) rotate(0); }
	55% { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
	100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 190px)) rotate(calc(var(--r) * 1.6)); }
}

/* ---------- small screens ---------- */
@media (max-width: 560px) {
	.qc { right: 12px; bottom: 12px; }
	.qc .qc-launcher { height: 58px; padding: 0 9px; }
	.qc-launcher__txt { display: none; }
	.qc-window { width: calc(100vw - 24px); height: min(560px, calc(100vh - 28px)); border-radius: 22px; }
	.qc-chips { max-height: 170px; }
	.qc-hint { display: none; }
}
@media (max-height: 640px) { .qc-body { min-height: 110px; } .qc-chips { max-height: 120px; } }

@media (prefers-reduced-motion: reduce) {
	.qc *, .qc *::before, .qc *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.qc-launcher__ping::after { display: none; }
}

/* WhatsApp shortcut for people who want an answer right away */
.qc-wa { display: flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: 13.5px; line-height: 1.3; color: #0b3d27; background: #e8f9ef; border-bottom: 1px solid #c9efd9; text-decoration: none; transition: background .2s ease; }
.qc-wa:hover, .qc-wa:focus-visible { background: #d6f5e3; color: #0b3d27; }
.qc-wa__ic { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #fff; background: #25d366; }
.qc-wa__ic svg { width: 18px; height: 18px; }
.qc-wa__txt { flex: 1; min-width: 0; }
.qc-wa__txt strong { display: block; font-weight: 700; color: #0b6b3a; }
.qc-wa__go { flex: none; color: #0b6b3a; transition: transform .2s ease; }
.qc-wa:hover .qc-wa__go { transform: translateX(3px); }
.qc-done__wa { display: inline-flex; align-items: center; justify-content: center; margin-top: 16px; padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #fff; background: #25d366; text-decoration: none; }
.qc-done__wa:hover { background: #1fb957; color: #fff; }
