/* =======================================================================
   EDU Floating Contact (Shared Base Styles)
   ======================================================================= */
.edu-floating-contact {
	position: fixed;
	z-index: 9999;
}

.edu-floating-contact__list {
	display: flex;
	box-sizing: border-box;
}

.edu-floating-contact__item {
	position: relative;
	/* Đảm bảo relative để label tooltip bám đúng vị trí từng item */
	display: flex;
	text-decoration: none !important;
	outline: none;
	box-sizing: border-box;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.edu-floating-contact__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.edu-floating-contact__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	border-radius: inherit;
}

.edu-floating-contact__icon-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-transform: uppercase;
}

.edu-floating-contact__label {
	box-sizing: border-box;
}

.edu-floating-contact__toggle {
	box-sizing: border-box;
}

/* =======================================================================
   EDU Floating Contact - Desktop Only (>= 769px)
   ======================================================================= */
@media (min-width: 769px) {
	@keyframes eduFloatingContactFadeIn {
		from {
			opacity: 0;
			transform: translateX(8px);
		}

		to {
			opacity: 1;
			transform: translateX(0);
		}
	}

	.edu-floating-contact {
		right: 10px;
		/* Sát lề phải */
		top: auto;
		bottom: 8%;
		transform: none;
		display: flex;
		flex-direction: column;
		pointer-events: none;
		animation: eduFloatingContactFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
		overflow: visible;
		/* Đổi thành visible để nhãn tooltip không bị cắt */
	}

	.edu-floating-contact__list {
		flex-direction: column;
		padding: 0;
		/* Bỏ padding ngoài để active khít ô dock */
		gap: 6px;
		/* Tăng khoảng cách để các icon tách rời */
		pointer-events: auto;
		overflow: visible;
		/* Cho phép hiển thị tooltip */
	}

	.edu-floating-contact__item {
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		border-radius: 999px;
	}

	/* Active/hover style chính nằm ở ô icon/item: nền xanh nhạt, nhấn border-left bằng inset shadow */
	.edu-floating-contact__item:hover,
	.edu-floating-contact__item:focus {
		background-color: rgba(39, 178, 79, 0.08);
		/* nền xanh nhạt */
		box-shadow: none;
	}

	.edu-floating-contact__icon {
		width: 30px;
		height: 30px;
		border-radius: 4px;
		overflow: visible;
	}

	.edu-floating-contact__icon-placeholder {
		font-size: 14px;
		color: var(--edu-primary);
		background-color: rgba(39, 178, 79, 0.08);
		border-radius: 4px;
	}

	/* Label chỉ đóng vai trò tooltip phụ, nền trắng, không quá nổi bật */
	.edu-floating-contact__label {
		position: absolute;
		right: calc(100% + 6px);
		/* Nằm ngay bên trái item */
		top: 50%;
		transform: translateY(-50%);
		opacity: 0;
		visibility: hidden;
		background-color: #ffffff;
		/* nền trắng */
		border: 1px solid rgba(148, 163, 184, 0.2);
		/* border mỏng */
		border-radius: 4px;
		padding: 6px 10px;
		font-size: 12px;
		font-weight: 600;
		color: var(--edu-heading);
		white-space: nowrap;
		box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.05);
		transition: opacity 0.2s ease, visibility 0.2s ease;
		pointer-events: none;
		z-index: 20;
		/* Đảm bảo nổi bật lên trên content */
	}

	.edu-floating-contact__item:hover .edu-floating-contact__label,
	.edu-floating-contact__item:focus-within .edu-floating-contact__label,
	.edu-floating-contact__item:focus .edu-floating-contact__label {
		opacity: 1;
		visibility: visible;
	}

	/* Ẩn toggle button trên desktop */
	.edu-floating-contact__toggle {
		display: none;
	}
}

/* =======================================================================
   EDU Floating Contact - Mobile Only (<= 768px)
   ======================================================================= */
@media (max-width: 768px) {
	.edu-floating-contact {
		top: auto;
		right: 16px;
		bottom: 10%;
		/* Sát góc phải dưới */
		left: auto;
		transform: none;
		background: none;
		border: none;
		box-shadow: none;
		padding: 0;
		width: auto;
		animation: none;
		pointer-events: auto;
		border-radius: 0;
	}

	/* Nền trắng bao toàn bộ list */
	.edu-floating-contact__list {
		position: absolute;
		right: 0;
		bottom: calc(100% + 8px);
		flex-direction: column;
		gap: 6px;
		padding: 0;
		background-color: transparent;
		/* nền trắng bao toàn bộ */
		border: none;
		/* border mỏng xám/xanh nhạt */
		box-shadow: none;
		/* shadow nhẹ */
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(8px);
		transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
	}

	/* Khi click toggle mở list */
	.edu-floating-contact.is-open .edu-floating-contact__list {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}

	.edu-floating-contact__item {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 56px;
		/* width khoảng 54px - 58px */
		height: auto;
		min-height: 52px;
		/* min-height đủ chứa icon + label */
		border-radius: 4px;
		background-color: transparent;
		border: none;
		box-shadow: none;
		padding: 4px 0;
	}

	.edu-floating-contact__item:active,
	.edu-floating-contact__item:hover,
	.edu-floating-contact__item:focus {
		background-color: rgba(39, 178, 79, 0.05);
		/* Nền xanh nhạt khi touch/hover */
		box-shadow: none;
		/* Reset shadow desktop */
	}

	/* Sắp xếp icon lên trên, label xuống dưới */
	.edu-floating-contact__icon {
		order: 1;
		width: 28px;
		/* width/height khoảng 28px - 30px */
		height: 28px;
		border-radius: 4px;
		transition: none;
	}

	.edu-floating-contact__icon-placeholder {
		font-size: 13px;
		color: var(--edu-primary);
		background-color: rgba(39, 178, 79, 0.08);
		border-radius: 4px;
	}

	/* Reset hoàn toàn label trên di động khỏi style desktop */
	.edu-floating-contact__label {
		position: static !important;
		order: 2 !important;
		display: block !important;
		opacity: 1 !important;
		visibility: visible !important;
		transform: none !important;
		background-color: transparent !important;
		border: none !important;
		box-shadow: none !important;
		padding: 0 !important;
		margin-top: 3px !important;
		font-size: 10px !important;
		line-height: 1.2 !important;
		text-align: center !important;
		color: var(--edu-heading) !important;
		transform: none !important;
		opacity: 1 !important;
		visibility: visible !important;
	}

	/* Hiện toggle trên Mobile */
	.edu-floating-contact__toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		/* width/height khoảng 46px - 50px */
		height: 48px;
		border-radius: 4px;
		background-color: var(--edu-primary);
		/* màu xanh theme Edu Trade */
		color: var(--edu-white);
		/* icon màu trắng */
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
		/* shadow nhẹ */
		border: none;
		cursor: pointer;
		outline: none;
		transition: background-color 0.2s ease, transform 0.2s ease;
	}

	.edu-floating-contact.is-open .edu-floating-contact__toggle {
		background-color: var(--edu-accent);
		/* màu đỏ theme khi mở */
	}

	/* Hiển thị ẩn icon toggle tương ứng với đóng/mở */
	.edu-floating-contact__toggle-icon--close {
		display: none;
	}

	.edu-floating-contact__toggle-icon--open {
		display: block;
	}

	.edu-floating-contact.is-open .edu-floating-contact__toggle-icon--close {
		display: block;
	}

	.edu-floating-contact.is-open .edu-floating-contact__toggle-icon--open {
		display: none;
	}

	.edu-floating-contact__toggle:active {
		transform: scale(0.95);
	}

	.edu-floating-contact__toggle-icon {
		width: 24px;
		height: 24px;
		stroke: currentColor;
	}
}

/* =======================================================================
   Wave & Shake Animations
   ======================================================================= */

/* Wave Animation */
.edu-floating-contact__item--wave .edu-floating-contact__icon {
	position: relative;
}

.edu-floating-contact__item--wave .edu-floating-contact__icon::before {
	content: "";
	position: absolute;
	inset: -6px;
	border: 2px solid var(--theme-palette-color-2, var(--edu-primary, #27b24f));
	border-radius: 999px;
	opacity: 0;
	animation: edu-floating-wave 1.8s ease-out infinite;
	pointer-events: none;
	box-sizing: border-box;
}

@keyframes edu-floating-wave {
	0% {
		transform: scale(.85);
		opacity: .75;
	}

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

/* Shake Animation */
.edu-floating-contact__item--shake .edu-floating-contact__icon {
	animation: edu-floating-shake 1.6s ease-in-out infinite;
}

@keyframes edu-floating-shake {

	0%,
	100% {
		transform: rotate(0);
	}

	10%,
	30% {
		transform: rotate(-8deg);
	}

	20%,
	40% {
		transform: rotate(8deg);
	}

	50% {
		transform: rotate(0);
	}
}