/* ==========================================================================
   CDSVN Support - Sticky Buttons Frontend
   ========================================================================== */

/* Container */
.cdsvn-sticky-buttons {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 9999;
	list-style: none;
	margin: 0;
	padding: 12px 8px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	border-radius: 30px 0 0 30px;
}

.cdsvn-sticky-buttons--right {
	right: 0;
}

.cdsvn-sticky-buttons--left {
	left: 0;
	border-radius: 0 30px 30px 0;
}

/* Inverted corner curves via pseudo-elements */
.cdsvn-sticky-buttons::before,
.cdsvn-sticky-buttons::after {
	content: '';
	position: absolute;
	right: 0;
	width: 30px;
	height: 30px;
	background: transparent;
}

.cdsvn-sticky-buttons--left::before,
.cdsvn-sticky-buttons--left::after {
	right: auto;
	left: 0;
}

.cdsvn-sticky-buttons::before {
	top: -30px;
	border-radius: 0 0 15px 0;
}

.cdsvn-sticky-buttons--right::before {
	box-shadow: 15px 0 0 0 var(--cdsvn-support-bg, #239964);
}

.cdsvn-sticky-buttons--left::before {
	border-radius: 0 0 0 30px;
	box-shadow: -15px 0 0 0 var(--cdsvn-support-bg, #239964);
}

.cdsvn-sticky-buttons::after {
	bottom: -30px;
	border-radius: 0 15px 0 0;
}

.cdsvn-sticky-buttons--right::after {
	box-shadow: 15px 0 0 0 var(--cdsvn-support-bg, #239964);
}

.cdsvn-sticky-buttons--left::after {
	border-radius: 30px 0 0 0;
	box-shadow: -15px 0 0 0 var(--cdsvn-support-bg, #239964);
}

/* Individual button item */
.cdsvn-sticky-buttons__item {
	position: relative;
}

.cdsvn-sticky-buttons__item a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	transition: all 0.25s ease-in-out;
	text-decoration: none;
	position: relative;
	overflow: visible;
}

.cdsvn-sticky-buttons__item a:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.1);
}

/* Icon wrapper */
.cdsvn-sticky-buttons__item-image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
}

.cdsvn-sticky-buttons__item-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

/* Fallback SVG icon when no image set */
.cdsvn-sticky-buttons__item-image svg {
	width: 24px;
	height: 24px;
	fill: #fff;
}

/* Hover label text */
.cdsvn-sticky-buttons__item-text {
	position: absolute;
	white-space: nowrap;
	background: var(--cdsvn-support-bg, #239964);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 6px;
	opacity: 0;
	visibility: hidden;
	transition: all 0.25s ease-in-out;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Right position: label goes left */
.cdsvn-sticky-buttons--right .cdsvn-sticky-buttons__item-text {
	right: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%) translateX(10px);
}

.cdsvn-sticky-buttons--right .cdsvn-sticky-buttons__item a:hover .cdsvn-sticky-buttons__item-text {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
}

/* Left position: label goes right */
.cdsvn-sticky-buttons--left .cdsvn-sticky-buttons__item-text {
	left: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%) translateX(-10px);
}

.cdsvn-sticky-buttons--left .cdsvn-sticky-buttons__item a:hover .cdsvn-sticky-buttons__item-text {
	opacity: 1;
	visibility: visible;
	transform: translateY(-50%) translateX(0);
}

/* Arrow on label tooltip - right position */
.cdsvn-sticky-buttons--right .cdsvn-sticky-buttons__item-text::after {
	content: '';
	position: absolute;
	top: 50%;
	right: -6px;
	transform: translateY(-50%);
	border-width: 6px;
	border-style: solid;
	border-color: transparent transparent transparent var(--cdsvn-support-bg, #239964);
}

/* Arrow on label tooltip - left position */
.cdsvn-sticky-buttons--left .cdsvn-sticky-buttons__item-text::after {
	content: '';
	position: absolute;
	top: 50%;
	left: -6px;
	transform: translateY(-50%);
	border-width: 6px;
	border-style: solid;
	border-color: transparent var(--cdsvn-support-bg, #239964) transparent transparent;
}

/* Shake animation for hotline button */
.cdsvn-sticky-buttons__item--animate a {
	animation: cdsvn-shake 0.8s ease-in-out infinite;
}

.cdsvn-sticky-buttons__item--animate a:hover {
	animation: none;
}

@keyframes cdsvn-shake {
	0% {
		transform: rotate(0deg);
	}

	10% {
		transform: rotate(-15deg);
	}

	20% {
		transform: rotate(15deg);
	}

	30% {
		transform: rotate(-10deg);
	}

	40% {
		transform: rotate(10deg);
	}

	50% {
		transform: rotate(-5deg);
	}

	60% {
		transform: rotate(5deg);
	}

	70% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(0deg);
	}
}

/* Pulse ring effect on animated items */
.cdsvn-sticky-buttons__item--animate::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	animation: cdsvn-pulse 2s ease-out infinite;
	pointer-events: none;
}

@keyframes cdsvn-pulse {
	0% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 0.6;
	}

	100% {
		transform: translate(-50%, -50%) scale(1.8);
		opacity: 0;
	}
}

/* Responsive */
@media (max-width: 480px) {
	.cdsvn-sticky-buttons {
		padding: 8px 6px;
		gap: 6px;
	}

	.cdsvn-sticky-buttons__item a {
		width: 36px;
		height: 36px;
	}

	.cdsvn-sticky-buttons__item-image {
		width: 22px;
		height: 22px;
	}

	.cdsvn-sticky-buttons__item--animate::before {
		width: 36px;
		height: 36px;
	}

	.cdsvn-sticky-buttons__item-text {
		display: none;
	}
}