/* Floating Support Widget — ported .sw-* styles */

.sw-root {
	--sw-accent: #f4791f;
	--sw-accent-dark: #d8630f;
	--sw-dark: #17181c;
	--sw-dark-2: #202127;
	--sw-white: #ffffff;
	--sw-text: #17181c;
	--sw-muted: #767b86;
	--sw-border: #eceef1;
	--sw-green: #25d366;
	--sw-radius: 20px;
	--sw-shadow: 0 18px 40px rgba(15, 16, 20, .28);

	position: fixed;
	right: 22px;
	bottom: 22px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.4;
	box-sizing: border-box;
}

.sw-root *,
.sw-root *::before,
.sw-root *::after {
	box-sizing: border-box;
}

.sw-root.sw-left {
	right: auto;
	left: 22px;
	align-items: flex-start;
}

/* Guard against theme CSS resets shrinking icons. */
.sw-root svg {
	vertical-align: middle;
}

/* ----------------------------------------------------------------------
 * Theme isolation reset.
 * Themes frequently style generic `button` and `a` elements (padding,
 * borders, background gradients, text-transform, min-width, etc.). The
 * rules below neutralise those inherited theme styles so every button
 * and close button inside the widget always renders with the plugin's
 * own CSS and never the active theme's design. The plugin's own `.sw-*`
 * rules below re-apply the intended styling.
 * -------------------------------------------------------------------- */
.sw-root button,
.sw-root a {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
	box-shadow: none;
	outline: none;
	text-transform: none;
	letter-spacing: normal;
	line-height: normal;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	max-width: none;
	font-family: inherit;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	text-decoration: none;
	transition: none;
}

.sw-root button:hover,
.sw-root a:hover,
.sw-root button:focus,
.sw-root a:focus,
.sw-root button:active,
.sw-root a:active {
	outline: none;
	box-shadow: none;
	text-decoration: none;
}

/* ---------- Skeleton ---------- */
.sw-skeleton {
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: var(--sw-dark);
	box-shadow: var(--sw-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
}

.sw-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--sw-accent);
	animation: sw-bounce 1.4s infinite ease-in-out both;
}

.sw-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.sw-dot:nth-child(2) {
	animation-delay: -0.16s;
}

/* ---------- Launcher ---------- */
.sw-launcher {
	position: relative;
	width: 158px;
	background: var(--sw-dark);
	border-radius: 16px;
	box-shadow: var(--sw-shadow);
	padding: 10px;
	cursor: pointer;
	animation: sw-pop .35s ease both;
}

.sw-root .sw-launcher-close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	z-index: 2;
}

.sw-root .sw-launcher-close:hover {
	background: rgba(255, 255, 255, .28);
}

.sw-launcher-close svg {
	width: 12px;
	height: 12px;
}

.sw-root .sw-launcher-cta {
	display: block;
	width: 100%;
	border: none;
	border-radius: 9px;
	padding: 9px 10px;
	margin-bottom: 8px;
	font-weight: 700;
	font-size: 13px;
	color: #fff;
	text-align: center;
	background: linear-gradient(135deg, var(--sw-accent), var(--sw-accent-dark));
	cursor: pointer;
}

.sw-launcher-media {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	overflow: hidden;
	background: var(--sw-dark-2);
}

.sw-launcher-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sw-launcher-ring {
	position: absolute;
	left: 8px;
	bottom: 8px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--sw-green);
}

.sw-launcher-ring::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--sw-green);
	animation: sw-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}

/* ---------- Bubble ---------- */
.sw-bubble-wrap {
	position: relative;
	width: 60px;
	height: 60px;
	animation: sw-pop .35s ease both;
}

.sw-root .sw-bubble {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	box-shadow: var(--sw-shadow);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	padding: 0;
	z-index: 2;
}

.sw-bubble img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sw-bubble svg {
	width: 26px;
	height: 26px;
	color: var(--sw-accent);
}

.sw-bubble-ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--sw-accent);
	animation: sw-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
	z-index: 1;
	pointer-events: none;
}

/* ---------- Panel ---------- */
.sw-panel {
	width: 370px;
	max-height: min(78vh, 620px);
	background: var(--sw-white);
	border-radius: var(--sw-radius);
	box-shadow: var(--sw-shadow);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: var(--sw-text);
	animation: sw-rise .35s ease both;
}

.sw-panel-header {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 46px 16px 16px;
	color: #fff;
	/* Diagonal stripe background injected inline via --sw-accent-color. */
	background: repeating-linear-gradient(135deg,
			var(--sw-header-accent, #e02424) 0px, var(--sw-header-accent, #e02424) 18px,
			color-mix(in srgb, var(--sw-header-accent, #e02424) 75%, white) 18px, color-mix(in srgb, var(--sw-header-accent, #e02424) 75%, white) 36px,
			color-mix(in srgb, var(--sw-header-accent, #e02424) 50%, white) 36px, color-mix(in srgb, var(--sw-header-accent, #e02424) 50%, white) 54px,
			color-mix(in srgb, var(--sw-header-accent, #e02424) 30%, white) 54px, color-mix(in srgb, var(--sw-header-accent, #e02424) 30%, white) 72px);
}

.sw-panel-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	overflow: hidden;
	background: rgba(255, 255, 255, .2);
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sw-panel-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sw-panel-avatar svg {
	width: 22px;
	height: 22px;
	color: #fff;
}

.sw-panel-id {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sw-panel-name {
	font-weight: 700;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sw-panel-status {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	opacity: .95;
}

.sw-panel-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sw-green);
	box-shadow: 0 0 0 0 rgba(37, 211, 102, .6);
}

.sw-root .sw-panel-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, .22);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.sw-root .sw-panel-close:hover {
	background: rgba(255, 255, 255, .35);
}

.sw-panel-close svg {
	width: 14px;
	height: 14px;
}

.sw-panel-body {
	padding: 16px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sw-section-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--sw-muted);
	margin: 0 0 8px;
}

/* ---------- Donate ---------- */
.sw-donate {
	background: var(--sw-white);
	border: 1px solid var(--sw-border);
	border-radius: 16px;
	overflow: hidden;
}

.sw-donate-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--sw-border);
}

.sw-donate-head svg {
	width: 20px;
	height: 20px;
	color: var(--sw-accent);
}

.sw-donate-head h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
}

.sw-donate-body {
	padding: 14px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

.sw-qr {
	width: 160px;
	height: 160px;
	object-fit: contain;
	display: block;
}

.sw-upi {
	height: 24px;
	object-fit: contain;
	display: block;
}

.sw-donate-text {
	font-size: 12.5px;
	color: var(--sw-muted);
	margin: 0;
}

/* ---------- Buttons ---------- */
.sw-btn-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.sw-btn-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sw-root .sw-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	background: var(--sw-white);
	border: 1px solid var(--sw-border);
	border-radius: 14px;
	padding: 10px;
	text-decoration: none;
	color: var(--sw-text);
	cursor: pointer;
	transition: box-shadow .15s ease, transform .15s ease;
}

.sw-root .sw-btn:hover {
	box-shadow: 0 6px 16px rgba(15, 16, 20, .1);
	transform: translateY(-1px);
}

.sw-btn-ic {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: #f4f5f7;
}

.sw-btn-ic svg {
	width: 20px;
	height: 20px;
}

.sw-btn-ic img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.sw-btn-whatsapp .sw-btn-ic {
	background: rgba(37, 211, 102, .12);
	color: var(--sw-green);
}

.sw-btn-email .sw-btn-ic {
	background: rgba(244, 121, 31, .12);
	color: var(--sw-accent);
}

.sw-btn-custom .sw-btn-ic {
	background: linear-gradient(135deg, var(--sw-accent), var(--sw-accent-dark));
	color: #fff;
}

.sw-btn-custom .sw-btn-ic.sw-btn-hasimg {
	background: transparent;
}

.sw-btn-txt {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
	flex: 1 1 auto;
}

.sw-btn-txt > span:first-child {
	font-weight: 600;
	font-size: 13.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sw-btn-sub {
	font-size: 11.5px;
	color: var(--sw-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sw-btn-grid .sw-btn {
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 6px;
}

.sw-btn-grid .sw-btn-txt {
	align-items: center;
}

.sw-btn-chevron {
	flex: 0 0 auto;
	color: var(--sw-muted);
	display: flex;
	align-items: center;
}

.sw-btn-chevron svg {
	width: 16px;
	height: 16px;
}

/* ---------- Footer ---------- */
.sw-panel-footer {
	padding: 12px 16px;
	border-top: 1px solid var(--sw-border);
	text-align: center;
	font-size: 11.5px;
	color: var(--sw-muted);
}

/* ---------- Animations ---------- */
@keyframes sw-pop {
	from {
		opacity: 0;
		transform: translateY(14px) scale(.96);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sw-rise {
	from {
		opacity: 0;
		transform: translateY(18px) scale(.97);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sw-ping {
	0% {
		transform: scale(1);
		opacity: .9;
	}

	100% {
		transform: scale(2.2);
		opacity: 0;
	}
}

@keyframes sw-bounce {

	0%,
	80%,
	100% {
		transform: scale(.6);
		opacity: .5;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.sw-root {
		right: 12px;
		bottom: 12px;
		gap: 12px;
	}

	.sw-root.sw-left {
		left: 12px;
	}

	.sw-launcher {
		width: 118px;
	}

	.sw-bubble-wrap,
	.sw-bubble {
		width: 48px;
		height: 48px;
	}

	.sw-bubble svg {
		width: 22px;
		height: 22px;
	}

	.sw-panel {
		width: calc(100vw - 24px);
		max-width: 370px;
	}
}
