/* Marcel chat widget — ported from the source design, wired to the theme's color palette. */

.ci-chatbot {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 1000;
	font-family: var(--wp--preset--font-family--body);
}

.ci-chatbot__launcher {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--wp--preset--color--copper);
	border: none;
	box-shadow: 0 8px 20px rgba(184, 105, 67, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	margin-left: auto;
}

.ci-chatbot__launcher:hover {
	background: var(--wp--preset--color--berry);
}

.ci-chatbot__panel[hidden] {
	display: none !important;
}

.ci-chatbot__panel {
	width: 320px;
	max-width: calc(100vw - 32px);
	max-height: 460px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(28, 25, 23, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	margin-bottom: 14px;
}

.ci-chatbot__header {
	background: var(--wp--preset--color--ink);
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.ci-chatbot__avatar-wrap {
	position: relative;
	flex-shrink: 0;
}

.ci-chatbot__avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--wp--preset--color--copper);
	display: flex;
	align-items: center;
	justify-content: center;
}

.ci-chatbot__status {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--wp--preset--color--success);
	border: 1.5px solid var(--wp--preset--color--ink);
}

.ci-chatbot__title {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ci-chatbot__name {
	color: #fff;
	font-size: 14px;
	font-weight: 600;
}

.ci-chatbot__subtitle {
	color: var(--wp--preset--color--stone);
	font-size: 11px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ci-chatbot__close {
	background: transparent;
	border: none;
	color: var(--wp--preset--color--stone);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
}

.ci-chatbot__messages {
	padding: 16px 18px;
	overflow-y: auto;
	flex: 1;
	background: var(--wp--preset--color--porcelain);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ci-chatbot__bubble {
	max-width: 220px;
	padding: 11px 13px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.55;
}

.ci-chatbot__bubble--bot {
	align-self: flex-start;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--hairline);
	color: var(--wp--preset--color--ink);
}

.ci-chatbot__bubble--user {
	align-self: flex-end;
	background: var(--wp--preset--color--copper);
	color: #fff;
}

.ci-chatbot__footer {
	border-top: 1px solid var(--wp--preset--color--hairline);
	background: var(--wp--preset--color--white);
}

.ci-chatbot__faqs {
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ci-chatbot__faq {
	text-align: left;
	background: var(--wp--preset--color--porcelain);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 6px;
	padding: 9px 12px;
	font-size: 12.5px;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.ci-chatbot__faq:hover {
	border-color: var(--wp--preset--color--copper);
}

.ci-chatbot__form {
	display: flex;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--wp--preset--color--hairline);
}

.ci-chatbot__input {
	flex: 1;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 13px;
	font-family: var(--wp--preset--font-family--body);
	background: var(--wp--preset--color--white);
}

.ci-chatbot__input:disabled {
	background: var(--wp--preset--color--porcelain);
	color: var(--wp--preset--color--text-muted);
}

.ci-chatbot__send {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--copper);
	border: none;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.ci-chatbot__send:hover {
	background: var(--wp--preset--color--berry);
}

@media (max-width: 480px) {
	.ci-chatbot {
		right: 16px;
		bottom: 16px;
	}
	.ci-chatbot__launcher {
		width: 52px;
		height: 52px;
	}
}

/* When the mobile Book/Shop bar pins to the viewport bottom
   (assets/js/mobile-actionbar.js toggles this class on body, only ever
   below 600px), lift Marcel to sit above it instead of overlapping it.
   56px matches the bar's own height, from theme.css's body.has-fixed-actionbar
   padding-bottom rule. */
@media (max-width: 599px) {
	body.has-fixed-actionbar .ci-chatbot {
		bottom: calc(24px + 56px);
	}
}

@media (max-width: 480px) {
	body.has-fixed-actionbar .ci-chatbot {
		bottom: calc(16px + 56px);
	}
}
