/* Jangkar WA Button — tombol WhatsApp melayang. Semua kelas berawalan .jwab agar tidak bentrok dengan tema. */
.jwab {
	--jwab-c: #25D366;
	--jwab-c2: #128C7E;
	--jwab-ink: #0b141a;
	--jwab-muted: #667781;
	--jwab-b: 20px;
	--jwab-s: 20px;
	--jwab-z: 99990;
	position: fixed;
	bottom: calc(var(--jwab-b) + env(safe-area-inset-bottom, 0px));
	z-index: var(--jwab-z);
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.3;
	-webkit-font-smoothing: antialiased;
	pointer-events: none;
}
.jwab *, .jwab *::before, .jwab *::after { box-sizing: border-box; }
.jwab--right { right: var(--jwab-s); align-items: flex-end; }
.jwab--left { left: var(--jwab-s); align-items: flex-start; }
.jwab > * { pointer-events: auto; }
.jwab-ico { width: 1em; height: 1em; display: block; flex: none; }

/* ---------- Tombol utama ---------- */
.jwab-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 9px 22px 9px 9px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--jwab-c) 0%, var(--jwab-c2) 100%);
	color: #fff !important;
	text-decoration: none !important;
	box-shadow: 0 10px 28px -6px rgba(18, 140, 126, .55), 0 2px 6px rgba(0, 0, 0, .12), inset 0 1px 0 rgba(255, 255, 255, .25);
	transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease;
	animation: jwab-in .5s cubic-bezier(.2, .8, .2, 1) both;
	-webkit-tap-highlight-color: transparent;
}
.jwab-btn:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -8px rgba(18, 140, 126, .6), 0 3px 8px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .25); color: #fff; }
.jwab-btn:active { transform: translateY(-1px) scale(.98); }
.jwab-btn:focus-visible { outline: 3px solid rgba(37, 211, 102, .45); outline-offset: 3px; }

.jwab-btn__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	font-size: 26px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.jwab-btn__icon::after {
	/* Gelombang lembut di belakang ikon. */
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(255, 255, 255, .45);
	animation: jwab-ring 2.8s ease-out 1.2s infinite;
}
.jwab-dot {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #7CFC9A;
	border: 2px solid var(--jwab-c2);
}
.jwab-btn__text { display: flex; flex-direction: column; text-align: left; }
.jwab-btn__text strong { font-size: 15px; font-weight: 700; letter-spacing: .1px; }
.jwab-btn__text small { font-size: 11.5px; font-weight: 500; opacity: .88; margin-top: 2px; }

/* ---------- Gelembung sapaan ---------- */
.jwab-bubble {
	position: relative;
	width: 300px;
	max-width: calc(100vw - 2 * var(--jwab-s));
	padding: 16px 16px 14px;
	border-radius: 18px;
	background: #fff;
	color: var(--jwab-ink);
	box-shadow: 0 24px 48px -12px rgba(11, 20, 26, .28), 0 0 0 1px rgba(11, 20, 26, .06);
	transform-origin: bottom right;
	animation: jwab-pop .45s cubic-bezier(.2, .8, .2, 1) both;
}
.jwab--left .jwab-bubble { transform-origin: bottom left; }
.jwab-bubble[hidden] { display: none !important; }
.jwab-bubble::after {
	/* Ekor gelembung. */
	content: "";
	position: absolute;
	bottom: -7px;
	right: 34px;
	width: 14px;
	height: 14px;
	background: #fff;
	transform: rotate(45deg);
	box-shadow: 4px 4px 6px -3px rgba(11, 20, 26, .12);
}
.jwab--left .jwab-bubble::after { right: auto; left: 34px; }
.jwab-bubble__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--jwab-muted);
	font-size: 20px;
	line-height: 28px;
	cursor: pointer;
	transition: background .2s;
}
.jwab-bubble__close:hover { background: #f0f2f5; color: var(--jwab-ink); }
.jwab-bubble__head { display: flex; align-items: center; gap: 10px; padding-right: 22px; }
.jwab-avatar {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--jwab-c), var(--jwab-c2));
	color: #fff;
	font-size: 22px;
	flex: none;
}
.jwab-bubble__who { display: flex; flex-direction: column; min-width: 0; }
.jwab-bubble__who strong { font-size: 14px; font-weight: 700; }
.jwab-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--jwab-muted); margin-top: 2px; }
.jwab-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--jwab-c); box-shadow: 0 0 0 3px rgba(37, 211, 102, .18); }
.jwab-bubble__text {
	margin: 12px 0 14px !important;
	padding: 10px 12px;
	border-radius: 4px 12px 12px 12px;
	background: #f0f2f5;
	font-size: 13.5px;
	color: var(--jwab-ink);
}
.jwab-bubble__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 11px 14px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--jwab-c), var(--jwab-c2));
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none !important;
	transition: filter .2s, transform .2s;
}
.jwab-bubble__cta .jwab-ico { font-size: 18px; }
.jwab-bubble__cta:hover { filter: brightness(1.06); transform: translateY(-1px); color: #fff; }

/* ---------- Tombol di dalam konten (shortcode) ---------- */
.jwab-inline {
	--jwab-c: #25D366;
	--jwab-c2: #128C7E;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 22px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
	text-decoration: none !important;
	transition: transform .2s, box-shadow .2s, background .2s;
}
.jwab-inline .jwab-ico { font-size: 22px; }
.jwab-inline--solid { background: linear-gradient(135deg, var(--jwab-c), var(--jwab-c2)); color: #fff !important; box-shadow: 0 8px 20px -8px rgba(18, 140, 126, .6); }
.jwab-inline--solid:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -8px rgba(18, 140, 126, .65); }
.jwab-inline--outline { background: #fff; color: var(--jwab-c2) !important; box-shadow: inset 0 0 0 2px var(--jwab-c); }
.jwab-inline--outline:hover { background: #f2fdf6; transform: translateY(-2px); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
	.jwab { --jwab-s: 14px; --jwab-b: 14px; }
	.jwab-btn { padding: 7px 18px 7px 7px; gap: 10px; }
	.jwab-btn__icon { width: 40px; height: 40px; font-size: 24px; }
	.jwab-btn__text strong { font-size: 14px; }
	.jwab-btn__text small { display: none; }
	.jwab-bubble { width: 280px; }

	/* Gaya ikon: lingkaran saja. */
	.jwab--m-icon .jwab-btn { padding: 8px; }
	.jwab--m-icon .jwab-btn__text { display: none; }
	.jwab--m-icon .jwab-btn__icon { width: 46px; height: 46px; background: transparent; box-shadow: none; font-size: 30px; }

	/* Gaya bar: lebar penuh di bawah layar. */
	.jwab--m-bar { left: 0; right: 0; bottom: 0; padding: 0 12px calc(10px + env(safe-area-inset-bottom, 0px)); align-items: stretch; }
	.jwab--m-bar .jwab-btn { justify-content: center; border-radius: 14px; padding: 8px 18px; }
	.jwab--m-bar .jwab-btn__icon { width: 36px; height: 36px; font-size: 22px; }
	.jwab--m-bar .jwab-btn__text { flex-direction: row; align-items: baseline; gap: 8px; }
	.jwab--m-bar .jwab-bubble { align-self: flex-end; }
}

/* ---------- Pratinjau di halaman pengaturan ---------- */
.jwab--preview { position: absolute; }

/* ---------- Animasi ---------- */
@keyframes jwab-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes jwab-pop { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes jwab-ring {
	0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); }
	70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.jwab-btn, .jwab-bubble, .jwab-btn__icon::after { animation: none !important; }
	.jwab-btn, .jwab-inline, .jwab-bubble__cta { transition: none !important; }
}
@media print { .jwab { display: none !important; } }
