/* ========================================
   AN NHIÊN HOMESTAY — Floating Contact Bubble
   Hover expansion style (circle to capsule)
   ======================================== */

.float-bubble {
  position: fixed;
  bottom: 80px; /* Tránh đè nút cuộn đầu trang */
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* Căn lề phải để khi dài ra sẽ mở rộng sang trái */
}

/* ── Menu chứa 4 nút liên hệ (Ẩn mặc định) ── */
.float-bubble__menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  position: absolute;
  bottom: 66px; /* Nổi phía trên nút chính */
  right: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

/* Kích hoạt hiển thị menu khi hover (PC) hoặc toggle class active (Mobile) */
.float-bubble:hover .float-bubble__menu,
.float-bubble.active .float-bubble__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ── Nút Toggle Chính (Luôn hiển thị) ── */
.float-bubble__main {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-green);
  color: var(--color-white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  position: relative;
}

.float-bubble__main:hover {
  background: var(--color-green-dark);
  transform: scale(1.08);
}

.float-bubble.active .float-bubble__main {
  background: var(--color-brown-dark);
  transform: rotate(180deg);
}

/* ── Each Item (Default: Circle) ── */
.float-bubble__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 48px; /* Ban đầu chỉ là hình tròn */
  height: 48px;
  padding: 8px; /* Căn chỉnh icon ở giữa */
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: width 0.3s cubic-bezier(0.25, 1, 0.5, 1), 
              background var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth);
}

/* ── Hover State: Expand to equal width ── */
.float-bubble__item:hover {
  width: 150px; /* Dài bằng nhau khi hover */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.float-bubble__item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Text Label (Hidden by default, fades in) ── */
.float-bubble__item-label {
  opacity: 0;
  white-space: nowrap;
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  margin-left: 10px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.float-bubble__item:hover .float-bubble__item-label {
  opacity: 1;
  transition-delay: 0.1s; /* Chờ vòng tròn giãn ra một chút rồi hiện chữ */
}

/* ── Item Colors ── */
.float-bubble__item--phone {
  background: var(--color-green);
}

.float-bubble__item--zalo {
  background: #0068FF;
}

.float-bubble__item--facebook {
  background: #1877F2;
}

.float-bubble__item--tiktok {
  background: #010101;
}

/* ── Mobile View ── */
@media (max-width: 768px) {
  .float-bubble {
    bottom: 70px;
    right: 16px;
    gap: 8px;
  }

  .float-bubble__item {
    width: 40px; /* Tròn nhỏ hơn trên mobile */
    height: 40px;
    padding: 6px;
  }

  .float-bubble__item-icon {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  /* Khi chạm giữ (tap) trên mobile, vẫn cho phép mở rộng */
  .float-bubble__item:active,
  .float-bubble__item:hover {
    width: 130px;
  }

  .float-bubble__item-label {
    font-size: var(--fs-caption);
    margin-left: 8px;
  }
}
