document.addEventListener("DOMContentLoaded", () => {
  const buttons = document.querySelectorAll(".toggle-btn");
  const panels = document.querySelectorAll(".panel");

  buttons.forEach((button) => {
    button.addEventListener("click", () => {
      const targetId = button.dataset.target;

      // Marcar el botón activo
      buttons.forEach((btn) => {
        btn.classList.toggle("active", btn === button);
      });

      // Activar panel correspondiente
      panels.forEach((panel) => {
        panel.classList.toggle("panel-active", panel.id === targetId);
      });
    });
  });
});

