/* ==========================================================================
   MI LIBRO FAVORITO — GLOBAL ACTION FEEDBACK
   Estados de carga para formularios y acciones de interfaz
   ========================================================================== */

.mlf-is-loading {
    position: relative;
    cursor: wait !important;
    pointer-events: none;
    user-select: none;
}

button.mlf-is-loading,
input[type="submit"].mlf-is-loading,
.btn.mlf-is-loading {
    opacity: .82;
}

.mlf-button-loading-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: max-content;
}

.mlf-button-spinner {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: mlfButtonSpin .65s linear infinite;
}

form.mlf-form-loading {
    cursor: wait;
}

form.mlf-form-loading button[type="submit"]:not(.mlf-is-loading),
form.mlf-form-loading input[type="submit"]:not(.mlf-is-loading) {
    pointer-events: none;
    opacity: .55;
}

@keyframes mlfButtonSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mlf-button-spinner {
        animation-duration: 1.4s;
    }
}
