.p1wc-whatsapp-chat,
.p1wc-whatsapp-chat * {
	box-sizing: border-box;
}

.p1wc-whatsapp-chat {
	position: fixed;
	z-index: 999999;
	display: grid;
	width: max-content;
	color: var(--p1wc-text, #111827);
	font-family: var(--p1wc-font-family, inherit);
	font-size: var(--p1wc-font-size, 14px);
	line-height: 1.4;
}

.p1wc-whatsapp-chat--bottom-right {
	right: 22px;
	bottom: 22px;
}

.p1wc-whatsapp-chat--bottom-left {
	bottom: 22px;
	left: 22px;
}

.p1wc-whatsapp-chat--top-right {
	top: 22px;
	right: 22px;
}

.p1wc-whatsapp-chat--top-left {
	top: 22px;
	left: 22px;
}

.p1wc-chat-panel {
	position: absolute;
	right: 0;
	bottom: calc(var(--p1wc-bubble-size, 62px) + 16px);
	display: flex;
	flex-direction: column;
	width: min(var(--p1wc-window-width, 360px), calc(100vw - 32px));
	max-height: min(620px, calc(100vh - var(--p1wc-bubble-size, 62px) - 58px));
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 8px;
	box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
	opacity: 0;
	overflow: hidden;
	pointer-events: none;
	transform: translateY(10px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 180ms ease, transform 180ms ease;
}

.p1wc-whatsapp-chat--bottom-left .p1wc-chat-panel,
.p1wc-whatsapp-chat--top-left .p1wc-chat-panel {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

.p1wc-whatsapp-chat--top-right .p1wc-chat-panel,
.p1wc-whatsapp-chat--top-left .p1wc-chat-panel {
	top: calc(var(--p1wc-bubble-size, 62px) + 16px);
	bottom: auto;
	transform: translateY(-10px) scale(0.98);
}

.p1wc-whatsapp-chat.is-open .p1wc-chat-panel {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.p1wc-chat-panel__header {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr) 34px;
	gap: 12px;
	align-items: center;
	min-height: 82px;
	padding: 16px 14px 16px 16px;
	color: #fff;
	background: var(--p1wc-header, #0f766e);
}

.p1wc-chat-panel__avatar {
	position: relative;
	display: grid;
	width: 46px;
	height: 46px;
	place-items: center;
	color: var(--p1wc-header, #0f766e);
	background: rgba(255, 255, 255, 0.96);
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.p1wc-chat-panel__avatar::after {
	content: '';
	position: absolute;
	right: 1px;
	bottom: 2px;
	width: 11px;
	height: 11px;
	background: var(--p1wc-accent, #22c55e);
	border: 2px solid var(--p1wc-header, #0f766e);
	border-radius: 999px;
}

.p1wc-chat-panel__avatar svg {
	width: 29px;
	height: 29px;
}

.p1wc-chat-panel__identity {
	display: grid;
	min-width: 0;
	gap: 2px;
}

.p1wc-chat-panel__identity strong,
.p1wc-chat-panel__identity small {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.p1wc-chat-panel__identity strong {
	font-size: calc(var(--p1wc-font-size, 14px) + 2px);
	font-weight: 800;
	letter-spacing: 0;
}

.p1wc-chat-panel__identity small {
	color: rgba(255, 255, 255, 0.82);
	font-size: max(12px, calc(var(--p1wc-font-size, 14px) - 2px));
	font-weight: 600;
}

.p1wc-chat-panel__close {
	display: grid;
	width: 34px;
	height: 34px;
	padding: 0;
	place-items: center;
	color: rgba(255, 255, 255, 0.78);
	background: transparent;
	border: 0;
	border-radius: 8px;
	font: 700 20px/1 Arial, sans-serif;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease;
}

.p1wc-chat-panel__close:hover,
.p1wc-chat-panel__close:focus-visible {
	color: #fff;
	background: rgba(255, 255, 255, 0.13);
	outline: none;
}

.p1wc-chat-panel__body {
	flex: 1 1 auto;
	min-height: 156px;
	padding: 18px 16px;
	background-color: var(--p1wc-window-bg, #f8fafc);
	background-image:
		linear-gradient(135deg, rgba(15, 23, 42, 0.035) 25%, transparent 25%),
		linear-gradient(225deg, rgba(15, 23, 42, 0.035) 25%, transparent 25%);
	background-position: 0 0, 12px 12px;
	background-size: 24px 24px;
	overflow: auto;
}

.p1wc-chat-message {
	position: relative;
	width: max-content;
	max-width: min(270px, 88%);
	padding: 12px 44px 20px 14px;
	color: var(--p1wc-text, #111827);
	background: var(--p1wc-message-bg, #fff);
	border: 1px solid rgba(15, 23, 42, 0.06);
	border-radius: 8px 8px 8px 2px;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
	font-size: var(--p1wc-font-size, 14px);
}

.p1wc-chat-message__time {
	position: absolute;
	right: 12px;
	bottom: 7px;
	color: rgba(17, 24, 39, 0.42);
	font-size: 10px;
	font-weight: 700;
}

.p1wc-chat-panel__composer {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 42px;
	gap: 10px;
	align-items: end;
	padding: 12px;
	background: #fff;
	border-top: 1px solid rgba(15, 23, 42, 0.07);
}

.p1wc-chat-panel__field {
	width: 100%;
	min-height: 42px;
	max-height: 110px;
	padding: 11px 12px;
	color: var(--p1wc-text, #111827);
	background: var(--p1wc-field-bg, #fff);
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 8px;
	font: 500 var(--p1wc-font-size, 14px)/1.4 inherit;
	resize: vertical;
	box-shadow: none;
}

.p1wc-chat-panel__field:focus {
	border-color: color-mix(in srgb, var(--p1wc-accent, #22c55e) 70%, #111827);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--p1wc-accent, #22c55e) 18%, transparent);
	outline: none;
}

.p1wc-chat-panel__send {
	display: grid;
	width: 42px;
	height: 42px;
	padding: 0;
	place-items: center;
	color: #fff;
	background: var(--p1wc-accent, #22c55e);
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 10px 20px color-mix(in srgb, var(--p1wc-accent, #22c55e) 34%, transparent);
	transition: opacity 160ms ease, transform 160ms ease;
}

.p1wc-chat-panel__send:hover,
.p1wc-chat-panel__send:focus-visible {
	transform: translateY(-1px);
	outline: none;
}

.p1wc-chat-panel__send:disabled {
	cursor: not-allowed;
	opacity: 0.42;
	transform: none;
	box-shadow: none;
}

.p1wc-chat-panel__send svg {
	width: 21px;
	height: 21px;
	margin-left: 2px;
}

.p1wc-chat-bubble {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	justify-self: end;
	min-width: var(--p1wc-bubble-size, 62px);
	height: var(--p1wc-bubble-size, 62px);
	padding: 0;
	color: var(--p1wc-bubble-icon, #25d366);
	background: var(--p1wc-bubble-bg, #fff);
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.p1wc-chat-bubble.has-label {
	gap: 10px;
	justify-content: space-between;
	max-width: min(260px, calc(100vw - 32px));
	padding: 7px 8px 7px 18px;
}

.p1wc-chat-bubble:hover,
.p1wc-chat-bubble:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
	outline: none;
}

.p1wc-chat-bubble__label {
	min-width: 0;
	max-width: 170px;
	overflow: hidden;
	color: var(--p1wc-text, #111827);
	font-size: var(--p1wc-font-size, 14px);
	font-weight: 800;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.p1wc-chat-bubble__icon {
	display: grid;
	flex: 0 0 auto;
	width: calc(var(--p1wc-bubble-size, 62px) - 20px);
	height: calc(var(--p1wc-bubble-size, 62px) - 20px);
	place-items: center;
}

.p1wc-chat-bubble__icon svg {
	width: 100%;
	height: 100%;
}

.p1wc-chat-bubble__badge {
	position: absolute;
	top: 5px;
	right: 5px;
	width: 11px;
	height: 11px;
	background: var(--p1wc-badge, #ef4444);
	border: 2px solid var(--p1wc-bubble-bg, #fff);
	border-radius: 999px;
	transition: opacity 160ms ease, transform 160ms ease;
}

.p1wc-whatsapp-chat.is-open .p1wc-chat-bubble__badge {
	opacity: 0;
	transform: scale(0.4);
}

.p1wc-chat-bubble.is-attention {
	animation: p1wc-attention 900ms ease both;
}

@keyframes p1wc-attention {
	0%,
	100% {
		transform: translateY(0) scale(1);
	}

	35% {
		transform: translateY(-4px) scale(1.04);
	}

	70% {
		transform: translateY(0) scale(0.98);
	}
}

@media (min-width: 769px) {
	.p1wc-whatsapp-chat--hide-desktop {
		display: none;
	}
}

@media (max-width: 768px) {
	.p1wc-whatsapp-chat--hide-mobile {
		display: none;
	}
}

@media (max-width: 520px) {
	.p1wc-whatsapp-chat--bottom-right,
	.p1wc-whatsapp-chat--top-right {
		right: 14px;
	}

	.p1wc-whatsapp-chat--bottom-left,
	.p1wc-whatsapp-chat--top-left {
		left: 14px;
	}

	.p1wc-whatsapp-chat--bottom-right,
	.p1wc-whatsapp-chat--bottom-left {
		bottom: 14px;
	}

	.p1wc-whatsapp-chat--top-right,
	.p1wc-whatsapp-chat--top-left {
		top: 14px;
	}

	.p1wc-chat-panel {
		width: calc(100vw - 28px);
		max-height: min(580px, calc(100vh - var(--p1wc-bubble-size, 62px) - 44px));
	}

	.p1wc-chat-panel__header {
		min-height: 76px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.p1wc-chat-panel,
	.p1wc-chat-bubble,
	.p1wc-chat-panel__send {
		transition: none;
	}

	.p1wc-chat-bubble.is-attention {
		animation: none;
	}
}
