/* Megalodon AI assistant widget */
.mdcai { --a-navy: #0F2A33; --a-deep: #0A1E25; --a-gold: #B8954A; --a-gold-d: #A5843F; --a-cream: #F6F1E9; --a-ink: #1F2A2E; --a-mute: #5E6A6E; --a-line: #E6E2DA; font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif; font-size: 15px; line-height: 1.5; color: var(--a-ink); }
.mdcai *, .mdcai *::before, .mdcai *::after { box-sizing: border-box; }

/* Move the floating WhatsApp button above the chat button */
.mdc-ai-on .mdc-wa { right: 20px !important; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 70px) !important; width: 58px !important; height: 58px !important; z-index: 99988; }
.mdc-ai-on .mdc-wa svg { width: 30px; height: 30px; }
/* Keep the last footer lines clear of the two floating buttons */
.mdc-ai-on .mdc-footer { padding-bottom: 40px; }

/* Launcher */
.mdcai-launch { position: fixed; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 99990; width: 58px; height: 58px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: linear-gradient(145deg, #C9A65A, #A5843F); box-shadow: 0 12px 28px rgba(10, 30, 37, .32), 0 0 0 0 rgba(184, 149, 74, .5); display: flex; align-items: center; justify-content: center; transition: transform .25s ease, box-shadow .25s ease; animation: mdcai-pulse 2.8s ease-out 3s 3; }
.mdcai-launch:hover { transform: scale(1.06); }
.mdcai-launch > svg, .mdcai-launch__x { transition: opacity .2s, transform .25s; }
.mdcai-launch__x { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transform: rotate(-90deg); }
.mdcai.is-open .mdcai-launch > svg { opacity: 0; transform: scale(.6); }
.mdcai.is-open .mdcai-launch__x { opacity: 1; transform: none; }
@keyframes mdcai-pulse { 0% { box-shadow: 0 12px 28px rgba(10, 30, 37, .32), 0 0 0 0 rgba(184, 149, 74, .55); } 70% { box-shadow: 0 12px 28px rgba(10, 30, 37, .32), 0 0 0 18px rgba(184, 149, 74, 0); } 100% { box-shadow: 0 12px 28px rgba(10, 30, 37, .32), 0 0 0 0 rgba(184, 149, 74, 0); } }

/* Teaser */
.mdcai-teaser { position: fixed; right: 90px; bottom: max(30px, calc(env(safe-area-inset-bottom) + 10px)); z-index: 99989; max-width: 250px; background: #fff; color: var(--a-ink); border: 1px solid var(--a-line); border-radius: 14px 14px 4px 14px; padding: 11px 15px; font: 500 14px/1.4 Inter, system-ui, sans-serif; text-align: left; box-shadow: 0 12px 30px rgba(10, 30, 37, .16); cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .35s, transform .35s; }
.mdcai-teaser.is-in { opacity: 1; transform: none; pointer-events: auto; }
.mdcai.is-open .mdcai-teaser { display: none; }

/* Panel */
.mdcai-panel { position: fixed; right: 20px; bottom: 96px; z-index: 99991; width: 392px; height: min(660px, calc(100vh - 130px)); background: #fff; border-radius: 18px; box-shadow: 0 30px 70px rgba(10, 30, 37, .28); display: flex; flex-direction: column; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98); transform-origin: bottom right; transition: opacity .25s ease, transform .25s ease, visibility .25s; }
.mdcai.is-open .mdcai-panel { opacity: 1; visibility: visible; transform: none; }
.admin-bar .mdcai-panel { height: min(660px, calc(100vh - 162px)); }

.mdcai-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; background: var(--a-navy); color: #fff; flex: none; }
.mdcai-head > svg { flex: none; }
.mdcai-head__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mdcai-head__t strong { font-size: 16px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdcai-head__t span { font-size: 12.5px; color: rgba(255, 255, 255, .72); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdcai-head__t i { width: 7px; height: 7px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .25); flex: none; }
.mdcai-icon { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: rgba(255, 255, 255, .85); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: background .2s, color .2s; }
.mdcai-icon:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.mdcai-wa:hover { color: #3DDC84; }

.mdcai-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--a-cream); display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.mdcai-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; animation: mdcai-in .25s ease; }
.mdcai-msg p { margin: 0 0 6px; }
.mdcai-msg p:last-child { margin: 0; }
.mdcai-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.mdcai-msg li { margin: 2px 0; }
.mdcai-msg a { color: inherit; text-decoration: underline; text-decoration-color: var(--a-gold); text-underline-offset: 2px; font-weight: 600; }
.mdcai-msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--a-line); border-bottom-left-radius: 5px; }
.mdcai-msg--user { align-self: flex-end; background: var(--a-navy); color: #fff; border-bottom-right-radius: 5px; }
.mdcai-msg--user a { color: #fff; }
.mdcai-msg.is-error { background: #FCEDEC; border-color: #F3CFCB; color: #8A2A22; }
.mdcai-typing { display: flex; gap: 5px; padding: 14px 16px; }
.mdcai-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--a-gold); opacity: .4; animation: mdcai-dot 1.2s infinite; }
.mdcai-typing span:nth-child(2) { animation-delay: .15s; }
.mdcai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes mdcai-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes mdcai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mdcai-card { align-self: stretch; background: #fff; border: 1px solid #CFE8D7; border-radius: 14px; padding: 14px 16px; box-shadow: 0 6px 16px rgba(10, 30, 37, .06); animation: mdcai-in .3s ease; }
.mdcai-card__h { display: flex; align-items: center; gap: 9px; font-weight: 700; color: #1E6B3A; margin-bottom: 8px; }
.mdcai-tick { width: 24px; height: 24px; border-radius: 50%; background: #2E9E5B; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.mdcai-card dl { margin: 0; }
.mdcai-card dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--a-line); font-size: 13.5px; }
.mdcai-card dt { color: var(--a-mute); }
.mdcai-card dd { margin: 0; text-align: right; font-weight: 600; }
.mdcai-card p { margin: 0; font-size: 13.5px; color: var(--a-mute); }

.mdcai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 12px; background: var(--a-cream); }
.mdcai-chips[hidden] { display: none; }
.mdcai-chip { border: 1px solid var(--a-gold); background: #fff; color: var(--a-navy); border-radius: 999px; padding: 7px 13px; font: 600 13px/1.2 Inter, system-ui, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.mdcai-chip:hover { background: var(--a-gold); color: #fff; }

.mdcai-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--a-line); background: #fff; flex: none; }
.mdcai-form textarea { flex: 1; resize: none; border: 1px solid #DDD6CA; border-radius: 12px; padding: 11px 14px; font: 15px/1.4 Inter, system-ui, sans-serif; color: var(--a-ink); background: #fff; max-height: 120px; min-height: 44px; outline: none; transition: border-color .2s, box-shadow .2s; }
.mdcai-form textarea:focus { border-color: var(--a-gold); box-shadow: 0 0 0 3px rgba(184, 149, 74, .18); }
.mdcai-send { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--a-gold); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .2s; }
.mdcai-send:hover { background: var(--a-gold-d); }
.mdcai-send:disabled { opacity: .5; cursor: wait; }
.mdcai-note { margin: 0; padding: 0 12px 10px; background: #fff; font-size: 11.5px; color: var(--a-mute); text-align: center; flex: none; }

.mdcai.is-rtl .mdcai-panel { direction: rtl; }
.mdcai.is-rtl .mdcai-msg--bot { border-bottom-left-radius: 16px; border-bottom-right-radius: 5px; }
.mdcai.is-rtl .mdcai-msg--user { border-bottom-right-radius: 16px; border-bottom-left-radius: 5px; }
.mdcai.is-rtl .mdcai-send svg { transform: scaleX(-1); }

/* Phones: full screen */
@media (max-width: 680px) {
	.mdcai-lock, .mdcai-lock body { overflow: hidden; }
	.mdcai-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; transform: translateY(30px); }
	.admin-bar .mdcai-panel { height: 100dvh; top: 0; }
	.mdcai-head { padding-top: max(14px, env(safe-area-inset-top)); }
	.mdcai-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
	.mdcai.is-open .mdcai-launch { display: none; }
	.mdcai-launch { width: 56px; height: 56px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
	.mdcai-teaser { right: 84px; bottom: max(24px, calc(env(safe-area-inset-bottom) + 8px)); max-width: 200px; font-size: 13px; }
	.mdcai-msg { max-width: 90%; }
	.mdc-ai-on .mdc-wa { right: 16px !important; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px) !important; width: 56px !important; height: 56px !important; }
	.mdc-ai-on .mdc-wa svg { width: 28px; height: 28px; }
	.mdc-ai-on .mdc-footer { padding-bottom: 150px; }
}
@media (prefers-reduced-motion: reduce) { .mdcai *, .mdcai-launch { animation: none !important; transition: none !important; } }
@media print { .mdcai { display: none; } }

.mdcai-pay { display: block; margin-top: 10px; text-align: center; background: #B8954A; color: #fff !important; border-radius: 8px; padding: 11px 14px; font-weight: 700; font-size: 14px; text-decoration: none !important; }
.mdcai-pay:hover { background: #A5843F; }
.mdcai-msg img, .mdcai-card img { max-width: 100%; }
.mdcai-msg img.emoji, .mdcai-msg img.wp-smiley, .mdcai-card img.emoji { display: inline !important; width: 1.15em !important; height: 1.15em !important; margin: 0 .1em !important; vertical-align: -.2em !important; box-shadow: none !important; border: 0 !important; }
@media (max-width: 680px) {
	/* 16px stops iPhone from zooming into the text box. */
	.mdcai-form textarea { font-size: 16px; }
	.mdcai-panel { bottom: auto; transition: opacity .2s ease, visibility .2s; transform: none !important; }
	html.mdcai-lock, html.mdcai-lock body { overflow: hidden !important; overscroll-behavior: none; }
}

/* 1.7.0 – one floating button: the old separate WhatsApp bubble is folded into a small menu */
.mdc-ai-on .mdc-wa { display: none !important; }
.mdcai-menu { position: fixed; right: 20px; bottom: calc(max(20px, env(safe-area-inset-bottom)) + 72px); z-index: 99991; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.mdcai-menu__item { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; border-radius: 999px; background: #fff; color: #1F2A2E !important; font: 600 15px/1.2 Inter, system-ui, sans-serif; text-decoration: none !important; border: 0; cursor: pointer; box-shadow: 0 10px 28px rgba(10, 30, 37, .2); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .2s ease, transform .25s cubic-bezier(.2, .7, .2, 1); white-space: nowrap; }
.mdcai-menu__item:nth-child(2) { transition-delay: .04s; }
.mdcai-menu__ic { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.mdcai-menu__chat .mdcai-menu__ic { background: linear-gradient(145deg, #C9A65A, #A5843F); }
.mdcai-menu__chat .mdcai-menu__ic svg { width: 20px; height: 20px; }
.mdcai-menu__wa .mdcai-menu__ic { background: #25D366; }
.mdcai-menu__wa .mdcai-menu__ic svg { width: 20px; height: 20px; }
.mdcai.is-menu .mdcai-menu { pointer-events: auto; }
.mdcai.is-menu .mdcai-menu__item { opacity: 1; transform: none; }
.mdcai.is-menu .mdcai-launch > svg { opacity: 0; transform: scale(.6); }
.mdcai.is-menu .mdcai-launch__x { opacity: 1; transform: none; }
.mdcai.is-menu .mdcai-teaser { display: none; }
@media (max-width: 680px) { .mdcai-menu { right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px); } }
@media (prefers-reduced-motion: reduce) { .mdcai-menu__item { transition: none; } }

/* 1.7.4 – phones: while the chat is open, hide the page behind it and paint everything white,
   so nothing shows below the chat or through the see-through iPhone keyboard */
@media (max-width: 680px) {
	html.mdcai-lock, html.mdcai-lock body { background: #fff !important; }
	html.mdcai-lock body > *:not(.mdcai) { visibility: hidden !important; }
	.mdcai.is-open .mdcai-panel { box-shadow: 0 0 0 100vh #fff; }
	.mdcai-form { background: #fff; }
}

/* 1.8.0 – quick-action buttons: one scrollable row above the message box, always available */
.mdcai-chips { flex: none; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 8px; padding: 10px 12px 2px; background: #fff; border-top: 1px solid var(--a-line); }
.mdcai-chips::-webkit-scrollbar { display: none; }
.mdcai-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 14px; border-color: #E2D3B0; background: #FBF8F2; text-decoration: none; }
.mdcai-chip:hover, .mdcai-chip:focus-visible { background: var(--a-gold); border-color: var(--a-gold); color: #fff; }
.mdcai-chip__i { font-size: 15px; line-height: 1; display: inline-flex; }
.mdcai-chip__i img.emoji { width: 15px !important; height: 15px !important; margin: 0 !important; }
.mdcai-chip--wa { border-color: #bfe8cd; background: #effaf3; color: #128C4A; }
.mdcai-chip--wa .mdcai-chip__i svg { width: 16px; height: 16px; }
.mdcai-chip--wa:hover { background: #25D366; border-color: #25D366; color: #fff; }
.mdcai-chips + .mdcai-form { border-top: 0; }

/* 1.9.0 – suggested replies: gold outline so they read as answers to the last message */
.mdcai-chip--s { background: #fff; border-color: var(--a-gold); color: var(--a-navy); }
.mdcai-chips.is-suggest { animation: mdcaiChipsIn .25s ease-out; }
@keyframes mdcaiChipsIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 1.9.1 – "New chat" is a visible gold pill with a label, not just an icon */
.mdcai-icon.mdcai-reset { width: auto; height: 34px; padding: 0 12px 0 10px; gap: 6px; border-radius: 999px; background: var(--a-gold); color: #fff; font: 600 13px/1 Inter, system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.mdcai-icon.mdcai-reset:hover, .mdcai-icon.mdcai-reset:focus-visible { background: #fff; color: var(--a-navy); }
.mdcai-reset svg { width: 16px; height: 16px; }
.mdcai-head { gap: 8px; }
@media (max-width: 360px) { .mdcai-reset span { display: none; } .mdcai-icon.mdcai-reset { width: 34px; padding: 0; justify-content: center; } }
