/* ===== Nút lên đầu trang ===== */
.back-to-top {
  position: fixed;
  right: 1.75rem; /* căn giữa với nút Chatbot 3.5rem */
  bottom: 5.75rem; /* phía trên nút Chatbot (cao 3.5rem) */
  z-index: 999;
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(193, 18, 31, 0.25);
  border-radius: 9999px;
  background: #fff;
  color: #c1121f;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s, color 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  background: #c1121f;
  color: #fff;
  outline: none;
}

/* Ẩn khi khung chat đang mở để không đè lên */
body.chat-open .back-to-top {
  opacity: 0;
  visibility: hidden;
}

@media (max-width: 480px) {
  .back-to-top {
    right: 1.25rem;
    bottom: 5.25rem;
  }
}
