/**
 * SWS WhatsApp Chat — front-end styles.
 * Self-contained: no theme variables, so the plugin looks the same wherever it is installed.
 */

.sws-wa {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---- the round button ---- */
.sws-wa__btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 10px 26px rgba(0, 0, 0, .28);
	transition: background .22s ease, transform .22s ease;
	-webkit-appearance: none;
	appearance: none;
}
.sws-wa__btn:hover { background: #3be07a; }
.sws-wa__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.sws-wa__btn:active { transform: scale(.94); }

/* The glyph swaps to a close cross while the card is open, so the same control does both jobs
   and the button never disappears from under the visitor's finger. */
.sws-wa__btn-ic,
.sws-wa__btn-x {
	display: flex;
	transition: opacity .18s ease, transform .18s ease;
}
.sws-wa__btn-x {
	position: absolute;
	opacity: 0;
	transform: rotate(-90deg);
}
.sws-wa--open .sws-wa__btn-ic { opacity: 0; transform: rotate(90deg); }
.sws-wa--open .sws-wa__btn-x  { opacity: 1; transform: rotate(0); }

/* ---- the card ---- */
.sws-wa__card {
	position: absolute;
	right: 0;
	bottom: 72px;
	width: min(320px, calc(100vw - 40px));
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
	transform-origin: bottom right;
}
.sws-wa__card[hidden] { display: none; }
.sws-wa--open .sws-wa__card { animation: sws-wa-in .22s ease both; }
@keyframes sws-wa-in {
	from { opacity: 0; transform: translateY(10px) scale(.96); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.sws-wa--open .sws-wa__card { animation: none; }
	.sws-wa__btn, .sws-wa__btn-ic, .sws-wa__btn-x { transition: none; }
}

.sws-wa__head {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 14px 14px 14px 16px;
	background: #075e54;
	color: #fff;
}
.sws-wa__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
}
.sws-wa__who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sws-wa__name {
	font-size: 14.5px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.sws-wa__status { font-size: 11.5px; opacity: .82; }
.sws-wa__status::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 6px;
	border-radius: 50%;
	background: #6ef29a;
	vertical-align: middle;
}
.sws-wa__close {
	margin-left: auto;
	padding: 0 2px;
	border: 0;
	background: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: .8;
}
.sws-wa__close:hover { opacity: 1; }

.sws-wa__body { padding: 16px; background: #ece5dd; }
.sws-wa__msg {
	padding: 11px 13px;
	border-radius: 4px 12px 12px 12px;
	background: #fff;
	color: #1f2c34;
	font-size: 13.5px;
	line-height: 1.55;
	box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
}
.sws-wa__meta {
	margin: 6px 0 14px;
	color: #667781;
	font-size: 10.5px;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.sws-wa__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 12px 18px;
	border-radius: 999px;
	background: #25d366;
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background .22s ease;
}
.sws-wa__cta:hover { background: #1fb855; color: #fff !important; }
.sws-wa__alt {
	display: block;
	margin-top: 10px;
	color: #4a5b66 !important;
	font-size: 12.5px;
	text-align: center;
	text-decoration: none !important;
}
.sws-wa__alt:hover { text-decoration: underline !important; }

@media (max-width: 480px) {
	.sws-wa { right: 14px; bottom: 14px; }
	.sws-wa__btn { width: 54px; height: 54px; }
	.sws-wa__card { bottom: 66px; width: calc(100vw - 28px); }
}
