/*
 * Every rule is scoped under #berton-cb-root so the widget outranks theme
 * resets. Hello Elementor's reset.css targets `[type="button"]`, `button` and
 * `input[type="text"]`, which ties with a plain class selector and wins on load
 * order; the ID prefix settles it without needing !important everywhere.
 */

#berton-cb-root {
	--berton-red: #e30613;
	--berton-ink: #111214;
	--berton-cream: #faf8f3;
	--berton-line: #eeeae0;
	--berton-pill-line: #e6e0d1;
	--berton-muted: #737373;
	--berton-z: 2147483000;

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: var(--berton-z);
	font-size: 16px;
	font-weight: 400;
	color: var(--berton-ink);
	line-height: 1.5;
	text-align: left;
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}

/* The site forces `Roboto` with !important on p/a/span/div, so match it. */
#berton-cb-root,
#berton-cb-root * {
	font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

#berton-cb-root *,
#berton-cb-root *::before,
#berton-cb-root *::after {
	box-sizing: border-box;
}

#berton-cb-root svg {
	display: block;
	overflow: visible;
}

/* Neutralise theme form resets inside the widget. */
#berton-cb-root button,
#berton-cb-root input {
	width: auto;
	margin: 0;
	min-height: 0;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	transition: none;
}

/* Floating action button */
#berton-cb-root .berton-cb-fab {
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: var(--berton-red);
	color: #fff;
	cursor: pointer;
	padding: 0;
	display: grid;
	place-items: center;
	box-shadow: 0 10px 30px -8px rgba(227, 6, 19, 0.55);
	transition: transform 0.15s ease;
}

#berton-cb-root .berton-cb-fab:hover,
#berton-cb-root .berton-cb-fab:focus-visible {
	background: var(--berton-red);
	color: #fff;
	transform: scale(1.05);
	outline: none;
}

#berton-cb-root .berton-cb-fab:active {
	transform: scale(0.95);
}

#berton-cb-root .berton-cb-fab svg {
	width: 28px;
	height: 28px;
}

/* Panel */
#berton-cb-root .berton-cb-panel {
	position: fixed;
	right: 24px;
	bottom: 96px;
	width: 400px;
	height: 620px;
	max-height: 85vh;
	background: #fff;
	border: 1px solid var(--berton-line);
	border-radius: 18px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	display: none;
	flex-direction: column;
}

#berton-cb-root .berton-cb-panel.is-open {
	display: flex;
}

/* Header */
#berton-cb-root .berton-cb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--berton-red);
	color: #fff;
	flex-shrink: 0;
}

#berton-cb-root .berton-cb-header-icon {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	display: grid;
	place-items: center;
}

#berton-cb-root .berton-cb-header-icon svg {
	width: 20px;
	height: 20px;
}

#berton-cb-root .berton-cb-header-text {
	flex: 1;
	min-width: 0;
}

#berton-cb-root .berton-cb-header-text strong {
	display: block;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
}

#berton-cb-root .berton-cb-header-text span {
	display: block;
	font-size: 11.5px;
	font-weight: 400;
	line-height: 1.25;
	color: rgba(255, 255, 255, 0.85);
}

#berton-cb-root .berton-cb-close {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	padding: 0;
	display: grid;
	place-items: center;
}

#berton-cb-root .berton-cb-close svg {
	width: 20px;
	height: 20px;
}

#berton-cb-root .berton-cb-close:hover,
#berton-cb-root .berton-cb-close:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	outline: none;
}

/* Conversation */
#berton-cb-root .berton-cb-body {
	flex: 1;
	overflow-y: auto;
	background: var(--berton-cream);
	padding: 16px;
}

#berton-cb-root .berton-cb-disclaimer {
	margin: 0 0 12px;
	padding: 8px 12px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.7);
	color: var(--berton-muted);
	font-size: 11.5px;
	line-height: 1.5;
}

#berton-cb-root .berton-cb-row {
	display: flex;
	justify-content: flex-start;
	margin-bottom: 12px;
}

#berton-cb-root .berton-cb-row.is-user {
	justify-content: flex-end;
}

#berton-cb-root .berton-cb-bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 18px 18px 18px 6px;
	background: #fff;
	color: var(--berton-ink);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	font-size: 13.5px;
	line-height: 1.625;
	white-space: pre-line;
	overflow-wrap: break-word;
}

#berton-cb-root .berton-cb-row.is-user .berton-cb-bubble {
	border-radius: 18px 18px 6px 18px;
	background: var(--berton-ink);
	color: #fff;
	box-shadow: none;
}

#berton-cb-root .berton-cb-bubble a {
	color: inherit;
	text-decoration: underline;
}

/* Quick replies */
#berton-cb-root .berton-cb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

#berton-cb-root .berton-cb-chip {
	appearance: none;
	border: 1px solid var(--berton-pill-line);
	border-radius: 999px;
	background: var(--berton-cream);
	color: var(--berton-ink);
	padding: 6px 12px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.625;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	box-shadow: none;
}

#berton-cb-root .berton-cb-chip:hover,
#berton-cb-root .berton-cb-chip:focus-visible {
	border-color: var(--berton-ink);
	background: var(--berton-cream);
	color: var(--berton-ink);
	text-decoration: none;
	outline: none;
}

/* Footer */
#berton-cb-root .berton-cb-footer {
	background: #fff;
	flex-shrink: 0;
}

#berton-cb-root .berton-cb-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--berton-line);
}

#berton-cb-root .berton-cb-meta-link {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--berton-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

#berton-cb-root .berton-cb-meta-link:hover,
#berton-cb-root .berton-cb-meta-link:focus-visible {
	color: rgba(17, 18, 20, 0.8);
	text-decoration: underline !important;
	outline: none;
}

#berton-cb-root .berton-cb-phone {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
	color: var(--berton-red);
	text-decoration: none;
	white-space: nowrap;
}

#berton-cb-root .berton-cb-composer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	margin: 0;
	background: none;
	border: 0;
}

#berton-cb-root .berton-cb-input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	height: 40px;
	border: 1px solid var(--berton-line);
	border-radius: 999px;
	background: var(--berton-cream);
	padding: 0 16px;
	font-size: 13.5px;
	line-height: 1.5;
	color: var(--berton-ink);
	box-shadow: none;
}

#berton-cb-root .berton-cb-input::placeholder {
	color: var(--berton-muted);
	opacity: 1;
}

#berton-cb-root .berton-cb-input:focus {
	outline: none;
	border-color: var(--berton-ink);
	background: var(--berton-cream);
}

#berton-cb-root .berton-cb-send {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: 0;
	border-radius: 50%;
	background: var(--berton-red);
	color: #fff;
	cursor: pointer;
	padding: 0;
	display: grid;
	place-items: center;
	box-shadow: none;
}

#berton-cb-root .berton-cb-send:hover,
#berton-cb-root .berton-cb-send:focus-visible {
	background: var(--berton-red);
	color: #fff;
	outline: none;
}

#berton-cb-root .berton-cb-send svg {
	width: 16px;
	height: 16px;
}

#berton-cb-root .berton-cb-legal {
	margin: 0;
	padding: 0 12px 8px;
	font-size: 10.5px;
	line-height: 1.5;
	color: var(--berton-muted);
}

/* Mobile: the panel takes over the viewport, like the original */
@media (max-width: 767px) {
	#berton-cb-root {
		right: 16px;
		bottom: 16px;
	}

	#berton-cb-root .berton-cb-panel {
		inset: 0;
		width: auto;
		height: auto;
		max-height: none;
		border: 0;
		border-radius: 0;
	}
}
