/* ChatPop — floating WhatsApp widget */

.chatpop {
	position: fixed;
	bottom: var(--chatpop-offset-y, 24px);
	z-index: var(--chatpop-z, 999999);
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 12px;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.45;
}

.chatpop--right { right: var(--chatpop-offset-x, 24px); }
.chatpop--left  { left: var(--chatpop-offset-x, 24px); align-items: flex-start; }

.chatpop * { box-sizing: border-box; }

.chatpop button {
	font-family: inherit;
	border: 0;
	background: none;
	cursor: pointer;
	color: inherit;
}

.chatpop :focus-visible {
	outline: 3px solid var(--chatpop-accent, #075E54);
	outline-offset: 3px;
}

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

.chatpop__launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: var(--chatpop-size, 62px);
	height: var(--chatpop-size, 62px);
	padding: 0;
	border-radius: 999px;
	background: var(--chatpop-brand, #25D366);
	color: var(--chatpop-icon, #fff);
	box-shadow: 0 10px 30px var(--chatpop-glow, rgba(37, 211, 102, .45)), 0 2px 6px rgba(0, 0, 0, .12);
	transition: transform .25s cubic-bezier(.34, 1.4, .64, 1), box-shadow .25s ease, background-color .25s ease;
}

.chatpop--pill .chatpop__launcher {
	width: auto;
	min-width: var(--chatpop-size, 62px);
	padding: 0 22px 0 16px;
}

.chatpop__launcher:hover { transform: translateY(-3px) scale(1.04); }
.chatpop__launcher:active { transform: translateY(0) scale(.97); }

.chatpop__icon {
	display: block;
	width: calc(var(--chatpop-size, 62px) * .52);
	height: calc(var(--chatpop-size, 62px) * .52);
	flex: none;
}
.chatpop__icon svg { width: 100%; height: 100%; display: block; }

.chatpop__label {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -.01em;
	white-space: nowrap;
}

.chatpop__badge {
	position: absolute;
	top: -4px;
	inset-inline-end: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #ff3b30;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}

/* Cincin animasi di belakang tombol */
.chatpop__ring {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
}

.chatpop--anim-pulse .chatpop__launcher { animation: chatpop-pulse 2.4s ease-in-out infinite; }
.chatpop--anim-bounce .chatpop__launcher { animation: chatpop-bounce 2.6s ease-in-out infinite; }
.chatpop--anim-wiggle .chatpop__icon { animation: chatpop-wiggle 3.2s ease-in-out infinite; }
.chatpop--anim-ripple .chatpop__ring::before,
.chatpop--anim-ripple .chatpop__ring::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 2px solid var(--chatpop-brand, #25D366);
	animation: chatpop-ripple 2.6s ease-out infinite;
}
.chatpop--anim-ripple .chatpop__ring::after { animation-delay: 1.3s; }

.chatpop.is-panel-open .chatpop__launcher { animation: none; }

@keyframes chatpop-pulse {
	0%, 100% { box-shadow: 0 10px 30px var(--chatpop-glow, rgba(37,211,102,.45)), 0 0 0 0 var(--chatpop-glow, rgba(37,211,102,.45)); }
	55%      { box-shadow: 0 10px 34px var(--chatpop-glow, rgba(37,211,102,.45)), 0 0 0 16px rgba(37,211,102,0); }
}
@keyframes chatpop-bounce {
	0%, 82%, 100% { transform: translateY(0); }
	88%           { transform: translateY(-10px); }
	94%           { transform: translateY(-4px); }
}
@keyframes chatpop-wiggle {
	0%, 88%, 100% { transform: rotate(0); }
	90%           { transform: rotate(-14deg); }
	93%           { transform: rotate(12deg); }
	96%           { transform: rotate(-6deg); }
}
@keyframes chatpop-ripple {
	0%   { transform: scale(1); opacity: .55; }
	100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Gelembung ajakan ---------- */

.chatpop__teaser {
	display: none;
	align-items: center;
	gap: 10px;
	max-width: 260px;
	padding: 12px 14px 12px 16px;
	border-radius: 18px;
	border-end-end-radius: 4px;
	background: #fff;
	color: #16281f;
	font-size: 14px;
	font-weight: 500;
	box-shadow: 0 12px 30px rgba(16, 40, 30, .16);
	opacity: 0;
	transform: translateY(10px) scale(.94);
	transition: opacity .3s ease, transform .3s cubic-bezier(.34, 1.4, .64, 1);
}
.chatpop--left .chatpop__teaser {
	border-end-end-radius: 18px;
	border-end-start-radius: 4px;
}
.chatpop.is-teaser-visible .chatpop__teaser {
	display: flex;
	opacity: 1;
	transform: translateY(0) scale(1);
}
.chatpop.is-panel-open .chatpop__teaser { display: none; }

.chatpop__teaser-close {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #eef2f0;
	color: #5b6b64;
	font-size: 16px;
	line-height: 1;
}
.chatpop__teaser-close:hover { background: #e2e8e5; }

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

.chatpop__panel {
	width: min(360px, calc(100vw - 32px));
	max-height: min(560px, calc(100vh - 140px));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 20px;
	background: #f6f8f7;
	box-shadow: 0 24px 60px rgba(11, 32, 24, .26), 0 2px 8px rgba(0, 0, 0, .08);
	opacity: 0;
	transform: translateY(16px) scale(.96);
	transform-origin: bottom right;
	transition: opacity .22s ease, transform .28s cubic-bezier(.34, 1.3, .64, 1);
}
.chatpop--left .chatpop__panel { transform-origin: bottom left; }
.chatpop__panel[hidden] { display: none; }
.chatpop.is-panel-open .chatpop__panel { opacity: 1; transform: translateY(0) scale(1); }

.chatpop__panel-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 18px 16px;
	background: linear-gradient(140deg, var(--chatpop-accent, #075E54), var(--chatpop-brand, #25D366));
	color: #fff;
}
.chatpop__panel-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: #fff;
}
.chatpop__panel-sub {
	margin: 4px 0 0;
	font-size: 13px;
	opacity: .85;
	color: #fff;
}
.chatpop__close {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: #fff;
	background: rgba(255, 255, 255, .16);
	display: grid;
	place-items: center;
}
.chatpop__close:hover { background: rgba(255, 255, 255, .28); }
.chatpop__close svg { width: 16px; height: 16px; }

.chatpop__status {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	background: rgba(0, 0, 0, .06);
	font-size: 12.5px;
	font-weight: 600;
	color: #33453e;
}
.chatpop__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9aa5a1;
	flex: none;
}
.is-open-hours .chatpop__dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.chatpop__tz { margin-inline-start: auto; font-weight: 500; opacity: .7; }

.chatpop__panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.chatpop__bubble-msg {
	align-self: flex-start;
	max-width: 92%;
	padding: 12px 14px;
	border-radius: 16px;
	border-start-start-radius: 4px;
	background: #fff;
	color: #22322c;
	font-size: 14px;
	box-shadow: 0 2px 8px rgba(16, 40, 30, .08);
}

.chatpop__notice {
	padding: 10px 12px;
	border-radius: 12px;
	background: #fff6e5;
	border: 1px solid #f5d9a8;
	color: #7a5312;
	font-size: 13px;
}

.chatpop__agents {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chatpop__agent-btn {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 10px 12px;
	border-radius: 14px;
	background: #fff;
	text-align: start;
	box-shadow: 0 1px 3px rgba(16, 40, 30, .08);
	transition: transform .18s ease, box-shadow .18s ease;
}
.chatpop__agent-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(16, 40, 30, .14);
}

.chatpop__avatar {
	flex: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	display: grid;
	place-items: center;
	background: linear-gradient(140deg, var(--chatpop-accent, #075E54), var(--chatpop-brand, #25D366));
	color: #fff;
	font-weight: 700;
	font-size: 16px;
}
.chatpop__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.chatpop__agent-meta { display: flex; flex-direction: column; min-width: 0; }
.chatpop__agent-name {
	font-size: 14.5px;
	font-weight: 650;
	color: #16281f;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.chatpop__agent-role { font-size: 12.5px; color: #6b7a74; }
.chatpop__agent-go {
	margin-inline-start: auto;
	color: var(--chatpop-brand, #25D366);
	display: grid;
	place-items: center;
}
.chatpop__agent-go svg { width: 20px; height: 20px; }

.chatpop__replies-label {
	margin: 0 0 8px;
	font-size: 12.5px;
	color: #6b7a74;
}
.chatpop__replies-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chatpop__reply {
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid #d5e0db;
	background: transparent;
	color: #2c4038;
	font-size: 13px;
	font-weight: 500;
	transition: background-color .16s ease, border-color .16s ease;
}
.chatpop__reply:hover {
	background: #fff;
	border-color: var(--chatpop-brand, #25D366);
}

.chatpop__panel-foot {
	padding: 10px 18px;
	background: #fff;
	border-top: 1px solid #e6ece9;
	font-size: 11.5px;
	color: #8a978f;
	text-align: center;
}

/* ---------- Tombol shortcode ---------- */

.chatpop-inline {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 12px 20px;
	border-radius: 999px;
	border: 2px solid var(--chatpop-brand, #25D366);
	background: var(--chatpop-brand, #25D366);
	color: var(--chatpop-icon, #fff);
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.chatpop-inline svg { width: 20px; height: 20px; flex: none; }
.chatpop-inline:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px var(--chatpop-glow, rgba(37, 211, 102, .4));
}
.chatpop-inline--outline {
	background: transparent;
	color: var(--chatpop-brand, #25D366);
}
.chatpop-inline--outline:hover {
	background: var(--chatpop-brand, #25D366);
	color: #fff;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
	.chatpop { bottom: max(16px, var(--chatpop-offset-y, 24px)); }
	.chatpop--right { right: 16px; }
	.chatpop--left { left: 16px; }
	.chatpop__panel {
		position: fixed;
		inset-inline: 12px;
		bottom: calc(var(--chatpop-size, 62px) + 28px);
		width: auto;
		max-height: calc(100vh - var(--chatpop-size, 62px) - 60px);
	}
	.chatpop__teaser { max-width: calc(100vw - 110px); }
}

@media (prefers-reduced-motion: reduce) {
	.chatpop *,
	.chatpop *::before,
	.chatpop *::after {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}
