/* Desktop floating contact widget */

.af-cwidget {
	display: none;
}

@media (min-width: 768px) {
	.af-cwidget {
		display: block;
		position: fixed;
		right: 1.5rem;
		left: auto;
		bottom: 1.5rem;
		z-index: 1040;
	}

	.af-cwidget__toggle {
		position: relative;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 3.5rem;
		height: 3.5rem;
		margin-inline-start: auto;
		border: none;
		border-radius: 999px;
		background: linear-gradient(145deg, var(--af-primary) 0%, var(--af-primary-dark) 100%);
		color: #fff;
		cursor: pointer;
		box-shadow:
			0 8px 28px rgba(46, 184, 201, 0.42),
			0 2px 8px rgba(15, 23, 42, 0.12);
		transition:
			transform 0.22s ease,
			box-shadow 0.22s ease,
			background 0.22s ease;
	}

	.af-cwidget__toggle:hover {
		transform: translateY(-2px) scale(1.03);
		box-shadow:
			0 12px 36px rgba(46, 184, 201, 0.5),
			0 4px 12px rgba(15, 23, 42, 0.14);
	}

	.af-cwidget.is-open .af-cwidget__toggle {
		background: #fff;
		color: var(--af-text);
		border: 1.5px solid var(--af-border);
		box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
	}

	.af-cwidget__toggle-icon {
		position: absolute;
		display: grid;
		place-items: center;
		transition:
			opacity 0.2s ease,
			transform 0.25s ease;
	}

	.af-cwidget__toggle-icon svg {
		width: 24px;
		height: 24px;
	}

	.af-cwidget__toggle-icon--close {
		opacity: 0;
		transform: rotate(-90deg) scale(0.7);
	}

	.af-cwidget.is-open .af-cwidget__toggle-icon--phone {
		opacity: 0;
		transform: rotate(90deg) scale(0.7);
	}

	.af-cwidget.is-open .af-cwidget__toggle-icon--close {
		opacity: 1;
		transform: rotate(0) scale(1);
	}

	.af-cwidget__panel {
		position: absolute;
		right: 0;
		left: auto;
		bottom: calc(100% + 0.85rem);
		width: min(22rem, calc(100vw - 3rem));
		padding: 1.25rem;
		border-radius: calc(var(--af-radius) + 4px);
		background: #fff;
		border: 1px solid var(--af-border);
		box-shadow:
			0 20px 50px rgba(15, 23, 42, 0.14),
			0 0 0 1px rgba(46, 184, 201, 0.06);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(12px) scale(0.96);
		transform-origin: bottom right;
		transition:
			opacity 0.28s ease,
			visibility 0.28s ease,
			transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
		overflow: hidden;
	}

	[dir="rtl"] .af-cwidget__panel {
		transform-origin: bottom left;
	}

	.af-cwidget.is-open .af-cwidget__panel {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0) scale(1);
	}

	.af-cwidget__glow {
		position: absolute;
		top: -3rem;
		inset-inline-start: -2rem;
		width: 10rem;
		height: 10rem;
		border-radius: 50%;
		background: var(--af-primary);
		filter: blur(60px);
		opacity: 0.12;
		pointer-events: none;
	}

	.af-cwidget__head {
		position: relative;
		z-index: 1;
	}

	.af-cwidget__status {
		display: inline-flex;
		align-items: center;
		gap: 0.45rem;
		margin-bottom: 0.65rem;
		padding: 0.3rem 0.65rem;
		border-radius: 999px;
		background: rgba(46, 184, 201, 0.1);
		color: var(--af-primary-dark);
		font-size: 0.72rem;
		font-weight: 700;
	}

	.af-cwidget__status-dot {
		width: 0.45rem;
		height: 0.45rem;
		border-radius: 50%;
		background: #22c55e;
		box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
	}

	.af-cwidget__title {
		margin: 0 0 0.45rem;
		font-size: 1.05rem;
		font-weight: 900;
		color: var(--af-text);
	}

	.af-cwidget__desc {
		margin: 0;
		font-size: 0.84rem;
		line-height: 1.7;
		color: var(--af-muted);
	}

	.af-cwidget__actions {
		position: relative;
		z-index: 1;
		display: grid;
		gap: 0.65rem;
		margin-top: 1rem;
	}

	.af-cwidget__action {
		display: grid;
		grid-template-columns: auto 1fr auto;
		align-items: center;
		gap: 0.75rem;
		width: 100%;
		padding: 0.8rem 0.9rem;
		border: 1px solid var(--af-border);
		border-radius: 14px;
		background: #f8fafc;
		color: inherit;
		text-decoration: none;
		font: inherit;
		text-align: start;
		cursor: pointer;
		transition:
			border-color 0.2s ease,
			background 0.2s ease,
			transform 0.2s ease;
	}

	.af-cwidget__action:hover {
		border-color: rgba(46, 184, 201, 0.45);
		background: #fff;
		transform: translateY(-1px);
	}

	.af-cwidget__action-icon {
		display: grid;
		place-items: center;
		width: 2.5rem;
		height: 2.5rem;
		border-radius: 12px;
		color: #fff;
	}

	.af-cwidget__action-icon--chat {
		background: linear-gradient(145deg, var(--af-primary) 0%, var(--af-primary-dark) 100%);
	}

	.af-cwidget__action-icon--phone {
		background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
	}

	.af-cwidget__action-icon--contact {
		background: linear-gradient(145deg, #6366f1 0%, #4f46e5 100%);
	}

	.af-cwidget__action-body {
		display: grid;
		gap: 0.15rem;
		min-width: 0;
	}

	.af-cwidget__action-body strong {
		font-size: 0.9rem;
		font-weight: 800;
		color: var(--af-text);
	}

	.af-cwidget__action-body span {
		font-size: 0.78rem;
		color: var(--af-muted);
	}

	.af-cwidget__phone {
		direction: ltr;
		text-align: start;
	}

	.af-cwidget__action-arrow {
		color: var(--af-muted);
		transition: transform 0.2s ease, color 0.2s ease;
	}

	.af-cwidget__action:hover .af-cwidget__action-arrow {
		color: var(--af-primary-dark);
		transform: translateX(-2px);
	}

	[dir="ltr"] .af-cwidget__action:hover .af-cwidget__action-arrow {
		transform: translateX(2px);
	}
}
