.content {
  padding: 20px;
  height: 200vh; /* Para demostrar que el botón flotante permanece fijo */
}

/* Widget flotante */
.floating-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
}

/* Botón principal */
.main-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4a6cf7;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.menu-item img,
.main-button img {
  width: 24px;
  transition: transform 0.3s ease;
}

.main-button:hover {
  transform: scale(1.1);
  background-color: #3a5ce5;
}

/* Menú flotante */
.floating-menu {
  position: absolute;
  bottom: 100%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 15px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  transform: translate(-50%, 80%) scale(0);
  padding: 20px 10px;
}

/* Elementos del menú */
.menu-item {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease-out;
  /* overflow: hidden; */
}

.menu-item:hover {
  transform: scale(1.1);
}

/* Colores específicos para cada botón */
.whatsapp {
  background-color: #25d366;
}

.phone {
  background-color: #4caf50;
}

.email {
  background-color: #ff9800;
}

.location {
  background-color: #f44336;
}

/* Tooltip para mostrar texto al hacer hover */
.tooltip {
  position: absolute;
  right: 60px;
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.menu-item:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* Flecha del tooltip */
.tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #333;
}

/* Estilo para el botón principal cuando es un enlace directo */
.main-button.direct-link {
  cursor: pointer;
}
.menu-item:active img {
  transform: scale(0.7);
}
.main-button:active {
  transform: scale(0.9);
}

/* Efecto de clic en los botones */
.menu-item.clicked {
  transform: scale(0.9);
}

/*===== position =====*/
.floating-widget.bottom-left {
  left: 30px;
  right: auto;
  top: auto;
  bottom: 30px;
}
.floating-widget.bottom-center {
  left: 50%;
  right: auto;
  top: auto;
  bottom: 30px;
  transform: translateX(-50%);
}
.floating-widget.bottom-right {
  left: auto;
  right: 30px;
  top: auto;
  bottom: 30px;
}
.floating-widget.top-left {
  left: 30px;
  right: auto;
  top: 30px;
  bottom: auto;
}
.floating-widget.top-center {
  left: 50%;
  right: auto;
  top: 30px;
  bottom: auto;
  transform: translateX(-50%);
}
.floating-widget.top-right {
  left: auto;
  right: 30px;
  top: 30px;
  bottom: auto;
}
.floating-widget.top-left .floating-menu,
.floating-widget.top-center .floating-menu,
.floating-widget.top-right .floating-menu {
  top: 100%;
  bottom: auto;
  transform: translate(-50%, -80%) scale(0);
}
.floating-widget.center-left {
  left: 30px;
  right: auto;
  top: 50%;
  bottom: auto;
}
.floating-widget.center-center {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
}
.floating-widget.center-right {
  left: auto;
  right: 30px;
  top: 50%;
  bottom: auto;
}
.floating-widget.bottom-left .tooltip,
.floating-widget.center-left .tooltip,
.floating-widget.top-left .tooltip {
  right: auto;
  left: 110%;
}
.floating-widget.bottom-left .tooltip::after,
.floating-widget.center-left .tooltip::after,
.floating-widget.top-left .tooltip::after {
  right: 97%;
  border-width: 6px 6px 6px 0;
  border-color: transparent #333 transparent transparent;
}

/* Ajustes para dispositivos móviles */
@media screen and (min-width: 767px) {
  /* Mostrar menú al hacer hover en el widget (solo si hay más de un elemento) */
  .floating-widget:not(.single-link):hover .floating-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0%) scale(1);
  }
}

@media (max-width: 768px) {
  .floating-widget {
    bottom: 20px;
    right: 20px;
  }

  .main-button {
    width: 55px;
    height: 55px;
  }

  .menu-item {
    width: 45px;
    height: 45px;
  }

  .tooltip {
    right: 55px;
    font-size: 12px;
    opacity: 1;
    visibility: visible;
  }

  /* En móvil, mostrar el menú solo cuando la clase active está presente (activada por JS) */
  .floating-menu {
    opacity: 0;
    visibility: hidden;
  }

  .floating-widget.active .floating-menu {
    opacity: 1;
    visibility: visible;
    /* transform: translateY(0); */
  }
}

/* Clase para mostrar el menú cuando se hace clic (añadida por JS) */
.floating-widget.active .floating-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0) scale(1);
}
