/* Medora Support: the chat button and window. */
.mch { --mch-c: #0ea5b7; --mch-up: 0px; position: fixed; bottom: calc(20px + var(--mch-up)); z-index: 99990; font-family: inherit; color: #0f172a; line-height: 1.6; text-align: start; }
/* The theme's own spacing of sections, forms and paragraphs stays out of the chat. */
.mch .mch-win, .mch .mch-head, .mch .mch-list, .mch .mch-form, .mch .mch-foot, .mch .mch-typing { margin: 0; min-height: 0; box-shadow: none; }
.mch .mch-win { padding: 0; max-width: none; }
.mch .mch-head { padding: 16px 16px 14px; }
.mch .mch-list { padding: 16px 14px; }
.mch .mch-form { padding: 10px; border-radius: 0; }
.mch .mch-foot { padding: 0 12px 8px; }
.mch .mch-win { box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06); }
.mch--left { left: 20px; }
.mch--right { right: 20px; }
.mch *, .mch *::before, .mch *::after { box-sizing: border-box; }
.mch-fab { position: relative; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--mch-c); color: #fff; cursor: pointer; box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--mch-c) 70%, transparent), 0 4px 10px rgba(15, 23, 42, .15); transition: transform .2s; }
.mch-fab:hover { transform: scale(1.06); }
.mch-fab svg { width: 28px; height: 28px; }
.mch.is-open .mch-fab { transform: scale(.9); }
.mch-badge { position: absolute; top: -2px; inset-inline-end: -2px; min-width: 22px; height: 22px; padding: 0 6px; border: 2px solid #fff; border-radius: 999px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
.mch-badge[hidden] { display: none; }
.mch-bubble { position: absolute; bottom: 72px; width: max-content; max-width: min(270px, calc(100vw - 40px)); padding: 12px 34px 12px 14px; padding-inline: 14px 34px; border: 0; border-radius: 16px; background: #fff; color: #0f172a; font: inherit; font-size: 13.5px; line-height: 1.7; text-align: start; cursor: pointer; box-shadow: 0 16px 36px -12px rgba(15, 23, 42, .4), 0 0 0 1px rgba(15, 23, 42, .06); animation: mchIn .3s ease; }
.mch--left .mch-bubble { left: 0; }
.mch--right .mch-bubble { right: 0; }
.mch-bubble__x { position: absolute; top: 6px; inset-inline-end: 8px; width: 22px; height: 22px; border-radius: 50%; color: #94a3b8; font-size: 18px; line-height: 22px; text-align: center; }
.mch-bubble__x:hover { background: #f1f5f9; color: #0f172a; }
.mch.is-open .mch-bubble { display: none; }

.mch-win { position: absolute; bottom: 76px; display: flex; flex-direction: column; width: 380px; height: min(620px, calc(100vh - 130px - var(--mch-up))); height: min(620px, calc(100dvh - 130px - var(--mch-up))); border-radius: 22px; background: #fff; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(15, 23, 42, .06); overflow: hidden; animation: mchIn .22s ease; }
.mch--left .mch-win { left: 0; }
.mch--right .mch-win { right: 0; }
.mch-win[hidden] { display: none; }
.mch-win.is-drop { outline: 3px dashed var(--mch-c); outline-offset: -6px; }
@keyframes mchIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.mch-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; background: linear-gradient(135deg, var(--mch-c), color-mix(in srgb, var(--mch-c) 60%, #0f172a)); color: #fff; }
.mch-ava { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.mch-ava svg { width: 22px; height: 22px; }
.mch-ava::after { content: ""; position: absolute; bottom: 1px; inset-inline-end: 1px; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: #94a3b8; }
.mch.is-online .mch-ava::after { background: #22c55e; }
.mch-head__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.mch-head__t strong { font-size: 16px; }
.mch-head__t small { opacity: .85; font-size: 12.5px; }
.mch-new { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
.mch-new svg { width: 18px; height: 18px; }
.mch-new:hover, .mch-x:hover { background: rgba(255, 255, 255, .28); }
.mch-x { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
.mch-x svg { width: 18px; height: 18px; }

.mch-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 14px; background: #f8fafc; scroll-behavior: smooth; }
.mch-msg { display: flex; flex-direction: column; gap: 6px; max-width: 88%; align-self: flex-start; }
.mch-msg--customer { align-self: flex-end; align-items: flex-end; }
.mch-msg--system { align-self: center; max-width: 94%; align-items: center; }
.mch-name { font-size: 11.5px; color: #64748b; font-weight: 600; padding-inline-start: 4px; }
.mch-bub { padding: 10px 13px; border-radius: 16px; border-start-start-radius: 6px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); font-size: 14px; line-height: 1.75; word-break: break-word; }
.mch-msg--customer .mch-bub { border-radius: 16px; border-start-end-radius: 6px; background: var(--mch-c); color: #fff; }
.mch-msg--customer .mch-bub a { color: #fff; }
.mch-msg--system .mch-bub { background: #eef2ff; color: #3730a3; font-size: 13px; text-align: center; border-radius: 12px; }
.mch-msg.is-tmp { opacity: .7; }
.mch-img { display: block; max-width: 200px; max-height: 200px; border-radius: 14px; border: 1px solid #e2e8f0; object-fit: cover; }

.mch-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; min-width: 280px; }
.mch-card { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.mch-card a { display: flex; flex-direction: column; gap: 6px; color: #0f172a; text-decoration: none; }
.mch-card img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px; background: #f8fafc; }
.mch-pn { font-size: 12.5px; font-weight: 600; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mch-pr { font-size: 13px; font-weight: 700; color: var(--mch-c); }
.mch-pr del { color: #94a3b8; font-weight: 400; font-size: 11.5px; }
.mch-out { font-size: 12px; color: #b91c1c; font-weight: 600; }
.mch-buy { margin-top: 2px; padding: 7px 8px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--mch-c) 12%, #fff); color: color-mix(in srgb, var(--mch-c) 80%, #0f172a); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mch-buy:hover { background: var(--mch-c); color: #fff; }

.mch-order { display: flex; flex-direction: column; gap: 4px; min-width: 260px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; font-size: 13px; line-height: 1.7; }
.mch-order strong { font-size: 16px; }
.mch-order ul { margin: 2px 0; padding-inline-start: 18px; color: #475569; }
.mch-order code { padding: 1px 6px; border-radius: 6px; background: #f1f5f9; }
.mch-btn { display: inline-flex; align-items: center; justify-content: center; margin-top: 6px; padding: 9px 14px; border: 0; border-radius: 12px; background: var(--mch-c); color: #fff !important; font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.mch-btn:hover { filter: brightness(.95); }
.mch-btn:disabled { opacity: .6; }
.mch-btn--big { width: 100%; padding: 12px; font-size: 15px; }

.mch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mch-chip { padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--mch-c) 40%, #fff); border-radius: 999px; background: #fff; color: color-mix(in srgb, var(--mch-c) 85%, #0f172a); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.mch-chip:hover { background: var(--mch-c); color: #fff; }

.mch-f { display: grid; gap: 7px; min-width: 270px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.mch-f input, .mch-f select, .mch-f textarea { width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 10px; background: #f8fafc; font: inherit; font-size: 14px; }
.mch-f input:focus, .mch-f select:focus, .mch-f textarea:focus { border-color: var(--mch-c); background: #fff; outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--mch-c) 18%, transparent); }

.mch-f__t { font-size: 14px; }
.mch-qi { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--mch-c) 8%, #fff); font-size: 13px; font-weight: 600; }
.mch-qi span { flex: 1; }
.mch-qi input { width: 74px; min-height: 34px; text-align: center; }
.mch-tx { display: inline-flex; gap: 4px; align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11.5px; }
.mch-rate { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; color: #475569; }
.mch-rate div { display: flex; flex-direction: row-reverse; }
.mch-rate button { padding: 0 2px; border: 0; background: none; color: #cbd5e1; font-size: 28px; line-height: 1; cursor: pointer; }
.mch-rate button:hover, .mch-rate button:hover ~ button { color: #f59e0b; }

.mch-typing { display: flex; gap: 4px; padding: 0 22px 8px; background: #f8fafc; }
.mch-typing[hidden] { display: none; }
.mch-typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: mchDot 1.2s infinite; }
.mch-typing span:nth-child(2) { animation-delay: .15s; }
.mch-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mchDot { 30% { transform: translateY(-5px); background: var(--mch-c); } }

.mch-form { display: flex; align-items: flex-end; gap: 4px; padding: 10px; border-top: 1px solid #e2e8f0; background: #fff; }
.mch-input { flex: 1; min-height: 42px; max-height: 110px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; font: inherit; font-size: 14px; line-height: 1.5; resize: none; }
.mch-input:focus { border-color: var(--mch-c); background: #fff; outline: 0; }
.mch-tool, .mch-send { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 42px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: #64748b; cursor: pointer; }
.mch-tool:hover { background: #f1f5f9; color: var(--mch-c); }
.mch-tool svg, .mch-send svg { width: 20px; height: 20px; }
.mch-send { background: var(--mch-c); color: #fff; }
.mch-mic.is-on { background: #fee2e2; color: #dc2626; animation: mchPulse 1.2s infinite; }
@keyframes mchPulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .15); } }
.mch-foot { margin: 0; padding: 0 12px 8px; background: #fff; color: #94a3b8; font-size: 11px; text-align: center; }

@media (max-width: 480px) {
	.mch { bottom: calc(14px + var(--mch-up)); }
	.mch--left { left: 14px; }
	.mch--right { right: 14px; }
	.mch-fab { width: 54px; height: 54px; }
	/* A floating window over the page (not a whole page), above the button. */
	.mch .mch-win { position: fixed; bottom: calc(80px + var(--mch-up)); width: calc(100vw - 24px); height: min(560px, calc(100dvh - 120px - var(--mch-up))); border-radius: 20px; }
	.mch--left .mch-win { left: 12px; }
	.mch--right .mch-win { right: 12px; }
	.mch-cards { min-width: 0; }
	.mch-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .mch-win, .mch-typing span, .mch-mic.is-on { animation: none; } }

.mch-foot a { color: inherit; text-decoration: underline; }

/* WhatsApp, from the button of the same plugin. */
.mch-chip[data-do="wa"] { border-color: #25d366; color: #128c7e; }
.mch-chip[data-do="wa"]:hover { background: #25d366; color: #fff; }
/* One button for the chat and WhatsApp: the chat opens from the WhatsApp card. */
body.mwab-merged .mch-fab { display: none !important; }

/* "End the chat". */
.mch-end { height: 30px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background .15s; }
.mch-end:hover { background: rgba(255, 255, 255, .26); }
.mch-end[hidden] { display: none; }
.mch-endq { align-self: center; width: min(100%, 320px); margin: 4px 0; padding: 14px; border-radius: 16px; background: #fff; box-shadow: 0 10px 28px -14px rgba(15, 23, 42, .45); text-align: center; animation: mch-endq-in .2s ease-out; }
.mch-endq p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
.mch-endq div { display: flex; justify-content: center; gap: 8px; }
.mch-btn--ghost { background: #fff !important; color: var(--mch-c) !important; border: 1px solid color-mix(in srgb, var(--mch-c) 45%, #fff) !important; }
@keyframes mch-endq-in { from { opacity: 0; transform: translateY(6px); } }

.mch-file-link { display: inline-block; margin: 4px 0; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .7); color: inherit; font-weight: 700; font-size: 13px; text-decoration: none; }

/* Voice notes. */
.mch-voice audio { display: block; width: 230px; max-width: 100%; height: 40px; }
.mch-form .mch-recbar { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; }
.mch-form .mch-recbar[hidden], .mch-form.is-rec > :not(.mch-recbar):not(input) { display: none; }
.mch-recbar i { width: 11px; height: 11px; border-radius: 50%; background: #dc2626; animation: mch-blink 1s ease-in-out infinite; }
.mch-recbar b { font-variant-numeric: tabular-nums; min-width: 40px; }
.mch-recbar__x { margin-inline-start: auto; border: 0; background: none; color: #64748b; font-weight: 700; cursor: pointer; padding: 8px; }
.mch-recbar__send { border: 0; border-radius: 999px; padding: 9px 16px; background: var(--mch-c, #0ea5a4); color: #fff; font-weight: 800; cursor: pointer; }
@keyframes mch-blink { 50% { opacity: .35; } }
