.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    border-radius: 10%;
    background-color: #ffffff;
    color: #000000;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Añadir estas propiedades para que se comporte como un botón */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Añadir un estilo para el efecto de clic */
.back-to-top.clicked {
    transform: scale(0.95);
    background-color: #f0f0f0;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: #86ff05;
    z-index: -1;
    transition: height 0.1s linear;
}

.back-to-top i {
    font-size: 18px;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

.back-to-top:hover i {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Cuando el progreso está completo, cambiamos el color del ícono */
.back-to-top.full-progress i {
    color: #ffffff;
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top i {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: 15px;
        right: 15px;
    }
    
    .back-to-top i {
        font-size: 14px;
    }
}
