/**
 * Popover Chat for Elementor — frontend styles.
 * Every value here is a sane default; the Elementor Style tab overrides it.
 */

.pcw {
	--pcw-offset-x: 24px;
	--pcw-offset-y: 24px;
	--pcw-launcher-size: 60px;
	--pcw-panel-width: 360px;
	--pcw-panel-max-height: 70vh;
	--pcw-panel-gap: 14px;
	--pcw-caret: #9aa5b1;
	--pcw-z: 9999;

	position: relative;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- Launcher */

.pcw__launcher {
	position: fixed;
	bottom: var(--pcw-offset-y);
	z-index: var(--pcw-z);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: var(--pcw-launcher-size);
	height: var(--pcw-launcher-size);
	margin: 0;
	padding: 0 calc(var(--pcw-launcher-size) / 3);
	border: 0;
	border-radius: 50%;
	background-color: #1f2933;
	color: #fff;
	font: inherit;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(16, 24, 40, 0.22);
	transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

.pcw--right .pcw__launcher,
.pcw--right .pcw__panel {
	right: var(--pcw-offset-x);
}

.pcw--left .pcw__launcher,
.pcw--left .pcw__panel {
	left: var(--pcw-offset-x);
}

.pcw__launcher:hover {
	transform: translateY(-2px);
}

.pcw__launcher:active {
	transform: translateY(0);
}

.pcw__launcher:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.pcw__launcher-icon,
.pcw__launcher-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
	line-height: 1;
	transition: transform 0.22s ease, opacity 0.16s ease;
}

.pcw__launcher-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.pcw__launcher-label {
	white-space: nowrap;
	font-weight: 600;
}

/* An icon-only launcher stays a perfect circle. */
.pcw__launcher--icon-only {
	padding: 0;
	width: var(--pcw-launcher-size);
}

.pcw__launcher-close {
	position: absolute;
	inset: 0;
	opacity: 0;
	transform: rotate(-90deg) scale(0.6);
	pointer-events: none;
}

.pcw__launcher-close svg {
	width: 44%;
	max-width: 26px;
	height: auto;
}

.pcw__launcher.is-active .pcw__launcher-icon,
.pcw__launcher.is-active .pcw__launcher-label {
	opacity: 0;
	transform: scale(0.6);
}

.pcw__launcher.is-active .pcw__launcher-close {
	opacity: 1;
	transform: rotate(0) scale(1);
}

/* ------------------------------------------------------------------- Panel */

.pcw__panel {
	position: fixed;
	bottom: calc(var(--pcw-offset-y) + var(--pcw-launcher-size) + var(--pcw-panel-gap));
	z-index: var(--pcw-z);
	display: flex;
	flex-direction: column;
	width: min(var(--pcw-panel-width), calc(100vw - (var(--pcw-offset-x) * 2)));
	max-height: var(--pcw-panel-max-height);
	overflow: hidden;
	border-radius: 18px;
	background-color: #fff;
	box-shadow: 0 24px 60px rgba(16, 24, 40, 0.2), 0 2px 8px rgba(16, 24, 40, 0.08);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform, opacity;
}

.pcw--left .pcw__panel {
	transform-origin: bottom left;
}

.pcw__panel[hidden] {
	display: none;
}

.pcw__panel.is-open {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* ------------------------------------------------------------------ Header */

.pcw__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background-color: #f8f9fb;
	border-bottom: 1px solid rgba(16, 24, 40, 0.07);
	flex: 0 0 auto;
}

.pcw__avatar-wrap {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
}

.pcw__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.pcw__status {
	position: absolute;
	right: -1px;
	bottom: -1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background-color: #22c55e;
	box-shadow: 0 0 0 2px #fff;
}

.pcw__status--inline {
	position: static;
	display: inline-block;
	width: 7px;
	height: 7px;
	margin-right: 6px;
	box-shadow: none;
	vertical-align: middle;
}

.pcw__header-text {
	min-width: 0;
	flex: 1 1 auto;
}

.pcw__title {
	color: #1f2933;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.pcw__subtitle {
	margin-top: 2px;
	color: #6b7280;
	font-size: 12.5px;
	line-height: 1.35;
}

.pcw__close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #98a2b3;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pcw__close svg {
	width: 16px;
	height: 16px;
}

.pcw__close:hover {
	background-color: rgba(16, 24, 40, 0.06);
	color: #1f2933;
}

.pcw__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* -------------------------------------------------------------------- Body */

.pcw__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px;
	-webkit-overflow-scrolling: touch;
}

.pcw__messages {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
}

.pcw__msg {
	max-width: 92%;
	padding: 12px 15px;
	border-radius: 16px 16px 16px 4px;
	background-color: #f2f4f7;
	color: #1f2933;
	font-size: 14.5px;
	overflow-wrap: anywhere;
	animation: pcw-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.pcw__msg[hidden] {
	display: none;
}

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

/* Blinking caret while a message is typing. */
.pcw__msg.is-typing::after {
	content: "";
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	background-color: var(--pcw-caret);
	vertical-align: -0.15em;
	animation: pcw-blink 1s steps(1) infinite;
}

/* --------------------------------------------------------------- Indicator */

.pcw__indicator {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 14px 16px;
	border-radius: 16px 16px 16px 4px;
	background-color: #f2f4f7;
	animation: pcw-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.pcw__indicator span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--pcw-caret);
	animation: pcw-bounce 1.2s infinite ease-in-out;
}

.pcw__indicator span:nth-child(2) {
	animation-delay: 0.15s;
}

.pcw__indicator span:nth-child(3) {
	animation-delay: 0.3s;
}

/* ----------------------------------------------------------------- Actions */

.pcw__actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.pcw__actions[hidden] {
	display: none;
}

.pcw__actions--stack {
	flex-direction: column;
}

.pcw__actions--inline {
	flex-flow: row wrap;
}

.pcw__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid transparent;
	border-radius: 10px;
	background-color: #1f2933;
	color: #fff;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.pcw__btn.is-visible {
	animation: pcw-rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.pcw__btn:hover {
	transform: translateY(-1px);
}

.pcw__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pcw__btn--secondary {
	background-color: transparent;
	border-color: #d0d5dd;
	color: #1f2933;
}

.pcw__btn-icon {
	display: inline-flex;
	align-items: center;
	font-size: 1em;
}

.pcw__btn-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.pcw__footer {
	margin-top: 12px;
	color: #98a2b3;
	font-size: 12px;
	text-align: center;
}

.pcw__footer[hidden] {
	display: none;
}

/* ------------------------------------------------------------- Small print */

@media (max-width: 480px) {
	.pcw__panel {
		width: calc(100vw - (var(--pcw-offset-x) * 2));
	}
}

@keyframes pcw-pop {
	from {
		opacity: 0;
		transform: translateY(6px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes pcw-rise {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes pcw-blink {
	0%,
	49% {
		opacity: 1;
	}
	50%,
	100% {
		opacity: 0;
	}
}

@keyframes pcw-bounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
		opacity: 0.55;
	}
	30% {
		transform: translateY(-4px);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pcw__launcher,
	.pcw__panel,
	.pcw__btn,
	.pcw__msg,
	.pcw__indicator,
	.pcw__launcher-icon,
	.pcw__launcher-close {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}

	.pcw__msg.is-typing::after {
		animation: none;
	}
}
